diff --git a/open-lighting-architecture/artnet-examples-0.3.11/AUTHORS b/open-lighting-architecture/artnet-examples-0.3.11/AUTHORS new file mode 100644 index 0000000..4b19f66 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/AUTHORS @@ -0,0 +1,4 @@ + +Simon Newton +nomis52@westnet.com.au + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/COPYING b/open-lighting-architecture/artnet-examples-0.3.11/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/COPYING @@ -0,0 +1,340 @@ + 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 + + 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/open-lighting-architecture/artnet-examples-0.3.11/ChangeLog b/open-lighting-architecture/artnet-examples-0.3.11/ChangeLog new file mode 100644 index 0000000..fa66971 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/ChangeLog @@ -0,0 +1,47 @@ +28/8/2006 Simon Newton + + * added artnet_dmxmonitor + +23/8/2006 Simon Newton + + * fixed off by one error in artnet-usb + + +9/05/2006 Simon Newton + + * removed compat mode + * changed to single sd + +25/04/2006 Simon Newton + + * added artnet_setdmx + * examples now support compatability mode (libartnet >= 1.0.2) + + +30/01/2006 Simon Newton + + * Build scripts now detect ncurses + +30/01/2006 Simon Newton + + * More OSX fixes + +13/04/2005 Simon Newton + + * Mac OSX portability fixes + +12/03/2005 Simon Newton + + * Split from libartnet + * Added node joining support, two nodes can now be joined to get 8 ports - + new example program artnet_multiport (you'll need to edit the second ip) + +12/02/2005 Simon Newton + + * Fixed compiler warnings + +11/02/2005 Simon Newton + + * Added firmware receive support - new example program artnet_firmware_node + * Added firmware send support - new example program artnet_firmware_server + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/INSTALL b/open-lighting-architecture/artnet-examples-0.3.11/INSTALL new file mode 100644 index 0000000..5458714 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + 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, 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 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.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You 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: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. 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. 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: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 can use 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 `..'. + + With a non-GNU `make', it is safer 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' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +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. + + 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' 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 + +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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +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 +================ + +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. + +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 + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--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' + 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. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/Makefile.am b/open-lighting-architecture/artnet-examples-0.3.11/Makefile.am new file mode 100644 index 0000000..381745c --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/Makefile.am @@ -0,0 +1,4 @@ +CLOCAL = aclocal -I $(auxdir) +ACLOCAL_AMFLAGS = -I config + +SUBDIRS = src diff --git a/open-lighting-architecture/artnet-examples-0.3.11/Makefile.in b/open-lighting-architecture/artnet-examples-0.3.11/Makefile.in new file mode 100644 index 0000000..3cda02e --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/Makefile.in @@ -0,0 +1,597 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + config/depcomp config/install-sh config/missing depcomp \ + install-sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libartnet_CFLAGS = @libartnet_CFLAGS@ +libartnet_LIBS = @libartnet_LIBS@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +CLOCAL = aclocal -I $(auxdir) +ACLOCAL_AMFLAGS = -I config +SUBDIRS = src +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/NEWS b/open-lighting-architecture/artnet-examples-0.3.11/NEWS new file mode 100644 index 0000000..65eaab0 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/NEWS @@ -0,0 +1,22 @@ +13/04/2005 artnet-examples-0.3.2 + + Addition of artnet_setdmx + Upgraded examples to support compatability mode (libartnet >= 1.0.2) + +13/04/2005 artnet-examples-0.3.2 + + Mac OS X fixes + +12/03/2005 artnet-examples-0.3.1 + + Split from libartnet package + Added artnet-multiport + +12/2/2005 libartnet-0.1.3 + + Fixed compiler warnings + +11/02/2005 libartnet-0.1.2 + + Now includes support for Firmware send/receive. + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/README b/open-lighting-architecture/artnet-examples-0.3.11/README new file mode 100644 index 0000000..7a6b980 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/README @@ -0,0 +1,57 @@ + +This package provides example programs for use with libartnet. + +For installation notes, see the INSTALL file. + +Examples provided: + + A. artnet-usb + B. artnet-dmxconsole + C. artnet-discover + +A. artnet-usb +------------- + +Usage: artnet-usb [OPTIONS] +Acts as an ArtNet to DMX node using the Enttec Open Usb Interface + + -a IP address to listen on (defaults to the address + of the first non loopback interface) + -d device for dmx output (default /dev/dmx0) + -p port address for output universe (default 0) + -s subnet address for output universe (default 0) + -v be verbose (prints data for first four channels) + +The universe address of the port is made up from the subnet address and the +port address. The four least significat bits are the port address, the four +most significat are the subnet address. + +For example : + +artnet-usb -p 3 -s 2 + +sets the universe address to 0x23 + + +B. artnet-dmxconsole +-------------------- +Usage: artnet-dmxconsole [OPTIONS] +A console based controller which outputs DMX data over ArtNet. +Modified from the original dmxconsole in dmx4linux. + + -a IP address to send from (defaults to the address + of the first non loopback interface) + -p port address for universe (default 0) + -s subnet address for universe (default 0) + + +C. artnet-discover +------------------ + +Usage: artnet-discover [OPTIONS] +Prints information about ArtNet nodes + + -a IP address to use (defaults to the address + of the first non loopback interface) + -t The number of seconds to wait for replies + (defaults to 2 seconds) diff --git a/open-lighting-architecture/artnet-examples-0.3.11/aclocal.m4 b/open-lighting-architecture/artnet-examples-0.3.11/aclocal.m4 new file mode 100644 index 0000000..6887675 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/aclocal.m4 @@ -0,0 +1,875 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([config/pkg.m4]) diff --git a/open-lighting-architecture/artnet-examples-0.3.11/config.h.in b/open-lighting-architecture/artnet-examples-0.3.11/config.h.in new file mode 100644 index 0000000..bba1ffd --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/config.h.in @@ -0,0 +1,132 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the `atexit' function. */ +#undef HAVE_ATEXIT + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMEB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to 1 if your declares `struct tm'. */ +#undef TM_IN_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc diff --git a/open-lighting-architecture/artnet-examples-0.3.11/config/depcomp b/open-lighting-architecture/artnet-examples-0.3.11/config/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/config/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/config/install-sh b/open-lighting-architecture/artnet-examples-0.3.11/config/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/config/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/config/missing b/open-lighting-architecture/artnet-examples-0.3.11/config/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/config/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/config/pkg.m4 b/open-lighting-architecture/artnet-examples-0.3.11/config/pkg.m4 new file mode 100644 index 0000000..a0b9cd4 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/config/pkg.m4 @@ -0,0 +1,155 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/open-lighting-architecture/artnet-examples-0.3.11/configure b/open-lighting-architecture/artnet-examples-0.3.11/configure new file mode 100755 index 0000000..69c1eb5 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/configure @@ -0,0 +1,6941 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="configure.in" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +HAVE_NCURSES_TRUE +HAVE_NCURSES_FALSE +CPP +GREP +EGREP +PKG_CONFIG +libartnet_CFLAGS +libartnet_LIBS +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +PKG_CONFIG +libartnet_CFLAGS +libartnet_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + PKG_CONFIG path to pkg-config utility + libartnet_CFLAGS + C compiler flags for libartnet, overriding pkg-config + libartnet_LIBS + linker flags for libartnet, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +am__api_version='1.10' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=artnet-examples + VERSION=0.3.11 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +ac_config_headers="$ac_config_headers config.h" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lncurses': + +{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 +echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_ncurses_initscr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ncurses_initscr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ncurses_initscr=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6; } +if test $ac_cv_lib_ncurses_initscr = yes; then + have_ncurses="yes" +fi + + if test "${have_ncurses}" = "yes"; then + HAVE_NCURSES_TRUE= + HAVE_NCURSES_FALSE='#' +else + HAVE_NCURSES_TRUE='#' + HAVE_NCURSES_FALSE= +fi + + +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + +for ac_header in fcntl.h malloc.h stdlib.h string.h sys/ioctl.h sys/time.h sys/timeb.h termios.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +# check for libartnet + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for libartnet" >&5 +echo $ECHO_N "checking for libartnet... $ECHO_C" >&6; } + +if test -n "$libartnet_CFLAGS"; then + pkg_cv_libartnet_CFLAGS="$libartnet_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libartnet >= 1.0.6\"") >&5 + ($PKG_CONFIG --exists --print-errors "libartnet >= 1.0.6") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libartnet_CFLAGS=`$PKG_CONFIG --cflags "libartnet >= 1.0.6" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$libartnet_LIBS"; then + pkg_cv_libartnet_LIBS="$libartnet_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libartnet >= 1.0.6\"") >&5 + ($PKG_CONFIG --exists --print-errors "libartnet >= 1.0.6") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libartnet_LIBS=`$PKG_CONFIG --libs "libartnet >= 1.0.6" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + libartnet_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libartnet >= 1.0.6" 2>&1` + else + libartnet_PKG_ERRORS=`$PKG_CONFIG --print-errors "libartnet >= 1.0.6" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libartnet_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (libartnet >= 1.0.6) were not met: + +$libartnet_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libartnet_CFLAGS +and libartnet_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (libartnet >= 1.0.6) were not met: + +$libartnet_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libartnet_CFLAGS +and libartnet_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libartnet_CFLAGS +and libartnet_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libartnet_CFLAGS +and libartnet_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + libartnet_CFLAGS=$pkg_cv_libartnet_CFLAGS + libartnet_LIBS=$pkg_cv_libartnet_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + : +fi + +# Checks for typedefs, structures, and compiler characteristics. +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_struct_tm=sys/time.h +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + + +# Checks for library functions. +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_realloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_realloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define realloc rpl_realloc +_ACEOF + +fi + + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + + + + + + + +for ac_func in gettimeofday atexit ftime memset select strdup strerror +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +ac_config_files="$ac_config_files Makefile src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_NCURSES_TRUE}" && test -z "${HAVE_NCURSES_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +HAVE_NCURSES_TRUE!$HAVE_NCURSES_TRUE$ac_delim +HAVE_NCURSES_FALSE!$HAVE_NCURSES_FALSE$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +PKG_CONFIG!$PKG_CONFIG$ac_delim +libartnet_CFLAGS!$libartnet_CFLAGS$ac_delim +libartnet_LIBS!$libartnet_LIBS$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| . 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/configure.in b/open-lighting-architecture/artnet-examples-0.3.11/configure.in new file mode 100644 index 0000000..30292cb --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/configure.in @@ -0,0 +1,40 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(configure.in) +AC_CONFIG_AUX_DIR(config) +AM_INIT_AUTOMAKE(artnet-examples, 0.3.11) +AM_CONFIG_HEADER(config.h) + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lncurses': +AC_CHECK_LIB([ncurses], [initscr], [have_ncurses="yes"]) +AM_CONDITIONAL(HAVE_NCURSES, test "${have_ncurses}" = "yes") + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/ioctl.h sys/time.h sys/timeb.h termios.h unistd.h]) + + +# check for libartnet +PKG_CHECK_MODULES(libartnet, [libartnet >= 1.0.6]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_HEADER_TIME +AC_STRUCT_TM + +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_TYPE_SIGNAL +AC_CHECK_FUNCS([gettimeofday atexit ftime memset select strdup strerror]) + +AC_OUTPUT(Makefile src/Makefile) diff --git a/open-lighting-architecture/artnet-examples-0.3.11/depcomp b/open-lighting-architecture/artnet-examples-0.3.11/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/install-sh b/open-lighting-architecture/artnet-examples-0.3.11/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/missing b/open-lighting-architecture/artnet-examples-0.3.11/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.am b/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.am new file mode 100644 index 0000000..4b4a23e --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.am @@ -0,0 +1,31 @@ + +AM_CFLAGS = -Wall -Werror +AM_LDFLAGS = $(libartnet_LIBS) + +if HAVE_NCURSES +NCURSES_PROGS = artnet_dmxconsole artnet_dmxmonitor +artnet_dmxconsole_SOURCES = artnet-dmxconsole.c +artnet_dmxconsole_LDADD = @LIBS@ -lcurses + +artnet_dmxmonitor_SOURCES = artnet-dmxmonitor.c +artnet_dmxmonitor_LDADD = @LIBS@ -lcurses +endif + + +bin_PROGRAMS = artnet_usb artnet_discover artnet_flood_rx artnet_flood_tx artnet_firmware_node artnet_firmware_server artnet_multiport artnet_profile_tx artnet_profile_rx artnet_rdm_output artnet_setdmx $(NCURSES_PROGS) + +artnet_usb_SOURCES = artnet-usb.c +artnet_usb_LDADD = @LIBS@ -lpthread +artnet_discover_SOURCES = artnet-discover.c +artnet_flood_rx_SOURCES = artnet-flood-rx.c +artnet_flood_tx_SOURCES = artnet-flood-tx.c +artnet_profile_tx_SOURCES = artnet-profile-tx.c +artnet_profile_rx_SOURCES = artnet-profile-rx.c +artnet_firmware_node_SOURCES = artnet-firmware-node.c +artnet_firmware_server_SOURCES = artnet-firmware-server.c +artnet_multiport_SOURCES = artnet-multiport.c +artnet_rdm_output_SOURCES = artnet-rdm-output.c +artnet_setdmx_SOURCES = artnet-setdmx.c + +#artnet_test_master_SOURCES = artnet-test-master.c artnet-test-defaults.h +#artnet_test_slave_SOURCES = artnet-test-slave.c artnet-test-defaults.h artnet-test-defns.h artnet-test-defns.c diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.in b/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.in new file mode 100644 index 0000000..26d4b8b --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/Makefile.in @@ -0,0 +1,541 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = artnet_usb$(EXEEXT) artnet_discover$(EXEEXT) \ + artnet_flood_rx$(EXEEXT) artnet_flood_tx$(EXEEXT) \ + artnet_firmware_node$(EXEEXT) artnet_firmware_server$(EXEEXT) \ + artnet_multiport$(EXEEXT) artnet_profile_tx$(EXEEXT) \ + artnet_profile_rx$(EXEEXT) artnet_rdm_output$(EXEEXT) \ + artnet_setdmx$(EXEEXT) $(am__EXEEXT_1) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +@HAVE_NCURSES_TRUE@am__EXEEXT_1 = artnet_dmxconsole$(EXEEXT) \ +@HAVE_NCURSES_TRUE@ artnet_dmxmonitor$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_artnet_discover_OBJECTS = artnet-discover.$(OBJEXT) +artnet_discover_OBJECTS = $(am_artnet_discover_OBJECTS) +artnet_discover_LDADD = $(LDADD) +am__artnet_dmxconsole_SOURCES_DIST = artnet-dmxconsole.c +@HAVE_NCURSES_TRUE@am_artnet_dmxconsole_OBJECTS = \ +@HAVE_NCURSES_TRUE@ artnet-dmxconsole.$(OBJEXT) +artnet_dmxconsole_OBJECTS = $(am_artnet_dmxconsole_OBJECTS) +artnet_dmxconsole_DEPENDENCIES = +am__artnet_dmxmonitor_SOURCES_DIST = artnet-dmxmonitor.c +@HAVE_NCURSES_TRUE@am_artnet_dmxmonitor_OBJECTS = \ +@HAVE_NCURSES_TRUE@ artnet-dmxmonitor.$(OBJEXT) +artnet_dmxmonitor_OBJECTS = $(am_artnet_dmxmonitor_OBJECTS) +artnet_dmxmonitor_DEPENDENCIES = +am_artnet_firmware_node_OBJECTS = artnet-firmware-node.$(OBJEXT) +artnet_firmware_node_OBJECTS = $(am_artnet_firmware_node_OBJECTS) +artnet_firmware_node_LDADD = $(LDADD) +am_artnet_firmware_server_OBJECTS = artnet-firmware-server.$(OBJEXT) +artnet_firmware_server_OBJECTS = $(am_artnet_firmware_server_OBJECTS) +artnet_firmware_server_LDADD = $(LDADD) +am_artnet_flood_rx_OBJECTS = artnet-flood-rx.$(OBJEXT) +artnet_flood_rx_OBJECTS = $(am_artnet_flood_rx_OBJECTS) +artnet_flood_rx_LDADD = $(LDADD) +am_artnet_flood_tx_OBJECTS = artnet-flood-tx.$(OBJEXT) +artnet_flood_tx_OBJECTS = $(am_artnet_flood_tx_OBJECTS) +artnet_flood_tx_LDADD = $(LDADD) +am_artnet_multiport_OBJECTS = artnet-multiport.$(OBJEXT) +artnet_multiport_OBJECTS = $(am_artnet_multiport_OBJECTS) +artnet_multiport_LDADD = $(LDADD) +am_artnet_profile_rx_OBJECTS = artnet-profile-rx.$(OBJEXT) +artnet_profile_rx_OBJECTS = $(am_artnet_profile_rx_OBJECTS) +artnet_profile_rx_LDADD = $(LDADD) +am_artnet_profile_tx_OBJECTS = artnet-profile-tx.$(OBJEXT) +artnet_profile_tx_OBJECTS = $(am_artnet_profile_tx_OBJECTS) +artnet_profile_tx_LDADD = $(LDADD) +am_artnet_rdm_output_OBJECTS = artnet-rdm-output.$(OBJEXT) +artnet_rdm_output_OBJECTS = $(am_artnet_rdm_output_OBJECTS) +artnet_rdm_output_LDADD = $(LDADD) +am_artnet_setdmx_OBJECTS = artnet-setdmx.$(OBJEXT) +artnet_setdmx_OBJECTS = $(am_artnet_setdmx_OBJECTS) +artnet_setdmx_LDADD = $(LDADD) +am_artnet_usb_OBJECTS = artnet-usb.$(OBJEXT) +artnet_usb_OBJECTS = $(am_artnet_usb_OBJECTS) +artnet_usb_DEPENDENCIES = +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(artnet_discover_SOURCES) $(artnet_dmxconsole_SOURCES) \ + $(artnet_dmxmonitor_SOURCES) $(artnet_firmware_node_SOURCES) \ + $(artnet_firmware_server_SOURCES) $(artnet_flood_rx_SOURCES) \ + $(artnet_flood_tx_SOURCES) $(artnet_multiport_SOURCES) \ + $(artnet_profile_rx_SOURCES) $(artnet_profile_tx_SOURCES) \ + $(artnet_rdm_output_SOURCES) $(artnet_setdmx_SOURCES) \ + $(artnet_usb_SOURCES) +DIST_SOURCES = $(artnet_discover_SOURCES) \ + $(am__artnet_dmxconsole_SOURCES_DIST) \ + $(am__artnet_dmxmonitor_SOURCES_DIST) \ + $(artnet_firmware_node_SOURCES) \ + $(artnet_firmware_server_SOURCES) $(artnet_flood_rx_SOURCES) \ + $(artnet_flood_tx_SOURCES) $(artnet_multiport_SOURCES) \ + $(artnet_profile_rx_SOURCES) $(artnet_profile_tx_SOURCES) \ + $(artnet_rdm_output_SOURCES) $(artnet_setdmx_SOURCES) \ + $(artnet_usb_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libartnet_CFLAGS = @libartnet_CFLAGS@ +libartnet_LIBS = @libartnet_LIBS@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CFLAGS = -Wall -Werror +AM_LDFLAGS = $(libartnet_LIBS) +@HAVE_NCURSES_TRUE@NCURSES_PROGS = artnet_dmxconsole artnet_dmxmonitor +@HAVE_NCURSES_TRUE@artnet_dmxconsole_SOURCES = artnet-dmxconsole.c +@HAVE_NCURSES_TRUE@artnet_dmxconsole_LDADD = @LIBS@ -lcurses +@HAVE_NCURSES_TRUE@artnet_dmxmonitor_SOURCES = artnet-dmxmonitor.c +@HAVE_NCURSES_TRUE@artnet_dmxmonitor_LDADD = @LIBS@ -lcurses +artnet_usb_SOURCES = artnet-usb.c +artnet_usb_LDADD = @LIBS@ -lpthread +artnet_discover_SOURCES = artnet-discover.c +artnet_flood_rx_SOURCES = artnet-flood-rx.c +artnet_flood_tx_SOURCES = artnet-flood-tx.c +artnet_profile_tx_SOURCES = artnet-profile-tx.c +artnet_profile_rx_SOURCES = artnet-profile-rx.c +artnet_firmware_node_SOURCES = artnet-firmware-node.c +artnet_firmware_server_SOURCES = artnet-firmware-server.c +artnet_multiport_SOURCES = artnet-multiport.c +artnet_rdm_output_SOURCES = artnet-rdm-output.c +artnet_setdmx_SOURCES = artnet-setdmx.c +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +artnet_discover$(EXEEXT): $(artnet_discover_OBJECTS) $(artnet_discover_DEPENDENCIES) + @rm -f artnet_discover$(EXEEXT) + $(LINK) $(artnet_discover_OBJECTS) $(artnet_discover_LDADD) $(LIBS) +artnet_dmxconsole$(EXEEXT): $(artnet_dmxconsole_OBJECTS) $(artnet_dmxconsole_DEPENDENCIES) + @rm -f artnet_dmxconsole$(EXEEXT) + $(LINK) $(artnet_dmxconsole_OBJECTS) $(artnet_dmxconsole_LDADD) $(LIBS) +artnet_dmxmonitor$(EXEEXT): $(artnet_dmxmonitor_OBJECTS) $(artnet_dmxmonitor_DEPENDENCIES) + @rm -f artnet_dmxmonitor$(EXEEXT) + $(LINK) $(artnet_dmxmonitor_OBJECTS) $(artnet_dmxmonitor_LDADD) $(LIBS) +artnet_firmware_node$(EXEEXT): $(artnet_firmware_node_OBJECTS) $(artnet_firmware_node_DEPENDENCIES) + @rm -f artnet_firmware_node$(EXEEXT) + $(LINK) $(artnet_firmware_node_OBJECTS) $(artnet_firmware_node_LDADD) $(LIBS) +artnet_firmware_server$(EXEEXT): $(artnet_firmware_server_OBJECTS) $(artnet_firmware_server_DEPENDENCIES) + @rm -f artnet_firmware_server$(EXEEXT) + $(LINK) $(artnet_firmware_server_OBJECTS) $(artnet_firmware_server_LDADD) $(LIBS) +artnet_flood_rx$(EXEEXT): $(artnet_flood_rx_OBJECTS) $(artnet_flood_rx_DEPENDENCIES) + @rm -f artnet_flood_rx$(EXEEXT) + $(LINK) $(artnet_flood_rx_OBJECTS) $(artnet_flood_rx_LDADD) $(LIBS) +artnet_flood_tx$(EXEEXT): $(artnet_flood_tx_OBJECTS) $(artnet_flood_tx_DEPENDENCIES) + @rm -f artnet_flood_tx$(EXEEXT) + $(LINK) $(artnet_flood_tx_OBJECTS) $(artnet_flood_tx_LDADD) $(LIBS) +artnet_multiport$(EXEEXT): $(artnet_multiport_OBJECTS) $(artnet_multiport_DEPENDENCIES) + @rm -f artnet_multiport$(EXEEXT) + $(LINK) $(artnet_multiport_OBJECTS) $(artnet_multiport_LDADD) $(LIBS) +artnet_profile_rx$(EXEEXT): $(artnet_profile_rx_OBJECTS) $(artnet_profile_rx_DEPENDENCIES) + @rm -f artnet_profile_rx$(EXEEXT) + $(LINK) $(artnet_profile_rx_OBJECTS) $(artnet_profile_rx_LDADD) $(LIBS) +artnet_profile_tx$(EXEEXT): $(artnet_profile_tx_OBJECTS) $(artnet_profile_tx_DEPENDENCIES) + @rm -f artnet_profile_tx$(EXEEXT) + $(LINK) $(artnet_profile_tx_OBJECTS) $(artnet_profile_tx_LDADD) $(LIBS) +artnet_rdm_output$(EXEEXT): $(artnet_rdm_output_OBJECTS) $(artnet_rdm_output_DEPENDENCIES) + @rm -f artnet_rdm_output$(EXEEXT) + $(LINK) $(artnet_rdm_output_OBJECTS) $(artnet_rdm_output_LDADD) $(LIBS) +artnet_setdmx$(EXEEXT): $(artnet_setdmx_OBJECTS) $(artnet_setdmx_DEPENDENCIES) + @rm -f artnet_setdmx$(EXEEXT) + $(LINK) $(artnet_setdmx_OBJECTS) $(artnet_setdmx_LDADD) $(LIBS) +artnet_usb$(EXEEXT): $(artnet_usb_OBJECTS) $(artnet_usb_DEPENDENCIES) + @rm -f artnet_usb$(EXEEXT) + $(LINK) $(artnet_usb_OBJECTS) $(artnet_usb_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-discover.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-dmxconsole.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-dmxmonitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-firmware-node.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-firmware-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-flood-rx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-flood-tx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-multiport.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-profile-rx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-profile-tx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-rdm-output.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-setdmx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet-usb.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + + +#artnet_test_master_SOURCES = artnet-test-master.c artnet-test-defaults.h +#artnet_test_slave_SOURCES = artnet-test-slave.c artnet-test-defaults.h artnet-test-defns.h artnet-test-defns.c +# 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/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-discover.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-discover.c new file mode 100644 index 0000000..1b026c7 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-discover.c @@ -0,0 +1,144 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include + +int verbose = 0; +int nodes_found = 0; + + +void print_node_config(artnet_node_entry ne) { + printf("--------- %d.%d.%d.%d -------------\n", ne->ip[0], ne->ip[1], ne->ip[2], ne->ip[3]); + printf("Short Name: %s\n", ne->shortname); + printf("Long Name: %s\n", ne->longname); + printf("Node Report: %s\n", ne->nodereport); + printf("Subnet: 0x%hhx\n", ne->sub); + printf("Numb Ports: %d\n", ne->numbports); + printf("Input Addrs: 0x%hhx, 0x%hhx, 0x%hhx, 0x%hhx\n", ne->swin[0], ne->swin[1], ne->swin[2], ne->swin[3] ); + printf("Output Addrs: 0x%hhx, 0x%hhx, 0x%hhx, 0x%hhx\n", ne->swout[0], ne->swout[1], ne->swout[2], ne->swout[3] ); + printf("----------------------------------\n"); +} + +int reply_handler(artnet_node n, void *pp, void *d) { + artnet_node_list nl = artnet_get_nl(n); + + if (nodes_found == artnet_nl_get_length(nl)) { + // this is not a new node, just a previously discovered one sending + // another reply + return 0; + } else if(nodes_found == 0) { + // first node found + nodes_found++; + print_node_config( artnet_nl_first(nl)); + } else { + // new node + nodes_found++; + print_node_config( artnet_nl_next(nl)); + } + + return 0; +} + +int main(int argc, char *argv[]) { + artnet_node node; + char *ip_addr = NULL; + int optc, sd, maxsd, timeout = 2; + fd_set rset; + struct timeval tv; + time_t start; + + // parse options + while ((optc = getopt (argc, argv, "va:t:")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg); + break; + case 't': + timeout = atoi(optarg); + break; + case 'v': + verbose = 1; + break; + default: + break; + } + } + + if ((node = artnet_new(ip_addr, verbose)) == NULL) { + printf("new failed %s\n" , artnet_strerror()); + goto error; + } + + artnet_set_short_name(node, "artnet-discovery"); + artnet_set_long_name(node, "ArtNet Discovery Node"); + artnet_set_node_type(node, ARTNET_SRV); + + // set poll reply handler + artnet_set_handler(node, ARTNET_REPLY_HANDLER, reply_handler, NULL); + + if( artnet_start(node) != ARTNET_EOK) { + printf("Failed to start: %s\n", artnet_strerror()); + goto error_destroy; + } + + sd = artnet_get_sd(node); + + if (artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT) != ARTNET_EOK) { + printf("send poll failed\n"); + exit(1); + } + + start = time(NULL); + // wait for timeout seconds before quitting + while (time(NULL) - start < timeout) { + FD_ZERO(&rset); + FD_SET(sd, &rset); + + tv.tv_usec = 0; + tv.tv_sec = 1; + maxsd = sd; + + switch (select(maxsd+1, &rset, NULL, NULL, &tv)) { + case 0: + // timeout + break; + case -1: + printf("select error\n"); + break; + default: + artnet_read(node,0); + break; + } + } + +error_destroy : + artnet_destroy(node); + +error: + free(ip_addr); + exit(1); +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxconsole.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxconsole.c new file mode 100644 index 0000000..ef42d76 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxconsole.c @@ -0,0 +1,913 @@ +/* + * Copyright (C) 2001 Dirk Jagdmann + * + * 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. +*/ + +/* + * Edited by Simon Newton (nomis52westnet.com.au) + * to use libartnet + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include +#include +#include +#include +#ifdef HAVE_MALLOC_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* color names used */ +enum { + CHANNEL = 1, + ZERO, + NORM, + FULL, + HEADLINE, + HEADEMPH, + HEADERROR, + + MAXCOLOR +}; + +/* display modes */ +enum { + DISP_MODE_DMX = 0, + DISP_MODE_HEX, + DISP_MODE_DEC, + DISP_MODE_MAX, +}; + +int MAXCHANNELS=512; +int MAXFKEY=12; + +int verbose = 0; + +typedef unsigned char dmx_t; + +static dmx_t *dmx; +static dmx_t *dmxsave; +static dmx_t *dmxundo; + +static int display_mode = DISP_MODE_DMX; +static int current_channel = 0; /* channel cursor is positioned on */ +static int first_channel = 0; /* channel in upper left corner */ +static int channels_per_line=80/4; +static int channels_per_screen=80/4*24/2; +static int undo_possible=0; +static int current_cue=0; /* select with F keys */ +static float fadetime=1.0f; +static int fading=0; /* percentage counter of fade process */ +static int palette_number=0; +static int palette[MAXCOLOR]; +static char *errorstr=NULL; +static int channels_offset=1; + +static artnet_node node; + +void DMXsleep(int usec) +{ + struct timeval tv; + tv.tv_sec = usec/1000000; + tv.tv_usec = usec%1000000; + if(select(1, NULL, NULL, NULL, &tv) < 0) + perror("could not select"); +} + +// returns the time in milliseconds +unsigned long timeGetTime() +{ +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; + gettimeofday(&tv, NULL); + return (unsigned long)tv.tv_sec*1000UL+ (unsigned long)tv.tv_usec/1000; + +#else +# ifdef HAVE_FTIME + struct timeb t; + ftime(&t); + return (unsigned long)t.time*1000UL+(unsigned long)t.millitm; +# else + +# endif +#endif +} + + + +/* set all DMX channels */ +void setall() +{ + artnet_send_dmx(node,0,MAXCHANNELS, dmx); +} + +/* set current DMX channel */ +void set() +{ + setall(); +} + + +/* display the channels numbers */ +void mask() +{ + int i=0,x,y,z=first_channel; + + erase(); + + /* clear headline */ + attrset(palette[HEADLINE]); + move(0,0); + for(x=0; x24) + { + time_t t=time(NULL); + struct tm *tt=localtime(&t); + char *s=asctime(tt); + s[strlen(s)-1]=0; /* strip newline at end of string */ + + attrset(palette[HEADLINE]); + mvprintw(0,1,"%s", s); + } + if(COLS>31) + { + attrset(palette[HEADLINE]); + printw(" cue:"); + attrset(palette[HEADEMPH]); + printw("%02i", current_cue+1); + } + if(COLS>44) + { + attrset(palette[HEADLINE]); + printw(" fadetime:"); + + attrset(palette[HEADEMPH]); + printw("%1.1f", fadetime); + } + if(COLS>55) + { + if(fading) + { + attrset(palette[HEADLINE]); + printw(" fading:"); + + attrset(palette[HEADEMPH]); + printw("%02i%%", (fading<100)?fading:99); + } + else + { + attrset(palette[HEADLINE]); + printw(" "); + } + } + + if(COLS>80) + if(errorstr) + { + attrset(palette[HEADERROR]); + printw("ERROR:%s", errorstr); + } + + /* values */ + for(y=2; yMAXFKEY || new_cue<0) + return; + + undo_possible=0; + + /* don't crossfade for small fadetimes */ + if(fadetime<0.1f) + { + savecue(); + current_cue=new_cue; + loadcue(); + setall(); + return; + } + + savecue(); + dmxold=&dmxsave[current_cue*MAXCHANNELS]; + dmxnew=&dmxsave[new_cue*MAXCHANNELS]; + + /* try to find the last channel value > 0, so we don't have to + crossfade large blocks of 0s */ + for(i=MAXCHANNELS-1; i>=0; max=i, i--) + if(dmxold[i]||dmxnew[i]) + break; + + { + const unsigned long tstart=timeGetTime(); + const unsigned long tend=tstart+(int)(fadetime*1000.0); + unsigned long t=tstart; + while(t<=tend) + { + /* calculate new cue */ + t=timeGetTime(); + { + const float p=(float)(t-tstart)/1000.0f/fadetime; + const float q=1.0f-p; + for(i=1; i 15) { + printf("Subnet address must be between 0 and 15\n"); + exit(1); + } + break; + case 'p': + port_addr = atoi(optarg); + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n"); + exit(1); + } + break; + case 'v': + verbose = 1; + break; + default: + break; + } + } + + /* check for file to load */ + if (optind < argc) { + f=argv[optind]; + load(f); + loadcue(); + setall(); + } + else { + f="default.chn"; + } + + /* set up artnet node */ + node = artnet_new(ip_addr, verbose);; + + if(node == NULL) { + printf ("Unable to set up artnet node: %s\n", artnet_strerror() ); + return 1; + } + + // set names and node type + artnet_set_short_name(node, "DMX Console "); + artnet_set_long_name(node, "ArtNet DMX Console for Linux"); + artnet_set_node_type(node, ARTNET_SRV); + + artnet_set_subnet_addr(node, subnet_addr); + + // enable the first input port (1 universe only) + artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX); + artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, port_addr); + artnet_set_bcast_limit(node, bcast_limit); + + //start the node + artnet_start(node); + + // store the sds + an_sd = artnet_get_sd(node); + + /* init curses */ + w = initscr(); + if (!w) + { + printf ("unable to open main-screen\n"); + return 1; + } + + savetty(); + start_color(); + noecho(); + raw(); + keypad(w, TRUE); + + calcscreengeometry(); + changepalette(palette_number); + + /* main loop */ + c=0; + while (c!='q') + { + int n; + fd_set rd_fds; + struct timeval tv; + + FD_ZERO(&rd_fds); + FD_SET(0, &rd_fds); + FD_SET(an_sd, &rd_fds); + + tv.tv_sec = 1; + tv.tv_usec = 0; + + n = select(an_sd+1, &rd_fds, NULL, NULL, &tv); + if(n>0) + { + if(FD_ISSET(0, &rd_fds)) + { + c=wgetch(w); + switch (c) + { + case KEY_PPAGE: + undoprep(); + if(dmx[current_channel] < 255-0x10) + dmx[current_channel]+=0x10; + else + dmx[current_channel]=255; + set(); + break; + + case '+': + if(dmx[current_channel] < 255) + { + undoprep(); + dmx[current_channel]++; + } + set(); + break; + + case KEY_NPAGE: + undoprep(); + if(dmx[current_channel]==255) + dmx[current_channel]=0xe0; + else if(dmx[current_channel] > 0x10) + dmx[current_channel]-=0x10; + else + dmx[current_channel]=0; + set(); + break; + + case '-': + if(dmx[current_channel] > 0) + { + undoprep(); + dmx[current_channel]--; + } + set(); + break; + + case ' ': + undoprep(); + if(dmx[current_channel]<128) + dmx[current_channel]=255; + else + dmx[current_channel]=0; + set(); + break; + + case '0' ... '9': + fadetime=c-'0'; + break; + + case KEY_HOME: + current_channel=0; + first_channel=0; + mask(); + break; + + case KEY_RIGHT: + if(current_channel < MAXCHANNELS-1) + { + current_channel++; + if(current_channel >= first_channel+channels_per_screen) + { + first_channel+=channels_per_line; + mask(); + } + } + break; + + case KEY_LEFT: + if(current_channel > 0) + { + current_channel--; + if(current_channel < first_channel) + { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + } + break; + + case KEY_DOWN: + current_channel+=channels_per_line; + if(current_channel>=MAXCHANNELS) + current_channel=MAXCHANNELS-1; + if(current_channel >= first_channel+channels_per_screen) + { + first_channel+=channels_per_line; + mask(); + } + break; + + case KEY_UP: + current_channel-=channels_per_line; + if(current_channel<0) + current_channel=0; + if(current_channel < first_channel) + { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + break; + + case KEY_IC: + undoprep(); + for(n=MAXCHANNELS-1; n>current_channel && n>0; n--) + dmx[n]=dmx[n-1]; + setall(); + break; + + case KEY_DC: + undoprep(); + for(n=current_channel; n=DISP_MODE_MAX) + display_mode=0; + mask(); + break; + + case 'N': + case 'n': + if(++channels_offset>1) + channels_offset=0; + mask(); + break; + + case 'P': + case 'p': + changepalette(++palette_number); + break; + + case 'S': + case 's': + savecue(); + save(f); + break; + + case 'U': + case 'u': + undo(); + break; + + default: + if(c>=KEY_F(1) && c<=KEY_F(MAXFKEY)) + crossfade(c-KEY_F(1)); + break; + + } + } + + if (FD_ISSET(an_sd, &rd_fds)) + artnet_read(node,0); + + + values(); + refresh(); + } + } + + return 0; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxmonitor.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxmonitor.c new file mode 100644 index 0000000..4757cc1 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-dmxmonitor.c @@ -0,0 +1,529 @@ +/* + * Copyright (C) 2001 Dirk Jagdmann + * + * 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. +*/ + +/* + * Modified by Simon Newton (nomis52westnet.com.au) + * to use artnet + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include +#include +#include +#include +#ifdef HAVE_MALLOC_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/* color names used */ +enum { + CHANNEL = 1, + ZERO, + NORM, + FULL, + HEADLINE, + HEADEMPH, + HEADERROR, + + MAXCOLOR +}; + +/* display modes */ +enum { + DISP_MODE_DMX = 0, + DISP_MODE_HEX, + DISP_MODE_DEC, + DISP_MODE_MAX, +}; + +int MAXCHANNELS=512; + +typedef unsigned char dmx_t ; + +static dmx_t *dmx; + +static int display_mode = DISP_MODE_DMX; +static int current_channel = 0; /* channel cursor is positioned on */ +static int first_channel = 0; /* channel in upper left corner */ +static int channels_per_line=80/4; +static int channels_per_screen=80/4*24/2; +static int palette_number=0; +static int palette[MAXCOLOR]; +static char *errorstr=NULL; +static int channels_offset=1; + +WINDOW *w=NULL; +static artnet_node node ; + + +/* display the channels numbers */ +void mask() { + int i=0,x,y,z=first_channel; + + erase(); + + /* clear headline */ + attrset(palette[HEADLINE]); + move(0,0); + for(x=0; x24) + { + time_t t=time(NULL); + struct tm *tt=localtime(&t); + char *s=asctime(tt); + s[strlen(s)-1]=0; /* strip newline at end of string */ + + attrset(palette[HEADLINE]); + mvprintw(0,1,"%s", s); + } + + /* values */ + for(y=2; y 15) { + printf("Subnet address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + case 'p': + port_addr = atoi(optarg) ; + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + + default: + break; + } + } + + /* set up artnet connection */ + node = artnet_new(ip_addr, 0 ) ; ; + + if(node == NULL) { + printf("Unable to connect\n") ; + return 1 ; + } + + if(artnet_set_dmx_handler(node, dmx_handler, NULL) ) { + printf("Failed to install handler\n") ; + return 1 ; + } + + artnet_set_subnet_addr(node, subnet_addr) ; + + artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ; + artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr); + + artnet_start(node) ; + + // store the sds + artnet_sd = artnet_get_sd(node) ; + + /* init curses */ + w = initscr(); + if (!w) { + printf ("unable to open main-screen\n"); + return 1; + } + + savetty(); + start_color(); + noecho(); + raw(); + keypad(w, TRUE); + + calcscreengeometry(); + changepalette(palette_number); + + /* main loop */ + c=0; + while (c!='q') { + int n, max; + fd_set rd_fds; + struct timeval tv; + + FD_ZERO(&rd_fds); + FD_SET(0, &rd_fds); + FD_SET(artnet_sd, &rd_fds) ; + + max = artnet_sd ; + + tv.tv_sec = 1; + tv.tv_usec = 0; + + n = select(max+1, &rd_fds, NULL, NULL, &tv); + if(n>0) { + if(FD_ISSET(0, &rd_fds)) { + c=wgetch(w); + switch (c) { + case KEY_HOME: + current_channel=0; + first_channel=0; + mask(); + break; + case KEY_RIGHT: + if(current_channel < MAXCHANNELS-1) { + current_channel++; + if(current_channel >= first_channel+channels_per_screen) { + first_channel+=channels_per_line; + mask(); + } + } + break; + case KEY_LEFT: + if(current_channel > 0) { + current_channel--; + if(current_channel < first_channel) { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + } + break; + + case KEY_DOWN: + current_channel+=channels_per_line; + if(current_channel>=MAXCHANNELS) + current_channel=MAXCHANNELS-1; + if(current_channel >= first_channel+channels_per_screen) + { + first_channel+=channels_per_line; + mask(); + } + break; + + case KEY_UP: + current_channel-=channels_per_line; + if(current_channel<0) + current_channel=0; + if(current_channel < first_channel) + { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + break; + + case KEY_IC: + for(n=MAXCHANNELS-1; n>current_channel && n>0; n--) + dmx[n]=dmx[n-1]; + break; + + case KEY_DC: + for(n=current_channel; n=DISP_MODE_MAX) + display_mode=0; + mask(); + break; + + case 'N': + case 'n': + if(++channels_offset>1) + channels_offset=0; + mask(); + break; + + case 'P': + case 'p': + changepalette(++palette_number); + break; + + default: + break; + + } + } + + if (FD_ISSET(artnet_sd , &rd_fds) ) + artnet_read(node,0); + } + + values(); + refresh(); + } + + return 0; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-node.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-node.c new file mode 100644 index 0000000..5ffc84a --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-node.c @@ -0,0 +1,95 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include + +int verbose = 0 ; +int nodes_found = 0; + + +int firmware_handler(artnet_node n, int ubea, uint16_t *data, int length, void *d) { + + FILE *file=fopen("test", "wb"); + printf("in firmware hanlder got %d words\n", length) ; + if(file==NULL) + printf("could not open savefile\n"); + else { + if(fwrite(data, sizeof(uint16_t), length, file) != length) + printf("could not write complete savefile\n"); + if(fclose(file) < 0) + printf("could not close savefile"); + } + + return 0; +} + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc, timeout = 2; + time_t start ; + + // parse options + while ((optc = getopt (argc, argv, "va:t:")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 't': + timeout = atoi(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; ; + + + artnet_set_short_name(node, "artnet-firmware") ; + artnet_set_long_name(node, "ArtNet Firmware Test Node") ; + artnet_set_node_type(node, ARTNET_NODE) ; + + // set poll reply handler + artnet_set_firmware_handler(node, firmware_handler, NULL) ; + + artnet_start(node) ; + + start = time(NULL) ; + + // wait for timeout seconds before quitting + // got an issue here if the upload starts towards the end of the time + // we'll exit while the upload is in progress + while(time(NULL) - start < timeout) { + artnet_read(node,1) ; + } + + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-server.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-server.c new file mode 100644 index 0000000..62b3fc8 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-firmware-server.c @@ -0,0 +1,314 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define START_SIZE 1048576 +#define GROW_SIZE 1048576 +#define LINE 80 + +//#define START_SIZE 1024 +//#define GROW_SIZE 1024 + +typedef struct { + char *ip_addr; + char *firmware; + int timeout; + int verbose; + int ubea; + int size; + uint16_t *buffer; + int uploading; +} options_t; + +void *Malloc(int len) { + void *ptr = malloc(len); + + if(ptr == NULL) { + fprintf(stderr,"malloc failed\n"); + exit(1); + } + return ptr; +} + +void *Realloc(void *ptr, int len) { + ptr = realloc(ptr, len); + + if(ptr == NULL) { + fprintf(stderr,"realloc failed\n"); + exit(1); + } + return ptr; +} + +/* + * Parse command lines opts + */ +void parse_options(int argc, char *argv[], options_t *options ) { + int optc; + + options->ip_addr = NULL; + options->firmware = NULL; + options->timeout = 2; + options->verbose = 0; + options->ubea = 0; + options->uploading = 0; + + // parse options + while ((optc = getopt (argc, argv, "uva:t:f:")) != EOF) { + switch (optc) { + case 'a': + options->ip_addr = (char *) strdup(optarg); + break; + case 'f': + options->firmware = (char *) strdup(optarg); + break; + case 't': + options->timeout = atoi(optarg); + break; + case 'v': + options->verbose = 1; + break; + case 'u': + options->ubea = 1; + break; + default: + break; + } + } +} + +/* + * Print the node list + */ +void print_node_list(artnet_node n) { + artnet_node_list nl = artnet_get_nl(n); + artnet_node_entry ent = artnet_nl_first(nl); + int i = 1; + + printf("------------------------------\n"); + for( ent = artnet_nl_first(nl); ent != NULL; ent = artnet_nl_next(nl)) { + printf("%i : %s\n", i++, ent->shortname); + } + printf("------------------------------\n"); + + printf("Select a number, r to re-scan or q to quit\n"); +} + +/* + * Reads the firmware file into memory and returns a point + * this must be freed once you're done + */ +void read_firmware(char *firmware, options_t *options ) { + int fd, len, size; + uint16_t *buf; + char *buf2; + + struct stat f_stat; + + // check if filename is specified + // should fix this up + if(firmware == NULL) { + printf("Use -f to specify firmware file\n"); + exit(1); + } + + // open file + fd = open(firmware, O_RDONLY); + + if ( fstat(fd, &f_stat) ) { + printf("Firmware file %s does not exist\n", firmware); + exit(1); + } + + if( ! fd) { + printf("Could not open firmware file %s\n", firmware); + exit(1); + } + + len = START_SIZE; + + // read file + for (;;) { + buf = Malloc(len); + size = read(fd, (void*) buf, len); + + if( size < len) { + break; + } else { + len += GROW_SIZE; + free(buf); + lseek(fd,0,SEEK_SET); + } + } + + options->buffer = buf; + options->size = size; + + buf2 = (char *) buf; + + if(buf2[size-1] == '\n') { + printf("got char\n"); + } +} + +/* + * Scan for nodes on the network + * + */ +void scan_for_nodes(artnet_node n) { + #define WAIT_TIME 2 + time_t start; + + start = time(NULL); + + printf("Searching for nodes... (wait %i seconds)\n", WAIT_TIME); + // wait for WAIT_TIME seconds before quitting + while(time(NULL) - start < WAIT_TIME) { + artnet_read(n,1); + } + + print_node_list(n); + +} + +/* + * This is called when a upload completes + */ +int firmware_complete_callback( artnet_node n, artnet_firmware_status_code code, void *data) { + options_t *options = (options_t*) data; + + printf("Upload Complete\n"); + options->uploading = 0; + return 0; +} + +/* + * Read + */ +int server_handle_input(artnet_node n, options_t *options) { + char line[LINE]; + artnet_node_entry ent; + artnet_node_list nl = artnet_get_nl(n); + int i = 0; + int index; + + if (fgets(line, LINE, stdin) == NULL) { + printf("Unable to read from stdin\n"); + return 0; + } + index = atoi(line); + + if(0 == strcmp( line ,"q\n") ) { + return 1; + } else if ( 0 == strcmp(line, "r\n") ) { + scan_for_nodes( n); + } else if ( index > 0 && index <= artnet_nl_get_length(artnet_get_nl(n)) ) { + // do upload + printf("Starting upload...\n"); + + for(ent = artnet_nl_first(nl); ent != NULL; ent = artnet_nl_next(nl) ) { + if(++i == index) + break; + } + + if(ent != NULL) + artnet_send_firmware(n, ent, options->ubea, options->buffer, options->size / sizeof(uint16_t), firmware_complete_callback, (void *) options); + + } else { + printf("Invalid Command\n"); + } + + return 0; +} + +/* + * + * + */ +void wait_for_input(artnet_node n, options_t *options) { + int sd, maxsd; + fd_set rset; + struct timeval tv; + + sd = artnet_get_sd(n); + maxsd = sd; + + while(1) { + FD_ZERO(&rset); + FD_SET(STDIN_FILENO, &rset); + FD_SET(sd, &rset); + + tv.tv_usec = 0; + tv.tv_sec = 1; + + switch (select( maxsd, &rset, NULL, NULL, &tv ) ) { + case 0: + // timeout + break; + case -1: + printf("select error\n"); + break; + default: + if(FD_ISSET(STDIN_FILENO, &rset) && ! options->uploading) { + if ( server_handle_input(n,options) ) + return; + + } else { + artnet_read(n,0); + break; + } + + } + } +} + +int main(int argc, char *argv[]) { + artnet_node node; + options_t options; + + parse_options(argc, argv, &options); + + read_firmware(options.firmware, &options); + + node = artnet_new(options.ip_addr, options.verbose); ; + + artnet_set_short_name(node, "artnet-firmware"); + artnet_set_long_name(node, "ArtNet Firmware Test Server"); + artnet_set_node_type(node, ARTNET_SRV); + artnet_start(node); + artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT); + + scan_for_nodes(node); + + wait_for_input(node, &options); + + return 0; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-rx.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-rx.c new file mode 100644 index 0000000..10c65f1 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-rx.c @@ -0,0 +1,127 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include + +int length ; +int verbose = 0; + +int dmx_callback(artnet_node n, void *p, void *d) { + static time_t last = 0 ; + static int counter = 0 ; + time_t now ; + static int last_seq = 0; + + artnet_packet pack = (artnet_packet) p ; + +// printf("seq %d\n", pack->data.admx.sequence ) ; + + // first time + if(last ==0) { + time(&last) ; + last_seq = pack->data.admx.sequence ; + } + + time(&now) ; + + if(pack->data.admx.sequence - last_seq > 1) { + printf("lost %d packets %d %d \n", pack->data.admx.sequence - last_seq, pack->data.admx.sequence , last_seq ) ; + } + + if(last == now) + counter++ ; + else { + printf("Got %d packets last second\n", counter) ; + counter = 0; + last = now ; + } + last_seq = pack->data.admx.sequence ; + + + return 0; +} + + + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc, subnet_addr = 0, port_addr = 0 ; + + // parse options + while ((optc = getopt (argc, argv, "s:p:d:a:v")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + case 's': + subnet_addr = atoi(optarg) ; + + if(subnet_addr < 0 && subnet_addr > 15) { + printf("Subnet address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + case 'p': + port_addr = atoi(optarg) ; + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; + + artnet_set_short_name(node, "Artnet -> DMX ") ; + artnet_set_long_name(node, "ArtNet Flood RX") ; + artnet_set_node_type(node, ARTNET_NODE) ; + + artnet_set_handler(node, ARTNET_DMX_HANDLER, dmx_callback, NULL) ; + + // set the first port to output dmx data + artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ; + artnet_set_subnet_addr(node, subnet_addr) ; + + // set the universe address of the first port + artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr) ; + artnet_start(node) ; + + while(1) { + artnet_read(node, 1) ; + } + + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-tx.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-tx.c new file mode 100644 index 0000000..356f77f --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-flood-tx.c @@ -0,0 +1,147 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include + +int verbose = 0; +int use_select = 0 ; + +int delay = 25000; + + +#include + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc, subnet_addr = 0, port_addr = 0 ; + uint8_t data[ARTNET_DMX_LENGTH] ; + struct timeval tv; + int sd, maxsd ; + fd_set rset; + struct timespec ts; + + // parse options + while ((optc = getopt (argc, argv, "s:p:d:a:ve")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + case 'e': + use_select = 1 ; + break; + case 's': + subnet_addr = atoi(optarg) ; + + if(subnet_addr < 0 && subnet_addr > 15) { + printf("Subnet address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + case 'd': + delay = atoi(optarg) ; + break ; + case 'p': + port_addr = atoi(optarg) ; + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; ; + + artnet_set_short_name(node, "Artnet -> DMX ") ; + artnet_set_long_name(node, "ArtNet Flood RX") ; + artnet_set_node_type(node, ARTNET_NODE) ; + + // set the first port to input dmx data + artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ; + artnet_set_subnet_addr(node, subnet_addr) ; + + // set the universe address of the first port + artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, port_addr) ; + artnet_start(node) ; + + sd = artnet_get_sd(node) ; + + if(use_select) { + while(1) { + FD_ZERO(&rset) ; + FD_SET(sd, &rset) ; + + tv.tv_usec = delay ; + tv.tv_sec = 0 ; + + maxsd = sd ; + + switch ( select( maxsd+1, &rset, NULL, NULL, &tv ) ) { + case 0: + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + + break ; + case -1: + printf("select error\n") ; + break ; + default: + artnet_read(node,0) ; + break; + } + } + } else { + +// sched_setscheduler(0, ) + + while(1) { + ts.tv_nsec = delay ; + ts.tv_sec = 0 ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + + artnet_read(node,0) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + + nanosleep(&ts, NULL) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + artnet_send_dmx(node,0, ARTNET_DMX_LENGTH, data) ; + + } + } + + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-multiport.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-multiport.c new file mode 100644 index 0000000..2ddf75e --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-multiport.c @@ -0,0 +1,148 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include + + +int8_t buff[ARTNET_DMX_LENGTH +1]; +int length; +int verbose = 0; + + +int dmx_callback(artnet_node n, int port, void *d) { + uint8_t *data; + + data = artnet_read_dmx(n, port, &length); + memset(buff, 0x00, ARTNET_DMX_LENGTH+1); + memcpy(&buff[1], data, length); + + printf("got dmx on port %i\n", artnet_get_universe_addr(n, port, ARTNET_OUTPUT_PORT) ); + return 0; +} + + + +int main(int argc, char *argv[]) { + artnet_node node1, node2; + char *ip_addr = NULL; + int i, optc, subnet_addr = 0, port_addr = 0; + int sd, maxsd; + fd_set rset; + struct timeval tv; + + // parse options + while ((optc = getopt (argc, argv, "s:p:a:v")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg); + break; + case 'v': + verbose = 1; + break; + case 's': + subnet_addr = atoi(optarg); + + if(subnet_addr < 0 && subnet_addr > 15) { + printf("Subnet address must be between 0 and 15\n"); + exit(1); + } + break; + case 'p': + port_addr = atoi(optarg); + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n"); + exit(1); + } + break; + default: + break; + } + } + + node1 = artnet_new(ip_addr, verbose);; + node2 = artnet_new("192.168.0.100", verbose);; +// node2 = artnet_new("192.168.0.101", verbose);; + + artnet_join(node1, node2); + + artnet_set_short_name(node1, "Artnet -> DMX (1)"); + artnet_set_long_name(node1, "ArtNet to DMX convertor"); + artnet_set_node_type(node1, ARTNET_NODE); + artnet_set_dmx_handler(node1, dmx_callback, NULL); + + artnet_set_short_name(node2, "Artnet -> DMX (2)"); + artnet_set_long_name(node2, "ArtNet to DMX convertor"); + artnet_set_node_type(node2, ARTNET_NODE); + artnet_set_dmx_handler(node2, dmx_callback, NULL); + + // set the first port to output dmx data + for(i=0; i< 9; i++) { + if(i < 5) { + artnet_set_port_addr(node1, i%4, ARTNET_OUTPUT_PORT, i); + artnet_set_subnet_addr(node1, subnet_addr); + } else { + artnet_set_subnet_addr(node2, subnet_addr); + artnet_set_port_addr(node2, i%4, ARTNET_OUTPUT_PORT, i); + } + } + + // we need to share sd[1] to node2 here + artnet_start(node1); + artnet_start(node2); + + sd = artnet_get_sd(node1); + maxsd = sd; + + while(1) { + FD_ZERO(&rset); + FD_SET(sd, &rset); + + tv.tv_usec = 0; + tv.tv_sec = 1; + + switch (select( maxsd+1, &rset, NULL, NULL, &tv ) ) { + case 0: + // timeout + break; + case -1: + printf("select error\n"); + break; + default: + + // these are the same descriptors anyway + if(FD_ISSET(sd, &rset) ) { + artnet_read(node1, 0); + } else { + printf("random!!!\n"); + } + break; + } + + } + return 0; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-rx.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-rx.c new file mode 100644 index 0000000..f6c5447 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-rx.c @@ -0,0 +1,96 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include + + +int verbose = 0; + +int dmx_callback(artnet_node n, int port, void *d) { + + if(verbose) + printf("got data\n") ; + return 0; +} + + + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc, subnet_addr = 0, port_addr = 0 ; + + // parse options + while ((optc = getopt (argc, argv, "s:p:a:v")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + case 's': + subnet_addr = atoi(optarg) ; + + if(subnet_addr < 0 && subnet_addr > 15) { + printf("Subnet address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + case 'p': + port_addr = atoi(optarg) ; + + if(port_addr < 0 && port_addr > 15) { + printf("Port address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; ; + + artnet_set_short_name(node, "Artnet -> DMX ") ; + artnet_set_long_name(node, "ArtNet to DMX convertor") ; + artnet_set_node_type(node, ARTNET_NODE) ; + artnet_set_dmx_handler(node, dmx_callback, NULL) ; + + // set the first port to output dmx data + artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ; + artnet_set_subnet_addr(node, subnet_addr) ; + + // set the universe address of the first port + artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, port_addr) ; + artnet_start(node) ; + + while(1) { + artnet_read(node, 1) ; + } + + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-tx.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-tx.c new file mode 100644 index 0000000..f401763 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-profile-tx.c @@ -0,0 +1,122 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include + +int verbose = 0; + +int delay = 25000; + + +#include + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc, subnet_addr = 0, port_numb= 0, i ; + uint8_t data[ARTNET_DMX_LENGTH] ; + struct timeval tv; + int sd, maxsd ; + fd_set rset; + + // parse options + while ((optc = getopt (argc, argv, "s:p:d:a:ve")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + case 's': + subnet_addr = atoi(optarg) ; + + if(subnet_addr < 0 && subnet_addr > 15) { + printf("Subnet address must be between 0 and 15\n") ; + exit(1) ; + } + break ; + case 'd': + delay = atoi(optarg) ; + break ; + case 'p': + port_numb = atoi(optarg) ; + + if(port_numb < 0 && port_numb > 255) { + printf("Port address must be between 0 and 255\n") ; + exit(1) ; + } + break ; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; ; + + artnet_set_short_name(node, "Artnet Tester") ; + artnet_set_long_name(node, "ArtNet Test TX") ; + artnet_set_node_type(node, ARTNET_RAW) ; + + // set the first port to input dmx data + artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX) ; + artnet_set_subnet_addr(node, subnet_addr) ; + + // set the universe address of the first port + artnet_start(node) ; + + artnet_send_poll(node, NULL, ARTNET_TTM_DEFAULT) ; + + sd = artnet_get_sd(node) ; + + while(1) { + FD_ZERO(&rset) ; + FD_SET(sd, &rset) ; + + tv.tv_usec = delay ; + tv.tv_sec = 0 ; + + maxsd = sd ; + + switch ( select( maxsd+1, &rset, NULL, NULL, &tv ) ) { + case 0: + for(i=0 ; i < port_numb; i++) { + // printf("sending dmx %i\n", i) ; + artnet_raw_send_dmx(node,i, ARTNET_DMX_LENGTH, data) ; + } + break ; + case -1: + printf("select error\n") ; + break ; + default: + artnet_read(node,0) ; + break; + } + } + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-rdm-output.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-rdm-output.c new file mode 100644 index 0000000..1c3c274 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-rdm-output.c @@ -0,0 +1,155 @@ +/* + * 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 Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#define UID_WIDTH 6 + +#define UID_COUNT 198 +int verbose = 0 ; + + +uint8_t *generate_rdm_tod(int count, int iteration) { + uint8_t *ptr = malloc(count * UID_WIDTH) ; + int i ; + + if(ptr == NULL) { + printf("malloc failed\n") ; + exit(1) ; + } + + memset(ptr, 0x00, UID_WIDTH * count ) ; + for(i = 0 ; i < count; i++) { + ptr[i * UID_WIDTH +5] = i ; + ptr[i * UID_WIDTH +4] = iteration ; + } + + return ptr; + +} + +/* + * this is hell dodgy, i can't find the rdm spec so I don't know much about the packet structure + * looking at AL's header files it looks like a RDM packet it 278 bytes. 512 bytes have been allocated + * + * In summary: it's up to you to decode the rdm packet and deal with it. + * + * TODO: helper library for rdm (grab the spec from ...?) + * + */ +int rdm_handler(artnet_node n, int address, uint8_t *rdm, int length, void *d) { + + printf("got rdm data for address %d, of length %d\n", address, length) ; + + return 0; +} + +int rdm_initiate(artnet_node n, int port, void *d) { + uint8_t *tod ; + int *count = (int*) d ; + uint8_t uid[UID_WIDTH] ; + + memset(uid, 0x00, UID_WIDTH) ; + + tod = generate_rdm_tod(UID_COUNT, *count) ; + artnet_add_rdm_devices(n, 0, tod, UID_COUNT) ; + free(tod) ; + + uid[5] = 0xFF ; + uid[4] = *count ; + artnet_add_rdm_device(n,0, uid) ; + + uid[5] = 0x03 ; + artnet_remove_rdm_device(n,0, uid) ; + + uid[5] = 0x06 ; + artnet_remove_rdm_device(n,0, uid) ; + + (*count)++ ; + + return 0; +} + +int main(int argc, char *argv[]) { + artnet_node node ; + char *ip_addr = NULL ; + int optc ; + uint8_t *tod ; + int tod_refreshes = 0 ; + + // parse options + while ((optc = getopt (argc, argv, "va:")) != EOF) { + switch (optc) { + case 'a': + ip_addr = (char *) strdup(optarg) ; + break; + case 'v': + verbose = 1 ; + break; + default: + break; + } + } + + node = artnet_new(ip_addr, verbose) ; ; + + artnet_set_short_name(node, "artnet-rdm") ; + artnet_set_long_name(node, "ArtNet RDM Test, Output Node") ; + artnet_set_node_type(node, ARTNET_NODE) ; + + // set the first port to output dmx data + artnet_set_port_type(node, 0, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ; + artnet_set_subnet_addr(node, 0x00) ; + + // set the universe address of the first port + artnet_set_port_addr(node, 0, ARTNET_OUTPUT_PORT, 0x00) ; + + // set poll reply handler +// artnet_set_handler(node, ARTNET_REPLY_HANDLER, reply_handler, NULL) + artnet_set_rdm_initiate_handler(node, rdm_initiate , &tod_refreshes ) ; + artnet_set_rdm_handler(node, rdm_handler, NULL ) ; + + + tod = generate_rdm_tod(UID_COUNT, tod_refreshes++) ; + artnet_add_rdm_devices(node, 0, tod, UID_COUNT) ; + + + artnet_start(node) ; + + artnet_send_tod_control(node, 0x10, ARTNET_TOD_FLUSH) ; + artnet_send_rdm(node, 0x00 , tod, UID_COUNT* UID_WIDTH) ; + free(tod) ; + // loop until control C + while(1) { + artnet_read(node, 1) ; + } + // never reached + artnet_destroy(node) ; + + return 0 ; +} diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-setdmx.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-setdmx.c new file mode 100644 index 0000000..6b74f88 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-setdmx.c @@ -0,0 +1,262 @@ +/* + * 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 Library 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. + * + * Copyright 2004-2006 Simon Newton + * nomis52@westnet.com.au + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char SHORT_NAME[] = "ArtNet Node"; +char LONG_NAME[] = "libartnet setdmx example"; + + +typedef struct { + int verbose; + int help; + char *ip_addr; + int port_addr; + int channel; + int value; + float fade_time; +} opts_t; + + +/* + * Set our default options, command line args will overide this + */ +void init_ops(opts_t *ops) { + ops->verbose = 0; + ops->help = 0; + ops->ip_addr = NULL; + ops->port_addr = 0; + ops->channel = 1; + ops->value = 0; + ops->fade_time = 0.0; +} + + +/* + * Parse command lines options and save in opts_s struct + * + */ +void parse_args(opts_t *ops, int argc, char *argv[]) { + + static struct option long_options[] = { + {"address", required_argument, 0, 'a'}, + {"port", required_argument, 0, 'p'}, + {"channel", required_argument, 0, 'c'}, + {"dmx", required_argument, 0, 'd'}, + {"fade", required_argument, 0, 'f'}, + {"help", no_argument, 0, 'h'}, + {"verbose", no_argument, 0, 'v'}, + + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + + c = getopt_long(argc, argv, "a:p:c:d:f:vh", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'a': + ops->ip_addr = (char *) strdup(optarg); + break; + case 'd': + ops->value = atoi(optarg); + break; + case 'c': + ops->channel = atoi(optarg); + break; + case 'p': + ops->port_addr = atoi(optarg); + break; + case 'f': + ops->fade_time = atof(optarg); + break; + case 'h': + ops->help = 1; + break; + case 'v': + ops->verbose = 1; + break; + + case '?': + break; + + default: +; + } + } +} + +/* + * + * + */ +void display_help_and_exit(opts_t *ops, char *argv[]) { + printf( +"Usage: %s --address --port --channel --dmx --fade \n" +"\n" +"Control lla port <-> universe mappings.\n" +"\n" +" -a, --address Address to send from.\n" +" -c, --channel Channel to set (starts from 0).\n" +" -d, --dmx Value to set the channel to.\n" +" -h, --help Display this help message and exit.\n" +" -f, --fade Total time of fade.\n" +" -p, --port Universe (port) address.\n" +" -v, --verbose Be verbose.\n" +"\n", + argv[0] ); + exit(0); +} + +void msleep(long time) { + struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = 1000000*time; + nanosleep(&ts, NULL); +} + +// returns the time in milliseconds +unsigned long timeGetTime() { + struct timeval tv; + gettimeofday(&tv, NULL); + return (unsigned long)tv.tv_sec*1000UL+ (unsigned long)tv.tv_usec/1000; +} + +/* + * + * + */ +int do_fade(artnet_node node, opts_t *ops) { + int chan = ops->channel; + float fadetime = ops->fade_time; + int val = ops->value; + uint8_t dmx[chan]; + float p; + + memset(dmx, 0x00, chan); + + chan--; + + artnet_send_dmx(node, 0, chan, dmx); + msleep(40); + + const unsigned long tstart=timeGetTime(); + const unsigned long tend=tstart+(int)(fadetime*1000.0); + unsigned long t=tstart; + + while (t<=tend) { + t=timeGetTime(); + + if (fadetime) + p = (float)(t-tstart)/1000.0f/fadetime; + else + p = 1.0; + + dmx[chan]=(int)(float)val*p; + + msleep(40); + // printf("%f %i %i %f %li\n", p, chan, dmx[chan] , fadetime, t-tstart); + + // we have to call raw_send here as it sends a sequence number of 0 + // otherwise each execution of artnet_setdmx starts the sequence from 0 + // which confuses some devices + if (artnet_raw_send_dmx(node, ops->port_addr , chan+1, dmx)) { + printf("failed to send: %s\n", artnet_strerror() ); + } + + t=timeGetTime(); // get current time, because the last time is too old (due to the sleep) + } + + return 0; +} + + + + +int main(int argc, char *argv[]) { + opts_t ops; + artnet_node node; + + // init and parse the args + init_ops(&ops); + parse_args(&ops, argc, argv); + + // do some checks + if (ops.help) + display_help_and_exit(&ops, argv); + + if (ops.channel < 1 || ops.channel > 512) + display_help_and_exit(&ops, argv); + + if (ops.value < 0 || ops.value > 255) + display_help_and_exit(&ops, argv); + + if (ops.port_addr < 0 || ops.port_addr > 4) + display_help_and_exit(&ops, argv); + + // create new artnet node, and set config values + node = artnet_new(ops.ip_addr, ops.verbose);; + + artnet_set_short_name(node, SHORT_NAME); + artnet_set_long_name(node, LONG_NAME); + artnet_set_node_type(node, ARTNET_RAW); + + artnet_set_port_type(node, 0, ARTNET_ENABLE_INPUT, ARTNET_PORT_DMX); + artnet_set_port_addr(node, 0, ARTNET_INPUT_PORT, ops.port_addr); + + if (artnet_start(node) != ARTNET_EOK) { + printf("Failed to start: %s\n", artnet_strerror() ); + goto error_destroy; + } + + printf("channel is %i\n", ops.channel); + do_fade(node, &ops); + + return 0; + +error_destroy : + artnet_destroy(node); + + free(ops.ip_addr); + exit(1); + +} + diff --git a/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-usb.c b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-usb.c new file mode 100644 index 0000000..a007b56 --- /dev/null +++ b/open-lighting-architecture/artnet-examples-0.3.11/src/artnet-usb.c @@ -0,0 +1,419 @@ +/* + * 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 Library 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. + * + * Copyright 2004-2005 Simon Newton + * nomis52@westnet.com.au + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_DEVICE "/dev/dmx0" +#define DEFAULT_DEVICE2 "/dev/dmx1" +#define DEFAULT_DEVICE3 "/dev/dmx2" +#define DEFAULT_DEVICE4 "/dev/dmx3" + +#define UNCONNECTED -1 +#define SHORT_NAME "NWAN" +#define LONG_NAME "Netgear Wireless Artnet Node" + + +typedef struct { + int verbose ; + char *dev[ARTNET_MAX_PORTS]; + char *ip_addr ; + int subnet_addr ; + int port_addr ; + int persist ; + int num_ports; + int fd[ARTNET_MAX_PORTS] ; + uint8_t dmx[ARTNET_MAX_PORTS][ARTNET_DMX_LENGTH +1] ; + char *short_name ; + char *long_name ; + char *config_file ; +} opts_t; + +typedef struct { + opts_t *ops ; + int port_id ; +} thread_args_t ; + + +pthread_mutex_t mem_mutex = PTHREAD_MUTEX_INITIALIZER ; + +int do_write(opts_t *ops, int pid, uint8_t *buf, int length) { + int res ; + + res = write(ops->fd[pid], buf, length); + + if (res < 0){ + /* if you unplug devices from the dongle + */ + if(ops->verbose) + perror("Error writing to device"); + + res = close(ops->fd[pid]) ; + if(res < 0) + perror("close ") ; + else + ops->fd[pid] = UNCONNECTED ; + + return -1 ; + } + + if(res > 0 && ops->verbose) + printf("p%d: 0x%02hhx, 0x%02hhx, 0x%02hhx, 0x%02hhx length %d\n", pid, buf[1], buf[2], buf[3], buf[4] , length) ; + + return 0; +} + + +void *thread_run(void *arg) { + thread_args_t *args = (thread_args_t*) arg ; + uint8_t buf[ARTNET_DMX_LENGTH+1] ; + int *pid = &args->port_id ; + +// int len ; + + args->ops->fd[*pid] = open(args->ops->dev[*pid],O_WRONLY) ; + + while(1) { + + if(args->ops->fd[*pid] == UNCONNECTED) { + sleep(1) ; + + args->ops->fd[*pid] = open(args->ops->dev[*pid],O_WRONLY) ; + + if(args->ops->fd[*pid] == -1 && args->ops->verbose) + printf("open %s: %s\n",args->ops->dev[*pid], strerror(errno) ) ; + + } else { + pthread_mutex_lock(&mem_mutex) ; + memcpy(buf, args->ops->dmx[*pid], ARTNET_DMX_LENGTH+1) ; + pthread_mutex_unlock(&mem_mutex) ; + + do_write(args->ops, *pid, buf, ARTNET_DMX_LENGTH+1) ; + // sleep(1) ; + } + } + +/* for(i = 513; i >=0; i--) { + if(buff[i] != buf[i]) + break ; + } + + if(i>0) { +*/ + return NULL ; + +} + +/* + * Called when we have dmx data pending + */ +int dmx_handler(artnet_node n, int port, void *d) { + uint8_t *data ; + opts_t *ops = (opts_t *) d ; + int len ; + + if(port < ops->num_ports) { + data = artnet_read_dmx(n, port, &len) ; + pthread_mutex_lock(&mem_mutex) ; + memcpy(&ops->dmx[port][1], data, len) ; + pthread_mutex_unlock(&mem_mutex) ; + } + return 0; +} + + + +/* + * saves the settings to the config file + */ +int save_config(opts_t *ops) { + FILE *fh ; + printf("in save config\n") ; + if ((fh = fopen(ops->config_file, "w")) == NULL ) { + perror("fopen") ; + return -1 ; + } + + fprintf(fh, "# artnet_usb config file\n") ; + fprintf(fh, "Shortname=%s\n", ops->short_name) ; + fprintf(fh, "Longname=%s\n", ops->long_name) ; + fprintf(fh, "Subnet=%i\n", ops->subnet_addr) ; + fprintf(fh, "Port=%i\n", ops->port_addr); + + fclose(fh) ; + + return 0 ; +} + +/* + * Load the settings from config file + */ +int load_config(opts_t *ops) { + #define BUF_SIZE 1024 + FILE *fh ; + char buf[1024], *c ; + char *key, *data ; + + if(ops->config_file == NULL) + return -1; + + if ((fh = fopen(ops->config_file, "r")) == NULL ) { + perror("fopen") ; + return -1 ; + } + + while ( fgets(buf, 1024, fh) != NULL) { + if(*buf == '#') + continue ; + + // strip \n + for(c = buf ; *c != '\n' ; c++) ; + *c = '\0' ; + + key = strtok(buf, "=") ; + data = strtok(NULL, "=") ; + + if(key == NULL || data == NULL) + continue ; + + if(strcmp(key, "Shortname") == 0) { + free(ops->short_name) ; + ops->short_name = strdup(data) ; + } else if(strcmp(key, "Longname") == 0) { + free(ops->long_name) ; + ops->long_name = strdup(data) ; + } else if(strcmp(key, "Subnet") == 0) { + ops->subnet_addr = atoi(data) ; + } else if(strcmp(key, "Port") == 0 ) { + ops->port_addr = atoi(data) ; + } + + } + + fclose(fh) ; + return 0 ; +} + +/* + * called when to node configuration changes, + * we need to save the configuration to a file + */ +int program_handler(artnet_node n, void *d) { + opts_t *ops = (opts_t*) d ; + artnet_node_config_t config ; + + artnet_get_config(n, &config) ; + + free(ops->short_name) ; + free(ops->long_name) ; + + ops->short_name = strdup(config.short_name) ; + ops->long_name = strdup(config.long_name) ; + ops->subnet_addr = config.subnet ; + ops->port_addr = config.out_ports[0] ; + + save_config(ops) ; + return 0 ; +} + + +/* + * Main function + * + */ +int run(opts_t *ops) { + artnet_node node ; + pthread_t tid[ARTNET_MAX_PORTS] ; + thread_args_t targ[ARTNET_MAX_PORTS] ; + int i ; + + load_config(ops) ; + + // create new artnet node, and set config values + node = artnet_new(ops->ip_addr, ops->verbose) ; ; + + artnet_set_short_name(node, ops->short_name) ; + artnet_set_long_name(node, ops->long_name) ; + artnet_set_node_type(node, ARTNET_NODE) ; + + artnet_set_subnet_addr(node, ops->subnet_addr) ; + + // we want to be notified when the node config changes + artnet_set_program_handler(node, program_handler, (void*) ops) ; + artnet_set_dmx_handler(node, dmx_handler, (void*) ops) ; + + for(i=0; i < ops->num_ports ; i++) { + // set the first port to output dmx data + artnet_set_port_type(node, i, ARTNET_ENABLE_OUTPUT, ARTNET_PORT_DMX) ; + + // set the universe address of the first port + artnet_set_port_addr(node, i, ARTNET_OUTPUT_PORT, ops->port_addr+i) ; + + targ[i].ops = ops ; + targ[i].port_id = i ; + + if( pthread_create(&tid[i], NULL, &thread_run, (void*) &targ[i]) ) { + printf("pthread failed\n") ; + } + } + + artnet_start(node) ; + + while(1) { + // set a 1 second timeout on the read + // this way we send a DMX frame every second + // even if we don't get any ArtNet packets + artnet_read(node, 1) ; + + } + + return 0 ; +} + + +/* + * Set our default options, command line args will overide this + */ +void init_ops(opts_t *ops) { + int i ; + + ops->verbose = 0; + + ops->ip_addr = NULL ; + ops->subnet_addr = 0 ; + ops->port_addr = 0 ; + ops->persist = 0; + ops->num_ports = 1; + + for(i=0; i < ARTNET_MAX_PORTS; i++) { + ops->fd[i] = UNCONNECTED ; + memset(ops->dmx[i], 0x00, ARTNET_DMX_LENGTH+1) ; + } + // dodgy but saves using vasprintf + ops->dev[0] = strdup(DEFAULT_DEVICE) ; + ops->dev[1] = strdup(DEFAULT_DEVICE2) ; + ops->dev[2] = strdup(DEFAULT_DEVICE3) ; + ops->dev[3] = strdup(DEFAULT_DEVICE4) ; + + ops->short_name = strdup(SHORT_NAME) ; + ops->long_name = strdup(LONG_NAME) ; + ops->config_file = NULL ; +} + +/* + * Parse command lines options and save in opts_s struct + * + */ +void parse_args(opts_t *ops, int argc, char *argv[]) { + // parse args + int optc, port_addr, subnet_addr, num_ports ; + + // parse options + while ((optc = getopt (argc, argv, "c:s:p:d:a:vn:z")) != EOF) { + switch (optc) { + case 'a': + free(ops->ip_addr) ; + ops->ip_addr = (char *) strdup(optarg) ; + break; + case 'c': + free(ops->config_file) ; + ops->config_file = (char *) strdup(optarg) ; + break; + case 'v': + ops->verbose = 1 ; + break; + case 'd': + free(ops->dev) ; + ops->dev[0] = (char *) strdup(optarg) ; + break; + case 's': + subnet_addr = atoi(optarg) ; + + if(subnet_addr < 0 && subnet_addr > 15) + printf("Subnet address must be between 0 and 15\n") ; + else + ops->subnet_addr = subnet_addr ; + break ; + case 'n': + num_ports = atoi(optarg) ; + + if(num_ports < 1 || num_ports > ARTNET_MAX_PORTS) { + printf("number of ports must be between 1 and %d\n", ARTNET_MAX_PORTS) ; + } else + ops->num_ports = num_ports ; + break ; + case 'p': + port_addr = atoi(optarg) ; + + if(port_addr < 0 && port_addr > 15) + printf("Port address must be between 0 and 15\n") ; + else + ops->port_addr = port_addr ; + break ; + case 'z': + ops->persist = 1 ; + default: + break; + } + } +} + + +int main(int argc, char *argv[]) { + int statloc, pid ; + opts_t ops ; + + init_ops(&ops) ; + parse_args(&ops, argc, argv) ; + + // we don't load ops here + // else if we restart and the options have been remote + // programed we'll have to old ones + + if(ops.persist) { + while(1) { + if( (pid = fork() ) == 0) { + // child ; + run(&ops) ; + exit(1) ; + } else { + // parent + pid = wait(&statloc) ; + printf("Child %i terminated, restarting\n", pid) ; + } + } + } else + run(&ops) ; + + return 0; +} + diff --git a/open-lighting-architecture/libartnet-1.1.0/AUTHORS b/open-lighting-architecture/libartnet-1.1.0/AUTHORS new file mode 100644 index 0000000..eded583 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/AUTHORS @@ -0,0 +1,10 @@ + +Author: + + Simon Newton + +Bug Reports & Patches: + + Samuli Valo + Justin Cormack + nico (Win32 port) diff --git a/open-lighting-architecture/libartnet-1.1.0/COPYING b/open-lighting-architecture/libartnet-1.1.0/COPYING new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/open-lighting-architecture/libartnet-1.1.0/ChangeLog b/open-lighting-architecture/libartnet-1.1.0/ChangeLog new file mode 100644 index 0000000..1bc3f30 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/ChangeLog @@ -0,0 +1,116 @@ +4/11/2007 Simon Newton < + * Removed artnet_init + * cleaned up code style + * removed #defines + * implemented Artnet II + +25/12/2006 Simon Newton < + + * minor code cleanup, removed a bunch of magic numbers + +24/12/2006 Simon Newton < + + * bug fix for OS X + +12/6/2006 Simon Newton < + + * applied patches to network.c from Justin Cormack to skip interfaces + without addresses + +12/6/2006 Simon Newton < + + * added functions to set the oem and esta codes + +9/5/2006 Simon Newton < + + * changed to using a single descriptor bound to *.6454 + +18/4/2006 Simon Newton < + + * Received ESTA Manufacturer ID + +17/4/2006 Simon Newton < + + * Fixed ArtPollReply length bug + +16/9/2005 Simon Newton < + + * Fixed compile issues on OS X + +28/8/2005 Simon Newton + + * Fixed error handling in net_start + +26/8/2005 Simon Newton + + * Fixed get_ifaces to return hw addrs correctly for aliased ifaces + +12/8/2005 Simon Newton + + * Changed to a new error reporting scheme + * Applied patch from Samuli Valo to fix get_ifaces on x86-64 + +7/05/2005 Simon Newton + + * fixed bug in number of ports reported + * included tod.h and misc.h :) + * fixed typo with IPV6 + * removed static path for pkgconfig data + +30/04/2005 Simon Newton + + * minor cleanup, now reports numb of ports correctly + +30/04/2005 Simon Newton + + * started adding RDM support + +25/04/2005 Simon Newton + + * fixed the inet_aton bug + +18/04/2005 Simon Newton + + * Added the endian conversion functions + +12/04/2005 Simon Newton + + * More OSX fixes + +9/04/2005 Simon Newton + + * Fixed the seg fault if no network interfaces are present + +18/3/2005 Simon Newton + + * added artnet_destroy + +17/3/2005 Simon Newton + + * added c++ linking support + +16/3/2005 Simon Newton + + * merged bugfixes from multicast branch to trunk + +27/2/2005 Simon Newton + + * split examples from the library + * depricated artnet_init + +23/2/2005 Simon Newton + + * added basic node joining support + +12/2/2005 Simon Newton + + * Fixed compiler warnings + * Fixed minor problems relating to a node's ip address + +11/2/2005 Simon Newton + + * Changed the licence to the LGPL + * Added new "debug" parameter to artnet_init() + * Fixed LTP bug (L = latest not lowest as I orginally thought) + * Added firmware receive support - new example program artnet_firmware_node + * Added firmware send support - new example program artnet_firmware_server diff --git a/open-lighting-architecture/libartnet-1.1.0/Doxyfile b/open-lighting-architecture/libartnet-1.1.0/Doxyfile new file mode 100644 index 0000000..6997b97 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/Doxyfile @@ -0,0 +1,1161 @@ +# Doxyfile 1.3.9.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "libartnet" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = "doc" + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of source +# files, where putting all generated files in the same directory would otherwise +# cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, +# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, +# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, +# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, +# Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# This tag can be used to specify the encoding used in the generated output. +# The encoding is not always determined by the language that is chosen, +# but also whether or not the output is meant for Windows or non-Windows users. +# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES +# forces the Windows encoding (this is the default for the Windows binary), +# whereas setting the tag to NO uses a Unix-style encoding (the default for +# all platforms other than Windows). + +USE_WINDOWS_ENCODING = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is used +# as the annotated text. Otherwise, the brief description is used as-is. If left +# blank, the following values are used ("$name" is automatically replaced with the +# name of the entity): "The $name class" "The $name widget" "The $name file" +# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. + +SHOW_DIRECTORIES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = "./artnet" + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superseded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes that +# lay further from the root node will be omitted. Note that setting this option to +# 1 or 2 may greatly reduce the computation time needed for large code bases. Also +# note that a graph may be further truncated if the graph's image dimensions are +# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). +# If 0 is used for the depth value (the default), the graph is not depth-constrained. + +MAX_DOT_GRAPH_DEPTH = 0 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/open-lighting-architecture/libartnet-1.1.0/INSTALL b/open-lighting-architecture/libartnet-1.1.0/INSTALL new file mode 100644 index 0000000..e5615f3 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/INSTALL @@ -0,0 +1,82 @@ + + +NOTE: By default everything will be installed with the prefix /usr/local . +If you want to build against these libraries you will need to add +"/usr/local/lib" to /etc/ld.so.conf and run ldconfig. Otherwise, run configure +with --prefix=/usr and the libraries will be installed to /usr/lib + + +Contents +======== + + A. Basic Installation + B. For Developers + C. Installation Paths + + +A. Basic Installation +================== + + 1. Extract the archive + + tar -zxf artnet-0.x.y.tar.gz + + 2. Enter the directory + + cd artnet-0.x.y.tar.gz + + 3. Run the configure script. 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. + + ./configure + + 4. Build the source files. + + make + + 5. Become root + + su + (enter root password) + + 6. Install the libraries + + make install + + 7. See the instructions at the top of this file. + + +B. For Developers +================= + + libartnet uses pkgconfig. libartnet.pc is installed in /usr/lib/pkgconfig +This is only important if you intend on writing applications that use libartnet. + + libartnet is documented using doxygen. Run doxygen from the extracted +directory to generate the latex and html documentation in the doc subdirectory + + +C. Installation Paths +===================== + + 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'. + diff --git a/open-lighting-architecture/libartnet-1.1.0/Makefile.am b/open-lighting-architecture/libartnet-1.1.0/Makefile.am new file mode 100644 index 0000000..eec47e1 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/Makefile.am @@ -0,0 +1,13 @@ + +auxdir = @ac_aux_dir@ +AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \ + $(auxdir)/mkinstalldirs + +SUBDIRS = artnet + +EXTRA_DIST = libartnet.pc.in Doxyfile + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libartnet.pc + +ACLOCAL = aclocal -I $(auxdir) diff --git a/open-lighting-architecture/libartnet-1.1.0/Makefile.in b/open-lighting-architecture/libartnet-1.1.0/Makefile.in new file mode 100644 index 0000000..1edfe43 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/Makefile.in @@ -0,0 +1,668 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libartnet.pc.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ + depcomp install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libartnet.pc +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = aclocal -I $(auxdir) +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +auxdir = @ac_aux_dir@ +AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \ + $(auxdir)/mkinstalldirs + +SUBDIRS = artnet +EXTRA_DIST = libartnet.pc.in Doxyfile +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libartnet.pc +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libartnet.pc: $(top_builddir)/config.status $(srcdir)/libartnet.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-pkgconfigDATA + +# 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/open-lighting-architecture/libartnet-1.1.0/NEWS b/open-lighting-architecture/libartnet-1.1.0/NEWS new file mode 100644 index 0000000..3a0c759 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/NEWS @@ -0,0 +1,116 @@ +21/07/2009 libartnet-1.1.0 + + Added win32 support + +13/12/2008 libartnet-1.0.7 + + Subnet programming fix + +03/11/2006 libartnet-1.0.6 + + ArtNet II support + +24/12/2006 libartnet-1.0.4 + + Fixed the compile time error for OS X + +12/6/2006 libartnet-1.0.3 + + Fixed the segfault caused by interfaces without addresses + +12/6/2006 libartnet-1.0.3 + + Added esta and oem functions + +17/4/2006 libartnet-1.0.2 + + Introduced compatability mode for devices like the Martin Ether2DMX which + send to 255.255.255.255 + +17/4/2006 libartnet-1.0.1 + + Fixed the ArtPollReply length bug + +30/3/2006 libartnet-1.0.0 + + Version 1.0 release + +16/9/2005 libartnet-0.1.14-rc4 + + Now compiles on OS X (again) + +28/8/2005 libartnet-0.1.14-rc3 + + Bug fixes to net_start + +23/8/2005 libartnet-0.1.14-rc2 + + Bug fixes to get_ifaces + +23/8/2005 libartnet-0.1.14-rc1 + + A new error reporting system is in use. Calls to most artnet functions + return a true value on error. The error string can be accessed with + artnet_strerror() + + Applied patch from Samuli Valo to use getifaddrs. (Should now work + on x86-64) (prob broken on OS X) + +7/04/2005 libartnet-0.1.13 + + Fixed the fact that 0.1.12 wouldn't compile :) + +3/04/2005 libartnet-0.1.12 + + Minor cleanups + The number of ports are now reported correctly + +3/04/2005 libartnet-0.1.11 + + Added basic RDM support, see the artnet_rdm_output (in the artnet-examples) + package for details. + + Issues: + * Not sure about the ArtTodData implementation, it doesn't work with + ArtNetView with more than 200 uids. + +25/04/2005 libartnet-0.1.10 + + Fixed the inet_aton bug + +18/04/2005 libartnet-0.1.9 + + Mac OS X basic support working (can send/receive dmx data) + +12/04/2005 libartnet-0.1.8 + + Mac OS X fixes merged in + +18/03/2005 libartnet-0.1.7 + + Added artnet_destroy function + +17/03/2005 libartnet-0.1.6 + + Added support for C++ linking (needed for Q Light) + +16/03/2005 libartnet-0.1.5 + + Merged bugfixes from multicast branch to trunk + +12/03/2005 libartnet-0.1.4 + + Split examples from library + Fixed header install path + Added node join support + Depricated artnet_init in favour of artnet_new + +12/2/2005 libartnet-0.1.3 + + Fixed compiler warnings + Fixed minor problems relating to a node's ip address + +11/02/2005 libartnet-0.1.2 + + Now includes support for Firmware send/receive. + diff --git a/open-lighting-architecture/libartnet-1.1.0/README b/open-lighting-architecture/libartnet-1.1.0/README new file mode 100644 index 0000000..c89e6b7 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/README @@ -0,0 +1,5 @@ + +Libartnet is an implementation of the ArtNet protocol. ArtNet allows the +transmission of DMX and related data over IP networks. + +For installation notes see the INSTALL file. diff --git a/open-lighting-architecture/libartnet-1.1.0/TODO b/open-lighting-architecture/libartnet-1.1.0/TODO new file mode 100644 index 0000000..f22afd7 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/TODO @@ -0,0 +1,6 @@ + + +to get reply working: + fix video.remote + fix stop / start procedure + diff --git a/open-lighting-architecture/libartnet-1.1.0/aclocal.m4 b/open-lighting-architecture/libartnet-1.1.0/aclocal.m4 new file mode 100644 index 0000000..851e2f2 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/aclocal.m4 @@ -0,0 +1,7251 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +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_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.am b/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.am new file mode 100644 index 0000000..29cd474 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.am @@ -0,0 +1,18 @@ + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) +AM_CFLAGS = -Wall -Werror -Wformat -W + +lib_LTLIBRARIES = libartnet.la +libartnet_la_SOURCES = artnet.c private.h misc.c network.c receive.c \ + transmit.c tod.c +libartnet_la_LDFLAGS = -version-info 1:0:0 + +if USING_WIN32 +libartnet_la_LDFLAGS += -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 \ + -ldpnet +endif + +EXTRA_DIST = tod.h misc.h + +pkginclude_HEADERS = artnet.h packets.h common.h +pkgincludedir = $(includedir)/artnet diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.in b/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.in new file mode 100644 index 0000000..64c7c2b --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/Makefile.in @@ -0,0 +1,504 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@USING_WIN32_TRUE@am__append_1 = -no-undefined -liphlpapi -lnetapi32 -lcap -lws2_32 \ +@USING_WIN32_TRUE@ -ldpnet + +subdir = artnet +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libartnet_la_LIBADD = +am_libartnet_la_OBJECTS = artnet.lo misc.lo network.lo receive.lo \ + transmit.lo tod.lo +libartnet_la_OBJECTS = $(am_libartnet_la_OBJECTS) +libartnet_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libartnet_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libartnet_la_SOURCES) +DIST_SOURCES = $(libartnet_la_SOURCES) +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/artnet +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_builddir) -I$(top_srcdir) +AM_CFLAGS = -Wall -Werror -Wformat -W +lib_LTLIBRARIES = libartnet.la +libartnet_la_SOURCES = artnet.c private.h misc.c network.c receive.c \ + transmit.c tod.c + +libartnet_la_LDFLAGS = -version-info 1:0:0 $(am__append_1) +EXTRA_DIST = tod.h misc.h +pkginclude_HEADERS = artnet.h packets.h common.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu artnet/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu artnet/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libartnet.la: $(libartnet_la_OBJECTS) $(libartnet_la_DEPENDENCIES) + $(libartnet_la_LINK) -rpath $(libdir) $(libartnet_la_OBJECTS) $(libartnet_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artnet.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/network.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/receive.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tod.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transmit.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.c b/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.c new file mode 100644 index 0000000..67e846d --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.c @@ -0,0 +1,1636 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * artnet.c + * Implementes the external functions for libartnet + * Copyright (C) 2004-2007 Simon Newton + */ +#include "private.h" + +// various constants used everywhere +int ARTNET_ADDRESS_NO_CHANGE = 0x7f; +int ARTNET_PORT = 6454; +int ARTNET_STRING_SIZE = 8; +char ARTNET_STRING[] = "Art-Net"; +uint8_t ARTNET_VERSION = 14; +uint8_t OEM_HI = 0x04; +uint8_t OEM_LO = 0x30; +char ESTA_HI = 'z'; +char ESTA_LO = 'p'; +uint8_t TTM_BEHAVIOUR_MASK = 0x02; +uint8_t TTM_REPLY_MASK = 0x01; +uint8_t PROGRAM_NO_CHANGE = 0x7f; +uint8_t PROGRAM_DEFAULTS = 0x00; +uint8_t PROGRAM_CHANGE_MASK = 0x80; +uint8_t HIGH_NIBBLE = 0xF0; +uint8_t LOW_NIBBLE = 0x0F; +uint8_t STATUS_PROG_AUTH_MASK = 0x30; +uint8_t PORT_STATUS_LPT_MODE = 0x02; +uint8_t PORT_STATUS_SHORT = 0x04; +uint8_t PORT_STATUS_ERROR = 0x04; +uint8_t PORT_STATUS_DISABLED_MASK = 0x08; +uint8_t PORT_STATUS_MERGE = 0x08; +uint8_t PORT_STATUS_DMX_TEXT = 0x10; +uint8_t PORT_STATUS_DMX_SIP = 0x20; +uint8_t PORT_STATUS_DMX_TEST = 0x40; +uint8_t PORT_STATUS_ACT_MASK = 0x80; +uint8_t PORT_DISABLE_MASK = 0x01; +uint8_t TOD_RESPONSE_FULL = 0x00; +uint8_t TOD_RESPONSE_NAK = 0x00; +uint8_t MIN_PACKET_SIZE = 10; +uint8_t MERGE_TIMEOUT_SECONDS = 10; +uint8_t FIRMWARE_TIMEOUT_SECONDS = 20; +uint8_t RECV_NO_DATA = 1; +uint8_t MAX_NODE_BCAST_LIMIT = 30; // always bcast after this point + +#ifndef TRUE +int TRUE = 1; +int FALSE = 0; +#endif + +uint16_t LOW_BYTE = 0x00FF; +uint16_t HIGH_BYTE = 0xFF00; + +void copy_apr_to_node_entry(artnet_node_entry e, artnet_reply_t *reply); +int find_nodes_from_uni(node_list_t *nl, uint8_t uni, SI *ips, int size); + +/* + * Creates a new ArtNet node. + * Takes a string containing the ip address to bind to, if the string is NULL + * it uses the first non loopback address + * + * @param ip the IP address to bind to + * @param debug level of logging provided 0: none + * @return an artnet_node, or NULL on failure + */ +artnet_node artnet_new(const char *ip, int verbose) { + node n; + int i; + + n = malloc(sizeof(artnet_node_t)); + + if (!n) { + artnet_error("malloc failure"); + return NULL; + } + + memset(n, 0x0, sizeof(artnet_node_t)); + + // init node listing + n->node_list.first = NULL; + n->node_list.current = NULL; + n->node_list.last = NULL; + n->node_list.length = 0; + n->state.verbose = verbose; + n->state.oem_hi = OEM_HI; + n->state.oem_lo = OEM_LO; + n->state.esta_hi = ESTA_HI; + n->state.esta_lo = ESTA_LO; + n->state.bcast_limit = 0; + + n->peering.peer = NULL; + n->peering.master = TRUE; + + n->sd = INVALID_SOCKET; + + if (artnet_net_init(n, ip)) { + free(n); + return NULL; + } + + // now setup the default parameters + n->state.send_apr_on_change = FALSE; + n->state.ar_count = 0; + n->state.report_code = ARTNET_RCPOWEROK; + n->state.reply_addr.s_addr = 0; + n->state.mode = ARTNET_STANDBY; + + // set all ports to MERGE HTP mode and disable + for (i=0; i < ARTNET_MAX_PORTS; i++) { + n->ports.out[i].merge_mode = ARTNET_MERGE_HTP; + n->ports.out[i].port_enabled = FALSE; + n->ports.in[i].port_enabled = FALSE; + + // reset tods + reset_tod(&n->ports.in[i].port_tod); + reset_tod(&n->ports.out[i].port_tod); + } + return n; +} + + +/* + * Starts the ArtNet node. + * Binds the network socket and sends an ArtPoll + * @param vn the artnet_node + * @return 0 on success, non 0 on failure + * + */ +int artnet_start(artnet_node vn) { + node n = (node) vn; + int ret; + check_nullnode(vn); + + if (n->state.mode != ARTNET_STANDBY) + return ARTNET_ESTATE; + + if ((ret = artnet_net_start(n))) + return ret; + + n->state.mode = ARTNET_ON; + + if (n->state.reply_addr.s_addr == 0) { + n->state.reply_addr = n->state.bcast_addr; + } + + // build the initial reply + if ((ret = artnet_tx_build_art_poll_reply(n))) + return ret; + + if (n->state.node_type == ARTNET_SRV) { + // poll the network + if ((ret = artnet_tx_poll(n,NULL, ARTNET_TTM_AUTO))) + return ret; + + if ((ret = artnet_tx_tod_request(n))) + return ret; + } else { + // send a reply on startup + if ((ret = artnet_tx_poll_reply(n, FALSE))) + return ret; + } + return ret; +} + + +/* + * Stops the ArtNet node. This closes the network sockets held by the node + * @param vn the artnet_node + * @return 0 on success, non-0 on failure + */ +int artnet_stop(artnet_node vn) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + artnet_net_close(n->sd); + n->state.mode = ARTNET_STANDBY; + return ARTNET_EOK; +} + + +/* + * Free the memory associated with this node + */ +int artnet_destroy(artnet_node vn) { + node n = (node) vn; + node_entry_private_t *ent, *tmp; + int i; + + check_nullnode(vn); + + // free any memory associated with firmware transfers + for (ent = n->node_list.first; ent != NULL; ent = tmp) { + if (ent->firmware.data != NULL) + free(ent->firmware.data); + tmp = ent->next; + free(ent); + } + + for (i =0; i < ARTNET_MAX_PORTS; i++) { + flush_tod(&n->ports.in[i].port_tod); + flush_tod(&n->ports.out[i].port_tod); + } + + free(vn); + return ARTNET_EOK; +} + + +/* + * Set the OEM code + * This can only be done in the standby state + */ +int artnet_setoem(artnet_node vn, uint8_t hi, uint8_t lo) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_STANDBY) + return ARTNET_ESTATE; + + n->state.oem_hi = hi; + n->state.oem_lo = lo; + return ARTNET_EOK; +} + + +/* + * Set the ESTA code + * This can only be done in the standby state + */ +int artnet_setesta(artnet_node vn, char hi, char lo) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_STANDBY) + return ARTNET_ESTATE; + + n->state.esta_hi = hi; + n->state.esta_lo = lo; + return ARTNET_EOK; +} + + +/* + * Set the number of nodes above which we start to bcast data + * @param vn the artnet_node + * @param limit 0 to always broadcast + */ +int artnet_set_bcast_limit(artnet_node vn, int limit) { + node n = (node) vn; + check_nullnode(vn); + + if (limit > MAX_NODE_BCAST_LIMIT) { + artnet_error("attempt to set bcast limit > %d", MAX_NODE_BCAST_LIMIT); + return ARTNET_EARG; + } + + n->state.bcast_limit = limit; + return ARTNET_EOK; +} + +/* + * Handle any received packets. + * This function is the workhorse of libartnet. You have a couple of options: + * - use artnet_get_sd() to retrieve the socket descriptors and select to + * detect network activity. Then call artnet_read(node,0) + * when activity is detected. + * - call artnet_read repeatedly from within a loop with an appropriate + * timeout + * + * @param vn the artnet_node + * @param timeout the number of seconds to block for if nothing is pending + * @return 0 on success, -1 on failure + */ +int artnet_read(artnet_node vn, int timeout) { + node n = (node) vn; + node tmp; + artnet_packet_t p; + int ret; + + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + while (1) { + memset(&p.data, 0x0, sizeof(p.data)); + + // check timeouts now, else this packet may update the timestamps + check_timeouts(n); + + if ((ret = artnet_net_recv(n, &p, timeout)) < 0) + return ret; + + // nothing to read + if (ret == RECV_NO_DATA) + break; + + // skip this packet (filtered) + if (p.length == 0) + continue; + + for (tmp = n->peering.peer; tmp != NULL && tmp != n; tmp = tmp->peering.peer) + check_timeouts(tmp); + + if (p.length > MIN_PACKET_SIZE && get_type(&p)) { + handle(n, &p); + for (tmp = n->peering.peer; tmp != NULL && tmp != n; tmp = tmp->peering.peer) { + handle(tmp, &p); + } + } + } + return ARTNET_EOK; +} + + +/* + * To get around the 4 universes per node limitation , we can start more than + * one node on different ip addresses - you'll need to add aliases to your + * network interface something like: + * + * $ ifconfig eth0:1 10.0.0.10 netmask 255.255.255.0 + * + * Then the nodes must be joined so that they can share the socket + * bound to the broadcast address. + * TODO: use IP_PKTINFO so that packets are sent from the correct source ip + * + * @param vn1 The artnet node + * @param vn2 The second artnet node + * + * @return 0 on sucess, non 0 on failure + */ +int artnet_join(artnet_node vn1, artnet_node vn2) { + + check_nullnode(vn1); + check_nullnode(vn2); + + node n1 = (node) vn1; + node n2 = (node) vn2; + node tmp, n; + + if (n1->state.mode == ARTNET_ON || n2->state.mode == ARTNET_ON) { + artnet_error("%s called after artnet_start", __FUNCTION__); + return ARTNET_EACTION; + } + + tmp = n1->peering.peer == NULL ? n1 : n1->peering.peer; + n1->peering.peer = n2; + for (n = n2; n->peering.peer != NULL && n->peering.peer != n2; n = n->peering.peer) ; + n->peering.peer = tmp; + + // make sure there is only 1 master + for (n = n1->peering.peer; n != n1; n = n->peering.peer) + n->peering.master = FALSE; + + n1->peering.master = TRUE; + + return ARTNET_ESTATE; +} + + +/* + * This is used to set handlers for sent/received artnet packets. + * If you're using a stock standard node you more than likely don't want + * to set these. See the artnet_set_dmx_callback and artnet_set_firmware_callback. + * If you want to get down and dirty with artnet packets, you can set this + * read / manipulate packets as they arrive (or get sent) + * + * @param vn The artnet_node + * @param handler The handler to set + * @param fh A pointer to a function, set to NULL to turn off + * The function should return 0, + * @param data Data to be passed to the handler when its called + * @return 0 on sucess, non 0 on failure + */ +int artnet_set_handler(artnet_node vn, + artnet_handler_name_t handler, + int (*fh)(artnet_node n, void *pp, void * d), + void *data) { + node n = (node) vn; + callback_t *callback; + check_nullnode(vn); + + switch(handler) { + case ARTNET_RECV_HANDLER: + callback = &n->callbacks.recv; + break; + case ARTNET_SEND_HANDLER: + callback = &n->callbacks.send; + break; + case ARTNET_POLL_HANDLER: + callback = &n->callbacks.poll; + break; + case ARTNET_REPLY_HANDLER: + callback = &n->callbacks.reply; + break; + case ARTNET_ADDRESS_HANDLER: + callback = &n->callbacks.address; + break; + case ARTNET_INPUT_HANDLER: + callback = &n->callbacks.input; + break; + case ARTNET_DMX_HANDLER: + callback = &n->callbacks.dmx; + break; + case ARTNET_TOD_REQUEST_HANDLER: + callback = &n->callbacks.todrequest; + break; + case ARTNET_TOD_DATA_HANDLER: + callback = &n->callbacks.toddata; + break; + case ARTNET_TOD_CONTROL_HANDLER: + callback = &n->callbacks.todcontrol; + break; + case ARTNET_RDM_HANDLER: + callback = &n->callbacks.rdm; + break; + default: + artnet_error("%s : Invalid handler defined", __FUNCTION__); + return ARTNET_EARG; + } + callback->fh = fh; + callback->data = data; + return ARTNET_EOK; +} + + +/* + * This is a special callback which is invoked when dmx data is received. + * + * @param vn The artnet_node + * @param fh The callback to invoke (parameters passwd are the artnet_node, the port_id + * that received the dmx, and some user data + * @param data Data to be passed to the handler when its called + */ +int artnet_set_dmx_handler(artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + + n->callbacks.dmx_c.fh = fh; + n->callbacks.dmx_c.data = data; + return ARTNET_EOK; +} + + +/* + * This is a special callback which is invoked when a firmware upload is received. + * + * @param vn The artnet_node + * @param fh The callback to invoke (parameters passwd are the artnet_node, a value which + * is true if this was a ubea upload, and some user data + * @param data Data to be passed to the handler when its called + */ +int artnet_set_firmware_handler( + artnet_node vn, + int (*fh)(artnet_node n, int ubea, uint16_t *data, int length, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + n->callbacks.firmware_c.fh = fh; + n->callbacks.firmware_c.data = data; + return ARTNET_EOK; +} + + +/* + * @param vn The artnet_node + * @param fh The callback to invoke (parameters passwd are the artnet_node, a value which + * is true if this was a ubea upload, and some user data + * @param data Data to be passed to the handler when its called + */ +int artnet_set_program_handler(artnet_node vn, + int (*fh)(artnet_node n, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + n->callbacks.program_c.fh = fh; + n->callbacks.program_c.data = data; + return ARTNET_EOK; +} + + +/* + * + * @param vn The artnet_node + * @param fh The callback to invoke (parameters passed are the artnet_node, pointer to the + * rdm data, the length of the data and the user data + * @param data Data to be passed to the handler when its called + * + */ +int artnet_set_rdm_handler( + artnet_node vn, + int (*fh)(artnet_node n, int address, uint8_t *rdm, int length, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + n->callbacks.rdm_c.fh = fh; + n->callbacks.rdm_c.data = data; + return ARTNET_EOK; +} + + +int artnet_set_rdm_initiate_handler( + artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + + n->callbacks.rdm_init_c.fh = fh; + n->callbacks.rdm_init_c.data = data; + return ARTNET_EOK; +} + + +int artnet_set_rdm_tod_handler( + artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data) { + node n = (node) vn; + check_nullnode(vn); + + n->callbacks.rdm_tod_c.fh = fh; + n->callbacks.rdm_tod_c.data = data; + return ARTNET_EOK; +} + + +// sends a poll to the specified ip, or if null, will broadcast +// talk_to_me - modify remote nodes behaviour, see spec +// TODO - this should clear the node list - but this will cause issues if the caller holds references +// to certain nodes + +/** + * + * @param vn the artnet_node + * @param ip the ip address to send to, NULL will broadcast the ArtPoll + * @param talk_to_me the value for the talk to me + */ +int artnet_send_poll(artnet_node vn, + const char *ip, + artnet_ttm_value_t talk_to_me) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) { + return artnet_tx_poll(n, ip, talk_to_me); + } + + artnet_error("%s : Not sending poll, not a server or raw device", __FUNCTION__); + return ARTNET_ESTATE; +} + + +/* + * Sends an artpoll reply + * + * @param vn the artnet_node + */ +int artnet_send_poll_reply(artnet_node vn) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + return artnet_tx_poll_reply(n, FALSE); +} + + +/* + * Sends some dmx data + * + * @param vn the artnet_node + */ +int artnet_send_dmx(artnet_node vn, + int port_id, + int16_t length, + const uint8_t *data) { + node n = (node) vn; + artnet_packet_t p; + int ret; + input_port_t *port; + + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (port_id < 0 || port_id >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port_id); + return ARTNET_EARG; + } + port = &n->ports.in[port_id]; + + if (length < 1 || length > ARTNET_DMX_LENGTH) { + artnet_error("%s : Length of dmx data out of bounds (%i < 1 || %i > ARTNET_MAX_DMX)", __FUNCTION__, length); + return ARTNET_EARG; + } + + if (port->port_status & PORT_STATUS_DISABLED_MASK) { + artnet_error("%s : attempt to send on a disabled port (id:%i)", __FUNCTION__, port_id); + return ARTNET_EARG; + } + + // ok we're going to send now, make sure we turn the activity bit on + port->port_status = port->port_status | PORT_STATUS_ACT_MASK; + + p.length = sizeof(artnet_dmx_t) - (ARTNET_DMX_LENGTH - length); + + // now build packet + memcpy(&p.data.admx.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.admx.opCode = htols(ARTNET_DMX); + p.data.admx.verH = 0; + p.data.admx.ver = ARTNET_VERSION; + p.data.admx.sequence = port->seq; + p.data.admx.physical = port_id; + p.data.admx.universe = htols(port->port_addr); + + // set length + p.data.admx.lengthHi = short_get_high_byte(length); + p.data.admx.length = short_get_low_byte(length); + memcpy(&p.data.admx.data, data, length); + + // default to bcast + p.to.s_addr = n->state.bcast_addr.s_addr; + + if (n->state.bcast_limit == 0) { + if ((ret = artnet_net_send(n, &p))) + return ret; + } else { + // find the number of ports for this uni + SI *ips = malloc(sizeof(SI) * n->state.bcast_limit); + int nodes = find_nodes_from_uni(&n->node_list, + port->port_addr, + ips, + n->state.bcast_limit); + + if (nodes > n->state.bcast_limit) { + // fall back to broadcast + free(ips); + if ((ret = artnet_net_send(n, &p))) { + return ret; + } + } else { + // unicast to the specified nodes + int i; + for (i =0; i < nodes; i++) { + p.to = ips[i]; + artnet_net_send(n, &p); + } + free(ips); + } + } + port->seq++; + return ARTNET_EOK; +} + + +/* + * Use for performance testing. + * This allows data to be sent on any universe, not just the ones that have + * ports configured. + */ +int artnet_raw_send_dmx(artnet_node vn, + uint8_t uni, + int16_t length, + const uint8_t *data) { + node n = (node) vn; + artnet_packet_t p; + + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type != ARTNET_RAW) + return ARTNET_ESTATE; + + if ( length < 1 || length > ARTNET_DMX_LENGTH) { + artnet_error("%s : Length of dmx data out of bounds (%i < 1 || %i > ARTNET_MAX_DMX)", __FUNCTION__, length); + return ARTNET_EARG; + } + + // set dst addr and length + p.to.s_addr = n->state.bcast_addr.s_addr; + + p.length = sizeof(artnet_dmx_t) - (ARTNET_DMX_LENGTH - length); + + // now build packet + memcpy( &p.data.admx.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.admx.opCode = htols(ARTNET_DMX); + p.data.admx.verH = 0; + p.data.admx.ver = ARTNET_VERSION; + p.data.admx.sequence = 0; + p.data.admx.physical = 0; + p.data.admx.universe = uni; + + // set length + p.data.admx.lengthHi = short_get_high_byte(length); + p.data.admx.length = short_get_low_byte(length); + memcpy(&p.data.admx.data, data, length); + + return artnet_net_send(n, &p); +} + + + +int artnet_send_address(artnet_node vn, + artnet_node_entry e, + const char *shortName, + const char *longName, + uint8_t inAddr[ARTNET_MAX_PORTS], + uint8_t outAddr[ARTNET_MAX_PORTS], + uint8_t subAddr, artnet_port_command_t cmd) { + node n = (node) vn; + artnet_packet_t p; + node_entry_private_t *ent = find_private_entry(n,e); + + check_nullnode(vn); + + if (e == NULL || ent == NULL) + return ARTNET_EARG; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) { + p.to.s_addr = ent->ip.s_addr; + + p.length = sizeof(artnet_address_t); + p.type = ARTNET_ADDRESS; + + // now build packet, copy the number of ports from the reply recieved from this node + memcpy( &p.data.addr.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.addr.opCode = htols(ARTNET_ADDRESS); + p.data.addr.verH = 0; + p.data.addr.ver = ARTNET_VERSION; + p.data.addr.filler1 = 0; + p.data.addr.filler2 = 0; + strncpy((char*) &p.data.addr.shortname, shortName, ARTNET_SHORT_NAME_LENGTH); + strncpy((char*) &p.data.addr.longname, longName, ARTNET_LONG_NAME_LENGTH); + + memcpy(&p.data.addr.swin, inAddr, ARTNET_MAX_PORTS); + memcpy(&p.data.addr.swout, outAddr, ARTNET_MAX_PORTS); + + p.data.addr.subnet = subAddr; + p.data.addr.swvideo = 0x00; + p.data.addr.command = cmd; + + return artnet_net_send(n, &p); + } + return ARTNET_ESTATE; +} + + +/* + * Sends an ArtInput packet to the specified node, this packet is used to + * enable/disable the input ports on the remote node. + * + * 0x01 disable port + * 0x00 enable port + * + * NOTE: should have enums here instead of uint8_t for settings + * + */ +int artnet_send_input(artnet_node vn, + artnet_node_entry e, + uint8_t settings[ARTNET_MAX_PORTS]) { + node n = (node) vn; + artnet_packet_t p; + node_entry_private_t *ent = find_private_entry(n,e); + + check_nullnode(vn); + + if (e == NULL) + return ARTNET_EARG; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) { + // set dst, type and length + p.to.s_addr = ent->ip.s_addr; + + p.length = sizeof(artnet_input_t); + p.type = ARTNET_INPUT; + + // now build packet, copy the number of ports from the reply recieved from this node + memcpy( &p.data.ainput.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.ainput.opCode = htols(ARTNET_INPUT); + p.data.ainput.verH = 0; + p.data.ainput.ver = ARTNET_VERSION; + p.data.ainput.filler1 = 0; + p.data.ainput.filler2 = 0; + p.data.ainput.numbportsH = short_get_high_byte(e->numbports); + p.data.ainput.numbports = short_get_low_byte(e->numbports); + memcpy(&p.data.ainput.input, &settings, ARTNET_MAX_PORTS); + + return artnet_net_send(n, &p); + } + return ARTNET_ESTATE; +} + + +/* + * + * Sends a series of ArtFirmwareMaster packets to the specified node, these are used to + * upload firmware to the remote node. + * + * We send the first packet now, and another one every time we get a ArtFirmwareReply from + * the node + * + * @param vn the artnet_node + * @param e the node entry to send firmware to + * @param ubea set to a true value if this is a ubea upload + * @param data pointer to the firmware + * @param length the number of 16bit words of the firmware (length * 2 = size in bytes) + * @param fh the callback that is invoked when the transfer is complete + * @param user_data data to be passed to the callback + */ +int artnet_send_firmware( + artnet_node vn, + artnet_node_entry e, + int ubea, + uint16_t *data, + int length, + int (*fh)(artnet_node n, artnet_firmware_status_code code, void *d), + void *user_data) { + node n = (node) vn; + node_entry_private_t *ent = find_private_entry(n,e); + int blen; + + check_nullnode(vn); + if (e == NULL || ent == NULL) + return ARTNET_EARG; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) { + + // length in bytes + blen = length * sizeof(uint16_t); + + // store the parameters for this transfer + ent->firmware.data = malloc(blen); + + if ( ent->firmware.data == NULL) { + artnet_error_malloc(); + return ARTNET_EMEM; + } + + ent->firmware.bytes_current = 0; + ent->firmware.bytes_total = blen; + ent->firmware.peer = ent->ip; + ent->firmware.ubea = ubea; + // entry->firmware.last_time set upon sending a packet + // id of the current block + ent->firmware.expected_block = 0; + ent->firmware.callback = fh; + ent->firmware.user_data = user_data; + + memcpy(ent->firmware.data, data, blen); + + return artnet_tx_firmware_packet(n, &ent->firmware); + } + + return ARTNET_ESTATE; +} + + +/** + * + * Sends an ArtFirmwareReply packet to the specified node, + * this packet is used to acknowledge firmware master packets. + * + * Note, you should never call this function directly, it is provided for + * completness and will only work if the node type is ARTNET_RAW + * + * @param vn the artnet_node + * @param e the node entry to send firmware to + * @param code the status code to send + */ +int artnet_send_firmware_reply(artnet_node vn, + artnet_node_entry e, + artnet_firmware_status_code code) { + node n = (node) vn; + node_entry_private_t *ent = find_private_entry(n,e); + + check_nullnode(vn); + + if (e == NULL || ent == NULL) + return ARTNET_EARG; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + return artnet_tx_firmware_reply(n, ent->ip.s_addr, code); +} + + +/* + * Sends a tod request + * + * @param vn the artnet node + * + */ +int artnet_send_tod_request(artnet_node vn) { + node n = (node) vn; + check_nullnode(vn); + + return artnet_tx_tod_request(n); +} + + +/* + * Sends a tod control datagram + * + * @param vn the artnet node + * @param address the universe address to control + * @param action the action to take + * + */ +int artnet_send_tod_control(artnet_node vn, + uint8_t address, + artnet_tod_command_code action) { + node n = (node) vn; + check_nullnode(vn); + return artnet_tx_tod_control(n, address, action); +} + + +/* + * Send a tod data datagram + * Note you should not use this, a TodData message should only be sent in response + * to a request, or when a RDM device is added. Use artnet_add_rdm_device() or artnet_add_rdm_devices() instead + * + * @param + */ +int artnet_send_tod_data(artnet_node vn, int port) { + node n = (node) vn; + check_nullnode(vn); + + // should update the check for enabled port here + if (port < 0 || port >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port); + return ARTNET_EARG; + } + + return artnet_tx_tod_data(n, port); +} + + +/* + * Send a rdm datagram + * @param address the universe address to send to + * @param data the rdm data to send + * @param length the length of the rdm data + */ +int artnet_send_rdm(artnet_node vn, + uint8_t address, + uint8_t *data, + int length) { + node n = (node) vn; + check_nullnode(vn); + + //we check that we are using this address + return artnet_tx_rdm(n, address, data, length); +} + + +/* + * Add a rdm device to our tod. + * @param port the port the device is connected to + * @param the uid of the device + */ +int artnet_add_rdm_device(artnet_node vn, + int port, + uint8_t uid[ARTNET_RDM_UID_WIDTH]) { + node n = (node) vn; + check_nullnode(vn); + + if (port < 0 || port >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port); + return ARTNET_EARG; + } + + // add uid to tod for this port + add_tod_uid(&n->ports.out[port].port_tod, uid); + + // notify everyone our tod changed + return artnet_tx_tod_data(n, port); +} + + +/* + * add a list of rdm devices to our tod, use this for full discovery + * + * @param port the port the device is connected to + * @param uid pointer to the uids + * @param count number of uids + */ +int artnet_add_rdm_devices(artnet_node vn, int port, uint8_t *uid, int count) { + node n = (node) vn; + int i; + + check_nullnode(vn); + + if (port < 0 || port >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port); + return ARTNET_EARG; + } + + if (count < 0) + return ARTNET_EARG; + + for (i = 0; i < count; i++) { + // add uid to tod for this port + add_tod_uid(&n->ports.out[port].port_tod, uid); + uid += ARTNET_RDM_UID_WIDTH; + } + // notify everyone our tod changed + return artnet_tx_tod_data(n, port); + +} + + +/* + * remove a rdm device to our tod. + * + * @param port the port the device was connected to + * @param the uid of the device + */ +int artnet_remove_rdm_device(artnet_node vn, + int port, + uint8_t uid[ARTNET_RDM_UID_WIDTH]) { + node n = (node) vn; + check_nullnode(vn); + + if (port < 0 || port >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port); + return ARTNET_EARG; + } + + // remove uid to tod for this port + remove_tod_uid(&n->ports.out[port].port_tod, uid); + + // notify everyone our tod changed + return artnet_tx_tod_data(n, port); +} + + +/* + * Reads the latest dmx data + * @param vn the artnet node + * @param port_id the port to read data from + * @param length + * @return a pointer to the dmx data, NULL on error + */ + +uint8_t *artnet_read_dmx(artnet_node vn, int port_id, int *length) { + node n = (node) vn; + + if (n == NULL) + return NULL; + + if (port_id < 0 || port_id >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port_id); + return NULL; + } + + *length = n->ports.out[port_id].length; + return &n->ports.out[port_id].data[0]; +} + + +//-------------------------------------- +// Functions to change the node state (setters) + +// type : server, node, mserver, raw +int artnet_set_node_type(artnet_node vn, artnet_node_type type) { + node n = (node) vn; + check_nullnode(vn); + + n->state.node_type = type; + return ARTNET_EOK; +} + + +/** + * Sets the artnet subnet address for this node. + * The subnet address has nothing to do with IP addresses). An ArtNet subnet is a grouping of 16 DMX universes + * (ie. ports) + * + * The subnet address is between 0 and 15. If the supplied address is larger than 15, the + * lower 4 bits will be used in setting the address. + * + * It will have no effect if the node is under network control. + * + * Note that changing the subnet address will cause the universe addresses of all ports to change. + * + * @param vn the artnet_node + * @param subnet new subnet address + */ +int artnet_set_subnet_addr(artnet_node vn, uint8_t subnet) { + node n = (node) vn; + int i, ret; + + check_nullnode(vn); + + n->state.default_subnet = subnet; + + // if not under network control, and the subnet is different from the current one + if (!n->state.subnet_net_ctl && subnet != n->state.subnet) { + n->state.subnet = subnet; + + // redo the addresses for each port + for (i =0; i < ARTNET_MAX_PORTS; i++) { + n->ports.in[i].port_addr = ((n->state.subnet & LOW_NIBBLE) << 4) | (n->ports.in[i].port_addr & LOW_NIBBLE); + // reset dmx sequence number + n->ports.in[i].seq = 0; + + n->ports.out[i].port_addr = ((n->state.subnet & LOW_NIBBLE) << 4) | (n->ports.out[i].port_addr & LOW_NIBBLE); + } + + if (n->state.mode == ARTNET_ON) { + + if ((ret = artnet_tx_build_art_poll_reply(n))) + return ret; + + return artnet_tx_poll_reply(n,FALSE); + } + } else if (n->state.subnet_net_ctl ) { + // trying to change subnet addr while under network control + n->state.report_code = ARTNET_RCUSERFAIL; + } + + return ARTNET_EOK; +} + + +/** + * Sets the short name of the node. + * The string should be null terminated and a maxmium of 18 Characters will be used + * + * @param vn the artnet_node + * @param name the short name of the node. + */ +int artnet_set_short_name(artnet_node vn, const char *name) { + node n = (node) vn; + check_nullnode(vn); + + strncpy((char *) &n->state.short_name, name, ARTNET_SHORT_NAME_LENGTH); + n->state.short_name[ARTNET_SHORT_NAME_LENGTH-1] = 0x00; + return artnet_tx_build_art_poll_reply(n); +} + + +/* + * Sets the long name of the node. + * The string should be null terminated and a maximium of 64 characters will be used + * + * @param vn the artnet_node + * @param name the node's long name + */ +int artnet_set_long_name(artnet_node vn, const char *name) { + node n = (node) vn; + check_nullnode(vn); + + strncpy((char *) &n->state.long_name, name, ARTNET_LONG_NAME_LENGTH); + n->state.long_name[ARTNET_LONG_NAME_LENGTH-1] = 0x00; + return artnet_tx_build_art_poll_reply(n); +} + + +/* + * Sets the direction and type of port + * @param vn the artnet_node + * @param id + * @param direction + * @param data + */ +int artnet_set_port_type(artnet_node vn, + int port_id, + artnet_port_settings_t settings, + artnet_port_data_code data) { + node n = (node) vn; + check_nullnode(vn); + + if (port_id < 0 || port_id >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, port_id); + return ARTNET_EARG; + } + + n->ports.types[port_id] = settings | data; + return ARTNET_EOK; +} + + +/* + * Sets the port address of the port. + * + * Just to set some terms straight: + * - subnet address, is 4 bits, set on a per-node basis + * - port address, 4 bits, set on a per-port basis + * - universe address, 8 bits derrived from the subnet and port addresses, specific (but may + * not be unique) to a port. + * + * The upper four bits of the universe address are from the subnet address, while the lower + * four are from the port address. + * + * So for example, if the subnet address of the node is 0x03, and the port address is + * 0x02, the universe address for the port will be 0x32. + * + * As the port address is between 0 and 15, only the lower 4 bits of the addr argument + * will be used. + * + * The operation may have no affect if the port is under network control. + * + * @param vn the artnet_node + * @param id the phyiscal port number (from 0 to ARTNET_MAX_PORTS-1 ) + * @param dir either ARTNET_INPUT_PORT or ARTNET_OUTPUT_PORT + * @param addr the new port address + */ +int artnet_set_port_addr(artnet_node vn, + int id, + artnet_port_dir_t dir, + uint8_t addr) { + node n = (node) vn; + int ret; + int changed = 0; + + g_port_t *port; + + check_nullnode(vn); + + if (id < 0 || id >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, id); + return ARTNET_EARG; + } + + if (addr > 16) { + artnet_error("%s : Attempt to set port %i to invalid address %#hhx\n", __FUNCTION__, id, addr); + return ARTNET_EARG; + } + + if (dir == ARTNET_INPUT_PORT) { + port = &n->ports.in[id].port; + changed = n->ports.in[id].port_enabled?0:1; + n->ports.in[id].port_enabled = TRUE; + } else if (dir == ARTNET_OUTPUT_PORT) { + port = &n->ports.out[id].port; + changed = n->ports.out[id].port_enabled?0:1; + n->ports.out[id].port_enabled = TRUE; + } else { + artnet_error("%s : Invalid port direction\n", __FUNCTION__); + return ARTNET_EARG; + } + + port->default_addr = addr; + + // if not under network control and address is changing + if (!port->net_ctl && + (changed || (addr & LOW_NIBBLE) != (port->addr & LOW_NIBBLE))) { + port->addr = ((n->state.subnet & LOW_NIBBLE) << 4) | (addr & LOW_NIBBLE); + + // reset seq if input port + if (dir == ARTNET_INPUT_PORT) + n->ports.in[id].seq = 0; + + if (n->state.mode == ARTNET_ON) { + if ((ret = artnet_tx_build_art_poll_reply(n))) + return ret; + + return artnet_tx_poll_reply(n,FALSE); + } + } else if (port->net_ctl) { + // trying to change port addr while under network control + n->state.report_code = ARTNET_RCUSERFAIL; + } + return ARTNET_EOK; +} + + +/* + * Returns the universe address of this port + * + * @param vn the artnet_node + * @param id the phyiscal port number (from 0 to ARTNET_MAX_PORTS-1 ) + * @param dir either ARTNET_INPUT_PORT or ARTNET_OUTPUT_PO + * + * @return the universe address, or < 0 on error + */ +int artnet_get_universe_addr(artnet_node vn, int id, artnet_port_dir_t dir) { + node n = (node) vn; + check_nullnode(vn); + + if (id < 0 || id >= ARTNET_MAX_PORTS) { + artnet_error("%s : port index out of bounds (%i < 0 || %i > ARTNET_MAX_PORTS)", __FUNCTION__, id); + return ARTNET_EARG; + } + + if (dir == ARTNET_INPUT_PORT) + return n->ports.in[id].port.addr; + else if (dir == ARTNET_OUTPUT_PORT) + return n->ports.out[id].port.addr; + else { + artnet_error("%s : Invalid port direction\n", __FUNCTION__); + return ARTNET_EARG; + } +} + +int artnet_get_config(artnet_node vn, artnet_node_config_t *config) { + int i; + node n = (node) vn; + check_nullnode(vn); + + strncpy(config->short_name, n->state.short_name, ARTNET_SHORT_NAME_LENGTH); + strncpy(config->long_name, n->state.long_name, ARTNET_LONG_NAME_LENGTH); + config->subnet = n->state.subnet; + + for (i = 0; i < ARTNET_MAX_PORTS; i++) { + config->in_ports[i] = n->ports.in[i].port.addr & LOW_NIBBLE; + config->out_ports[i] = n->ports.out[i].port.addr & LOW_NIBBLE; + } + + return ARTNET_EOK; +} + + +/* + * Dumps the node config to stdout. + * + * @param vn the artnet_node + */ +int artnet_dump_config(artnet_node vn) { + node n = (node) vn; + check_nullnode(vn); + + printf("#### NODE CONFIG ####\n"); + printf("Node Type: %i\n", n->state.node_type); + printf("Short Name: %s\n", n->state.short_name); + printf("Long Name: %s\n", n->state.long_name); + printf("Subnet: %#hx\n", n->state.subnet); + printf("Default Subnet: %#hx\n", n->state.default_subnet); + printf("Net Ctl: %i\n", n->state.subnet_net_ctl); + printf("#####################\n"); + + return ARTNET_EOK; +} + + +/* + * Returns the socket descriptor associated with this artnet_node. + * libartnet currently uses two descriptors per node, one bound + * to the network address and one bound to the subnet broadcast address + * + * @param vn the artnet_node + * @param socket the index of the socket descriptor to fetch (0 or 1) + * @return the socket descriptor + */ +int artnet_get_sd(artnet_node vn) { + node n = (node) vn; + check_nullnode(vn); + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + return n->sd; +} + + +/** + * Sets the file descriptors in the fdset that we are interested in. + * + * @param vn the artnet_node + * @param fdset pointer to the fdset to change + * @return the maxfd+1 + */ +int artnet_set_fdset(artnet_node vn, fd_set *fdset) { + node n = (node) vn; + check_nullnode(vn); + + if (!fdset) + return ARTNET_EARG; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + return artnet_net_set_fdset(n, fdset); +} + + +/** + * Returns the artnet_node_list. + * The artnet_node_list holds artnet_node_entry(s) that represent the discovered + * remote nodes on the network + * NOTE: this function is not THREAD SAFE + * + * @param vn the artnet_node + * @return the artnet_node_list + */ +artnet_node_list artnet_get_nl(artnet_node vn) { + node n = (node) vn; + + if (!vn) + return NULL; + + return &n->node_list; +} + + +/** + * Repositions the pointer to the first entry in the artnet_node_list + * NOTE: this function is not THREAD SAFE + * + * @param vnl the artnet_node_list + * @return the first artnet_node_entry in the list, or NULL if the list is empty + */ +artnet_node_entry artnet_nl_first(artnet_node_list vnl) { + node_list_t *nl = (node_list_t*) vnl; + + if (!nl) + return NULL; + + nl->current = nl->first; + return &nl->current->pub; +} + + +/** + * Moves the pointer to the next element in the artnet_node_list + * NOTE: this function is not THREAD SAFE + * + * @param vnl the artnet_node_list + * @return the next artnet_node_entry, or NULL if the end of the list is reached + */ +artnet_node_entry artnet_nl_next(artnet_node_list vnl) { + node_list_t *nl = (node_list_t*) vnl; + + if (!nl) + return NULL; + + nl->current = nl->current->next; + return &nl->current->pub; +} + + +/* + * Returns the length of the artnet_node_list + * NOTE: this function is not THREAD SAFE + * + * @param vnl the artnet_node_list + * @return the length of the list + */ +int artnet_nl_get_length(artnet_node_list vnl) { + node_list_t *nl = (node_list_t*) vnl; + + if (!nl) + return 0; + + return nl->length; +} + + +/* + * Return a pointer to the staticly allocated error string + */ +char *artnet_strerror() { + return artnet_errstr; +} + + +//----------------------------------------------------------------------------- +// Private functions follow +//----------------------------------------------------------------------------- + +int artnet_nl_update(node_list_t *nl, artnet_packet reply) { + node_entry_private_t *entry; + + entry = find_entry_from_ip(nl, reply->from); + + if (!entry) { + // add to list + entry = (node_entry_private_t*) malloc(sizeof(node_entry_private_t)); + + if (!entry) { + artnet_error_malloc(); + return ARTNET_EMEM; + } + + memset(entry, 0x00, sizeof(node_entry_private_t)); + + copy_apr_to_node_entry(&entry->pub, &reply->data.ar); + entry->ip = reply->from; + entry->next = NULL; + + if (!nl->first) { + nl->first = entry; + nl->last = entry; + } else { + nl->last->next = entry; + nl->last = entry; + } + nl->length++; + } else { + // update entry + copy_apr_to_node_entry(&entry->pub, &reply->data.ar); + } + return ARTNET_EOK; +} + + +/* + * check if this packet is in list + */ +node_entry_private_t *find_entry_from_ip(node_list_t *nl, SI ip) { + node_entry_private_t *tmp; + + for (tmp = nl->first; tmp; tmp = tmp->next) { + if (ip.s_addr == tmp->ip.s_addr) + break; + } + return tmp; +} + + +/* + * Find all nodes with a port bound to a particular universe + * @param nl the node list + * @param uni the universe to search for + * @param ips store matching node ips here + * @param size size of ips + * @return number of nodes matched + */ +int find_nodes_from_uni(node_list_t *nl, uint8_t uni, SI *ips, int size) { + node_entry_private_t *tmp; + int count = 0; + int i,j = 0; + + for (tmp = nl->first; tmp; tmp = tmp->next) { + int added = FALSE; + for (i =0; i < tmp->pub.numbports; i++) { + if (tmp->pub.swout[i] == uni && ips) { + if (j < size && !added) { + ips[j++] = tmp->ip; + added = TRUE; + } + count++; + } + } + } + return count; +} + + +/* + * Add a node to the node list from an ArtPollReply msg + */ +void copy_apr_to_node_entry(artnet_node_entry e, artnet_reply_t *reply) { + + // the ip is network byte ordered + memcpy(&e->ip, &reply->ip, 4); + e->ver = bytes_to_short(reply->verH, reply->ver); + e->sub = bytes_to_short(reply->subH, reply->sub); + e->oem = bytes_to_short(reply->oemH, reply->oem); + e->ubea = reply->ubea; + memcpy(&e->etsaman, &reply->etsaman, 2); + memcpy(&e->shortname, &reply->shortname, sizeof(e->shortname)); + memcpy(&e->longname, &reply->longname, sizeof(e->longname)); + memcpy(&e->nodereport, &reply->nodereport, sizeof(e->nodereport)); + e->numbports = bytes_to_short(reply->numbportsH, reply->numbports); + memcpy(&e->porttypes, &reply->porttypes, ARTNET_MAX_PORTS); + memcpy(&e->goodinput, &reply->goodinput, ARTNET_MAX_PORTS); + memcpy(&e->goodinput, &reply->goodinput, ARTNET_MAX_PORTS); + memcpy(&e->goodoutput, &reply->goodoutput, ARTNET_MAX_PORTS); + memcpy(&e->swin, &reply->swin, ARTNET_MAX_PORTS); + memcpy(&e->swout, &reply->swout, ARTNET_MAX_PORTS); + e->swvideo = reply->swvideo; + e->swmacro = reply->swmacro; + e->swremote = reply->swremote; + e->style = reply->style; + memcpy(&e->mac, &reply->mac, ARTNET_MAC_SIZE); +} + +/* + * find a node_entry in the node list + */ +node_entry_private_t *find_private_entry(node n, artnet_node_entry e) { + if (!e) + return NULL; + + node_entry_private_t *tmp; + + // check if this packet is in list + for(tmp = n->node_list.first; tmp; tmp = tmp->next) { + if (!memcmp(&e->ip, &tmp->pub.ip, 4)) + break; + } + return tmp; +} + + +void check_timeouts(node n) { + time_t now = time(NULL); + + if (n->firmware.peer.s_addr != 0 + && (now - n->firmware.last_time >= FIRMWARE_TIMEOUT_SECONDS)) { + + printf("firmware timeout\n"); + reset_firmware_upload(n); + + n->state.report_code = ARTNET_RCFIRMWAREFAIL; + // spec says to set ArtPollReply->Status here, but don't know to what value + } +} diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.h b/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.h new file mode 100644 index 0000000..c2f1c06 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/artnet.h @@ -0,0 +1,346 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * artnet.h + * Interface to libartnet + * Copyright (C) 2004-2007 Simon Newton + */ + +#ifndef ARTNET_HEADER_H +#define ARTNET_HEADER_H + +#include +// order is important here for osx +#include + +#ifndef WIN32 +#include +#else +#include +typedef unsigned long in_addr_t; +#endif + +#include + +/* the external storage class is "extern" in UNIX; in MSW it's ugly. */ +#ifndef EXTERN +#ifdef MSW +#define EXTERN __declspec(dllexport) extern +#else +#define EXTERN extern +#endif /* MSW */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +EXTERN int ARTNET_ADDRESS_NO_CHANGE; + +/** + * An enum for setting the behaviour of a port. + * Ports can either input data (DMX -> ArtNet) or + * output (ArtNet -> DMX) data. + */ +typedef enum { + ARTNET_ENABLE_INPUT = 0x40, /**< Enables the input for this port */ + ARTNET_ENABLE_OUTPUT = 0x80 /**< Enables the output for this port */ +} artnet_port_settings_t; + + +typedef enum { + ARTNET_PC_NONE = 0x00, + ARTNET_PC_CANCEL = 0x01, + ARTNET_PC_LED_NORMAL = 0x02, + ARTNET_PC_LED_MUTE = 0x03, + ARTNET_PC_LED_LOCATE = 0x04, + ARTNET_PC_RESET = 0x05, + ARTNET_PC_MERGE_LTP_O = 0x10, + ARTNET_PC_MERGE_LTP_1 = 0x11, + ARTNET_PC_MERGE_LTP_2 = 0x12, + ARTNET_PC_MERGE_LTP_3 = 0x13, + ARTNET_PC_MERGE_HTP_0 = 0x50, + ARTNET_PC_MERGE_HTP_1 = 0x51, + ARTNET_PC_MERGE_HTP_2 = 0x52, + ARTNET_PC_MERGE_HTP_3 = 0x53, + ARTNET_PC_CLR_0 = 0x93, + ARTNET_PC_CLR_1 = 0x93, + ARTNET_PC_CLR_2 = 0x93, + ARTNET_PC_CLR_3 = 0x93, +} artnet_port_command_t; + + +/* + * An enum for the type of data transmitted on a port. + * As far as I know, only DMX-512 is supported + */ +typedef enum { + ARTNET_PORT_DMX = 0x00, /**< Data is DMX-512 */ + ARTNET_PORT_MIDI = 0x01, /**< Data is MIDI */ + ARTNET_PORT_AVAB = 0x02, /**< Data is Avab */ + ARTNET_PORT_CMX = 0x03, /**< Data is Colortran CMX */ + ARTNET_PORT_ADB = 0x04, /**< Data is ABD 62.5 */ + ARTNET_PORT_ARTNET = 0x05 /**< Data is ArtNet */ +} artnet_port_data_code; + + +// defines the status of the firmware transfer +typedef enum { + ARTNET_FIRMWARE_BLOCKGOOD = 0x00, + ARTNET_FIRMWARE_ALLGOOD = 0x01, + ARTNET_FIRMWARE_FAIL = 0xff, +} artnet_firmware_status_code; + +// tod actions +typedef enum { + ARTNET_TOD_FULL = 0x00, + ARTNET_TOD_FLUSH = 0x01, +} artnet_tod_command_code; + + +/** + * An enum for refering to a particular input or output port. + */ +typedef enum { + ARTNET_INPUT_PORT = 1, /**< The input port */ + ARTNET_OUTPUT_PORT, /**< The output port */ +} artnet_port_dir_t; + + +/* + * Enum describing the type of node + */ +typedef enum { + ARTNET_SRV, /**< An ArtNet server (transmitts DMX data) */ + ARTNET_NODE, /**< An ArtNet node (dmx reciever) */ + ARTNET_MSRV, /**< A Media Server */ + ARTNET_ROUTE, /**< No Effect currently */ + ARTNET_BACKUP, /**< No Effect currently */ + ARTNET_RAW /**< Raw Node - used for diagnostics */ +} artnet_node_type; + + +/* + * Enum for the talk-to-me value + * These values can be &'ed togeather, so for example to set private replies + * and auto replying use : + * (ARTNET_TTM_PRIVATE & ARTNET_TTM_AUTO) + */ +typedef enum { + ARTNET_TTM_DEFAULT = 0xFF, /**< default, ArtPollReplies are broadcast, and nodes won't send a ArtPollReply when conditions change */ + ARTNET_TTM_PRIVATE = 0xFE, /**< ArtPollReplies aren't broadcast */ + ARTNET_TTM_AUTO = 0xFD /**< ArtPollReplies are send when node conditions chang */ +} artnet_ttm_value_t; + +/** + * Enums for the application defined handlers + */ +typedef enum { + ARTNET_RECV_HANDLER, /**< Called on reciept of any ArtNet packet */ + ARTNET_SEND_HANDLER, /**< Called on transmission of any ArtNet packet */ + ARTNET_POLL_HANDLER, /**< Called on reciept of an ArtPoll packet */ + ARTNET_REPLY_HANDLER, /**< Called on reciept of an ArtPollReply packet */ + ARTNET_DMX_HANDLER, /**< Called on reciept of an ArtDMX packet */ + ARTNET_ADDRESS_HANDLER, /**< Called on reciept of an ArtAddress packet */ + ARTNET_INPUT_HANDLER, /**< Called on reciept of an ArtInput packet */ + ARTNET_TOD_REQUEST_HANDLER, /**< Called on reciept of an ArtTodRequest packet */ + ARTNET_TOD_DATA_HANDLER, /**< Called on reciept of an ArtTodData packet */ + ARTNET_TOD_CONTROL_HANDLER, /**< Called on reciept of an ArtTodControl packet */ + ARTNET_RDM_HANDLER, /**< Called on reciept of an ArtRdm packet */ + ARTNET_IPPROG_HANDLER, /**< Called on reciept of an ArtIPProg packet */ + ARTNET_FIRMWARE_HANDLER, /**< Called on reciept of an ArtFirmware packet */ + ARTNET_FIRMWARE_REPLY_HANDLER, /**< Called on reciept of an ArtFirmwareReply packet */ +} artnet_handler_name_t; + + +/* + * Describes a remote ArtNet node that has been discovered + */ +typedef struct artnet_node_entry_s { + uint8_t ip[ARTNET_IP_SIZE]; /**< The IP address, Network byte ordered*/ + int16_t ver; /**< The firmware version */ + int16_t sub; /**< The subnet address */ + int16_t oem; /**< The OEM value */ + uint8_t ubea; /**< The UBEA version */ + uint8_t status; + uint8_t etsaman[ARTNET_ESTA_SIZE]; /**< The ESTA Manufacturer code */ + uint8_t shortname[ARTNET_SHORT_NAME_LENGTH]; /**< The short node name */ + uint8_t longname[ARTNET_LONG_NAME_LENGTH]; /**< The long node name */ + uint8_t nodereport[ARTNET_REPORT_LENGTH]; /**< The node report */ + int16_t numbports; /**< The number of ports */ + uint8_t porttypes[ARTNET_MAX_PORTS]; /**< The type of ports */ + uint8_t goodinput[ARTNET_MAX_PORTS]; + uint8_t goodoutput[ARTNET_MAX_PORTS]; + uint8_t swin[ARTNET_MAX_PORTS]; + uint8_t swout[ARTNET_MAX_PORTS]; + uint8_t swvideo; + uint8_t swmacro; + uint8_t swremote; + uint8_t style; + uint8_t mac[ARTNET_MAC_SIZE]; /**< The MAC address of the node */ +} artnet_node_entry_t; + +/** A pointer to an artnet_node_entry_t */ +typedef artnet_node_entry_t *artnet_node_entry; + +typedef struct { + char short_name[ARTNET_SHORT_NAME_LENGTH]; + char long_name[ARTNET_LONG_NAME_LENGTH]; + uint8_t subnet; + uint8_t in_ports[ARTNET_MAX_PORTS]; + uint8_t out_ports[ARTNET_MAX_PORTS]; +} artnet_node_config_t; + + +/** The local ArtNet node */ +typedef void *artnet_node; + +/** A list of remote ArtNet nodes */ +typedef void *artnet_node_list; + +// node control functions +EXTERN artnet_node artnet_new(const char *ip, int verbose); +EXTERN int artnet_setoem(artnet_node vn, uint8_t hi, uint8_t lo); +EXTERN int artnet_setesta(artnet_node vn, char hi, char lo); +EXTERN int artnet_set_bcast_limit(artnet_node vn, int limit); +EXTERN int artnet_start(artnet_node n); +EXTERN int artnet_read(artnet_node n, int timeout); +EXTERN int artnet_stop(artnet_node n); +EXTERN int artnet_destroy(artnet_node n); + +int artnet_join(artnet_node vn1, artnet_node vn2); + +// handler functions +// these need to be cleaned up into a generic interface +EXTERN int artnet_set_handler(artnet_node vn, + artnet_handler_name_t handler, + int (*fh)(artnet_node n, void *pp, void *d), + void* data); +EXTERN int artnet_set_dmx_handler(artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data); +EXTERN int artnet_set_program_handler(artnet_node vn, + int (*fh)(artnet_node n, void *d), + void *data); +EXTERN int artnet_set_firmware_handler(artnet_node vn, + int (*fh)(artnet_node n, int ubea, uint16_t *data, int length, void *d), + void *data); +EXTERN int artnet_set_rdm_handler(artnet_node vn, + int (*fh)(artnet_node n, int address, uint8_t *rdm, int length, void *d), + void *data); +EXTERN int artnet_set_rdm_initiate_handler(artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data); +EXTERN int artnet_set_rdm_tod_handler(artnet_node vn, + int (*fh)(artnet_node n, int port, void *d), + void *data); + +// send functions +EXTERN int artnet_send_poll(artnet_node n, + const char *ip, + artnet_ttm_value_t talk_to_me); +EXTERN int artnet_send_poll_reply(artnet_node n); +EXTERN int artnet_send_dmx(artnet_node n, + int port_id, + int16_t length, + const uint8_t *data); +EXTERN int artnet_raw_send_dmx(artnet_node vn, + uint8_t uni, + int16_t length, + const uint8_t *data); +EXTERN int artnet_send_address(artnet_node n, + artnet_node_entry e, + const char *shortName, + const char *longName, + uint8_t inAddr[ARTNET_MAX_PORTS], + uint8_t outAddr[ARTNET_MAX_PORTS], + uint8_t subAddr, + artnet_port_command_t cmd); +EXTERN int artnet_send_input(artnet_node n, + artnet_node_entry e, + uint8_t settings[ARTNET_MAX_PORTS]); +EXTERN int artnet_send_firmware(artnet_node vn, + artnet_node_entry e, + int ubea, + uint16_t *data, + int length, + int (*fh)(artnet_node n, artnet_firmware_status_code code, void *d), + void *user_data); +EXTERN int artnet_send_firmware_reply(artnet_node vn, + artnet_node_entry e, + artnet_firmware_status_code code); + +// rdm functions +EXTERN int artnet_send_tod_request(artnet_node vn); +EXTERN int artnet_send_tod_control(artnet_node vn, + uint8_t address, + artnet_tod_command_code action); +EXTERN int artnet_send_tod_data(artnet_node vn, int port); +EXTERN int artnet_send_rdm(artnet_node vn, + uint8_t address, + uint8_t *data, + int length); +EXTERN int artnet_add_rdm_device(artnet_node vn, + int port, + uint8_t uid[ARTNET_RDM_UID_WIDTH]); +EXTERN int artnet_add_rdm_devices(artnet_node vn, + int port, + uint8_t *uid, + int count); +EXTERN int artnet_remove_rdm_device(artnet_node vn, + int port, + uint8_t uid[ARTNET_RDM_UID_WIDTH]); + +// recv functions +EXTERN uint8_t *artnet_read_dmx(artnet_node n, int port_id, int *length); + +// state changing functions +EXTERN int artnet_set_node_type(artnet_node n, artnet_node_type type); +EXTERN int artnet_set_short_name(artnet_node vn, const char *name); +EXTERN int artnet_set_long_name(artnet_node n, const char *name); + +//port manipulation functions +EXTERN int artnet_set_port_type(artnet_node n, + int id, + artnet_port_settings_t settings, + artnet_port_data_code data); +EXTERN int artnet_set_port_addr(artnet_node n, + int id, + artnet_port_dir_t dir, + uint8_t addr); +EXTERN int artnet_set_subnet_addr(artnet_node n, uint8_t subnet); +EXTERN int artnet_get_universe_addr(artnet_node n, + int id, + artnet_port_dir_t dir); + +//node list functions +EXTERN artnet_node_list artnet_get_nl(artnet_node n); +EXTERN artnet_node_entry artnet_nl_first(artnet_node_list nl); +EXTERN artnet_node_entry artnet_nl_next(artnet_node_list nl); +EXTERN int artnet_nl_get_length(artnet_node_list nl); + +// misc +EXTERN int artnet_dump_config(artnet_node n); +EXTERN int artnet_get_config(artnet_node n, artnet_node_config_t *config); +EXTERN int artnet_get_sd(artnet_node n); +EXTERN int artnet_set_fdset(artnet_node vn, fd_set *fdset); + +char *artnet_strerror(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/common.h b/open-lighting-architecture/libartnet-1.1.0/artnet/common.h new file mode 100644 index 0000000..028b8bd --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/common.h @@ -0,0 +1,83 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * common.c + * Constants required for both internally and externally + * Copyright (C) 2004-2006 Simon Newton + */ + +#ifndef ARTNET_COMMON_H +#define ARTNET_COMMON_H + +/* + * libartnet error codes + */ +enum { + ARTNET_EOK = 0, + ARTNET_ENET = -1, // network error + ARTNET_EMEM = -2, // memory error + ARTNET_EARG = -3, // argument error + ARTNET_ESTATE = -4, // state error + ARTNET_EACTION = -5, // invalid action +}; + + +/* + * The maximum ports per node built into the ArtNet protocol. + * This is always 4. Don't change it unless you really know what your doing + */ +enum { ARTNET_MAX_PORTS = 4 }; + +/** + * The length of the short name field. Always 18 + */ +enum { ARTNET_SHORT_NAME_LENGTH = 18 }; + +/** + * The length of the long name field. Always 64 + */ +enum { ARTNET_LONG_NAME_LENGTH = 64 }; + +/** + * The length of the report field. Always 64 + */ +enum { ARTNET_REPORT_LENGTH = 64 }; + +/** + * The length of the DMX field. Always 512 + */ +enum { ARTNET_DMX_LENGTH = 512 }; + +/* + * Number of bytes in a RDM UID + */ +enum { ARTNET_RDM_UID_WIDTH = 6 }; + +/* + * Length of the hardware address + */ +enum { ARTNET_MAC_SIZE = 6 }; + +/* + * Length of the ESTA field + */ +enum { ARTNET_ESTA_SIZE = 2 }; + +/* + * Length of the IP field + */ +enum { ARTNET_IP_SIZE = 4 }; + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/misc.c b/open-lighting-architecture/libartnet-1.1.0/artnet/misc.c new file mode 100644 index 0000000..51bff1a --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/misc.c @@ -0,0 +1,56 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * misc.c + * Misc code for libartnet (almost nothing these days) + * Copyright (C) 2004-2005 Simon Newton + */ + +#include +#include +#include "private.h" + +// static buffer for the error strings +char artnet_errstr[256]; + +/* + * Libartnet error function + * This writes the error string to artnet_errstr, which can be accessed + * using artnet_strerror(); + */ +void artnet_error(const char *fmt, ...) { + va_list ap; + va_start(ap, fmt); + vsnprintf(artnet_errstr, sizeof(artnet_errstr), fmt, ap); + va_end(ap); +} + + +/* + * Converts 4 bytes in big endian order to a 32 bit int + */ +int32_t artnet_misc_nbytes_to_32(uint8_t bytes[4]) { + return (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]; +} + +/* + * Converts an int to an arrany of 4 bytes in big endian format + */ +void artnet_misc_int_to_bytes(int data, uint8_t *bytes) { + bytes[3] = (data & 0x000000FF); + bytes[2] = (data & 0x0000FF00) >> 8; + bytes[1] = (data & 0x00FF0000) >> 16; + bytes[0] = (data & 0xFF000000) >> 24; +} diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/misc.h b/open-lighting-architecture/libartnet-1.1.0/artnet/misc.h new file mode 100644 index 0000000..20f05a4 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/misc.h @@ -0,0 +1,42 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * misc.h + * Header file for misc.c + * Copyright (C) 2004-2005 Simon Newton + */ + +#ifndef ARTNET_MISC_H +#define ARTNET_MISC_H + +#include +#include + +extern char artnet_errstr[256]; +void artnet_error(const char *fmt, ...); +int32_t artnet_misc_nbytes_to_32(uint8_t bytes[4]); +void artnet_misc_int_to_bytes(int data, uint8_t *bytes); + +// check if the node is null and return an error +#define check_nullnode(node) if (node == NULL) { \ + artnet_error("%s : argument 1 (artnet_node) was null" , __FUNCTION__ ); \ + return ARTNET_EARG; \ +} + +#define artnet_error_malloc() artnet_error("%s : malloc error %s" , __FUNCTION__, strerror(errno) ) +#define artnet_error_realloc() artnet_error("%s : realloc error %s" , __FUNCTION__, strerror(errno) ) +#define artnet_error_nullnode() artnet_error("%s : argument 1 (artnet_node) was null" , __FUNCTION__ ) + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/network.c b/open-lighting-architecture/libartnet-1.1.0/artnet/network.c new file mode 100644 index 0000000..ea6d83b --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/network.c @@ -0,0 +1,742 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * network.c + * Network code for libartnet + * Copyright (C) 2004-2007 Simon Newton + * + */ + +#include + +#ifndef WIN32 +#include // socket before net/if.h for mac +#include +#include +#else +typedef int socklen_t; +#include +#include +#include +#endif + +#include + +#include "private.h" + +#ifdef HAVE_GETIFADDRS + #ifdef HAVE_LINUX_IF_PACKET_H + #define USE_GETIFADDRS + #endif +#endif + +#ifdef USE_GETIFADDRS + #include + #include // required by if_packet + #include +#endif + + +enum { INITIAL_IFACE_COUNT = 10 }; +enum { IFACE_COUNT_INC = 5 }; +enum { IFNAME_SIZE = 32 }; // 32 sounds a reasonable size + +typedef struct iface_s { + struct sockaddr_in ip_addr; + struct sockaddr_in bcast_addr; + int8_t hw_addr[ARTNET_MAC_SIZE]; + char if_name[IFNAME_SIZE]; + struct iface_s *next; +} iface_t; + +unsigned long LOOPBACK_IP = 0x7F000001; + + +/* + * Free memory used by the iface's list + * @param head a pointer to the head of the list + */ +static void free_ifaces(iface_t *head) { + iface_t *ift, *ift_next; + + for (ift = head; ift != NULL; ift = ift_next) { + ift_next = ift->next; + free(ift); + } +} + + +/* + * Add a new interface to an interface list + * @param head pointer to the head of the list + * @param tail pointer to the end of the list + * @return a new iface_t or void + */ +static iface_t *new_iface(iface_t **head, iface_t **tail) { + iface_t *iface = (iface_t*) calloc(1, sizeof(iface_t)); + + if (!iface) { + artnet_error("%s: calloc error %s" , __FUNCTION__, strerror(errno)); + return NULL; + } + memset(iface, 0, sizeof(iface_t)); + + if (!*head) { + *head = *tail = iface; + } else { + (*tail)->next = iface; + *tail = iface; + } + return iface; +} + + +#ifdef WIN32 + +/* + * Set if_head to point to a list of iface_t structures which represent the + * interfaces on this machine + * @param ift_head the address of the pointer to the head of the list + */ +static int get_ifaces(iface_t **if_head) { + iface_t *if_tail, *iface; + PIP_ADAPTER_INFO pAdapter = NULL; + PIP_ADAPTER_INFO pAdapterInfo; + IP_ADDR_STRING *ipAddress; + ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO); + unsigned long net, mask; + if_tail = NULL; + + while (1) { + pAdapterInfo = (IP_ADAPTER_INFO*) malloc(ulOutBufLen); + if (!pAdapterInfo) { + artnet_error("Error allocating memory needed for GetAdaptersinfo"); + return ARTNET_EMEM; + } + + DWORD status = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen); + if (status == NO_ERROR) + break; + + free(pAdapterInfo); + if (status != ERROR_BUFFER_OVERFLOW) { + printf("GetAdaptersInfo failed with error: %d\n", (int) status); + return ARTNET_ENET; + } + } + + for (pAdapter = pAdapterInfo; + pAdapter && pAdapter < pAdapterInfo + ulOutBufLen; + pAdapter = pAdapter->Next) { + + if(pAdapter->Type != MIB_IF_TYPE_ETHERNET) + continue; + + for (ipAddress = &pAdapter->IpAddressList; ipAddress; + ipAddress = ipAddress->Next) { + + net = inet_addr(ipAddress->IpAddress.String); + if (net) { + // Windows doesn't seem to have the notion of an interface being 'up' + // so we check if this interface has an address assigned. + iface = new_iface(if_head, &if_tail); + if (!iface) + continue; + + mask = inet_addr(ipAddress->IpMask.String); + strncpy(iface->if_name, pAdapter->AdapterName, IFNAME_SIZE); + memcpy(iface->hw_addr, pAdapter->Address, ARTNET_MAC_SIZE); + iface->ip_addr.sin_addr.s_addr = net; + iface->bcast_addr.sin_addr.s_addr = ( + (net & mask) | (0xFFFFFFFF ^ mask)); + } + } + } + + free(pAdapterInfo); + return (ARTNET_EOK); +} + +# else // not WIN32 + +#ifdef USE_GETIFADDRS + +/* + * Check if we are interested in this interface + * @param ifa a pointer to a ifaddr struct + */ +static void add_iface_if_needed(iface_t **head, iface_t **tail, + struct ifaddrs *ifa) { + + // skip down, loopback and non inet interfaces + if (!ifa || !ifa->ifa_addr) return; + if (!(ifa->ifa_flags & IFF_UP)) return; + if (ifa->ifa_flags & IFF_LOOPBACK) return; + if (ifa->ifa_addr->sa_family != AF_INET) return; + + iface_t *iface = new_iface(head, tail); + struct sockaddr_in *sin = (struct sockaddr_in*) ifa->ifa_addr; + iface->ip_addr.sin_addr = sin->sin_addr; + strncpy(iface->if_name, ifa->ifa_name, IFNAME_SIZE - 1); + + if (ifa->ifa_flags & IFF_BROADCAST) { + sin = (struct sockaddr_in *) ifa->ifa_broadaddr; + iface->bcast_addr.sin_addr = sin->sin_addr; + } +} + + +/* + * Set if_head to point to a list of iface_t structures which represent the + * interfaces on this machine + * @param ift_head the address of the pointer to the head of the list + */ +static int get_ifaces(iface_t **if_head) { + struct ifaddrs *ifa_list, *ifa_iter; + iface_t *if_tail, *if_iter; + struct sockaddr_ll *sll; + char *if_name, *cptr; + *if_head = if_tail = NULL; + + if (getifaddrs(&ifa_list) != 0) { + artnet_error("Error getting interfaces: %s", strerror(errno)); + return ARTNET_ENET; + } + + for (ifa_iter = ifa_list; ifa_iter; ifa_iter = ifa_iter->ifa_next) + add_iface_if_needed(if_head, &if_tail, ifa_iter); + + // Match up the interfaces with the corrosponding AF_PACKET interface + // to fetch the hw addresses + // + // TODO: Will probably not work on OS X, it should + // return AF_LINK -type sockaddr + for (if_iter = *if_head; if_iter; if_iter = if_iter->next) { + if_name = strdup(if_iter->if_name); + + // if this is an alias, get mac of real interface + if ((cptr = strchr(if_name, ':'))) + *cptr = 0; + + // Find corresponding iface_t structure + for (ifa_iter = ifa_list; ifa_iter; ifa_iter = ifa_iter->ifa_next) { + if ((!ifa_iter->ifa_addr) || ifa_iter->ifa_addr->sa_family != AF_PACKET) + continue; + + if (strncmp(if_name, ifa_iter->ifa_name, IFNAME_SIZE) == 0) { + // Found matching hw-address + sll = (struct sockaddr_ll*) ifa_iter->ifa_addr; + memcpy(if_iter->hw_addr, sll->sll_addr, ARTNET_MAC_SIZE); + break; + } + } + free(if_name); + } + freeifaddrs(ifa_list); + return 0; +} + +#else // no GETIFADDRS + +/* + * Set if_head to point to a list of iface_t structures which represent the + * interfaces on this machine + * @param ift_head the address of the pointer to the head of the list + */ +static int get_ifaces(iface_t **if_head) { + struct ifconf ifc; + struct ifreq *ifr, ifrcopy; + struct sockaddr_in *sin; + int len, lastlen, flags; + char *buf, *ptr; + iface_t *if_tail, *iface; + int ret = ARTNET_EOK; + int sd; + + *if_head = if_tail = NULL; + + // create socket to get iface config + sd = socket(PF_INET, SOCK_DGRAM, 0); + + if (sd < 0) { + artnet_error("%s : Could not create socket %s", __FUNCTION__, strerror(errno)); + ret = ARTNET_ENET; + goto e_return; + } + + // first use ioctl to get a listing of interfaces + lastlen = 0; + len = INITIAL_IFACE_COUNT * sizeof(struct ifreq); + + for (;;) { + buf = malloc(len); + + if (buf == NULL) { + artnet_error_malloc(); + ret = ARTNET_EMEM; + goto e_free; + } + + ifc.ifc_len = len; + ifc.ifc_buf = buf; + if (ioctl(sd, SIOCGIFCONF, &ifc) < 0) { + if (errno != EINVAL || lastlen != 0) { + artnet_error("%s : ioctl error %s", __FUNCTION__, strerror(errno)); + ret = ARTNET_ENET; + goto e_free; + } + } else { + if (ifc.ifc_len == lastlen) + break; + lastlen = ifc.ifc_len; + } + len += IFACE_COUNT_INC * sizeof(struct ifreq); + free(buf); + } + + // loop through each iface + for (ptr = buf; ptr < buf + ifc.ifc_len;) { + ifr = (struct ifreq*) ptr; + + // work out length here +#ifdef HAVE_SOCKADDR_SA_LEN + len = max(sizeof(struct sockaddr), ifr->ifr_addr.sa_len); +#else + switch (ifr->ifr_addr.sa_family) { +#ifdef IPV6 + case AF_INET6: + len = sizeof(struct sockaddr_in6); + break; +#endif + case AF_INET: + default: + len = sizeof(SA); + break; + } +#endif + + ptr += sizeof(ifr->ifr_name) + len; + + // look for AF_INET interfaces + if (ifr->ifr_addr.sa_family == AF_INET) { + ifrcopy = *ifr; + if (ioctl(sd, SIOCGIFFLAGS, &ifrcopy) < 0) { + artnet_error("%s : ioctl error %s" , __FUNCTION__, strerror(errno)); + ret = ARTNET_ENET; + goto e_free_list; + } + + flags = ifrcopy.ifr_flags; + if ((flags & IFF_UP) == 0) + continue; //skip down interfaces + + if ((flags & IFF_LOOPBACK)) + continue; //skip lookback + + iface = new_iface(if_head, &if_tail); + if (!iface) + goto e_free_list; + + sin = (struct sockaddr_in *) &ifr->ifr_addr; + iface->ip_addr.sin_addr = sin->sin_addr; + + // fetch bcast address +#ifdef SIOCGIFBRDADDR + if (flags & IFF_BROADCAST) { + if (ioctl(sd, SIOCGIFBRDADDR, &ifrcopy) < 0) { + artnet_error("%s : ioctl error %s" , __FUNCTION__, strerror(errno)); + ret = ARTNET_ENET; + goto e_free_list; + } + + sin = (struct sockaddr_in *) &ifrcopy.ifr_broadaddr; + iface->bcast_addr.sin_addr = sin->sin_addr; + } +#endif + // fetch hardware address +#ifdef SIOCGIFHWADDR + if (flags & SIOCGIFHWADDR) { + if (ioctl(sd, SIOCGIFHWADDR, &ifrcopy) < 0) { + artnet_error("%s : ioctl error %s", __FUNCTION__, strerror(errno)); + ret = ARTNET_ENET; + goto e_free_list; + } + memcpy(&iface->hw_addr, ifrcopy.ifr_hwaddr.sa_data, ARTNET_MAC_SIZE); + } +#endif + + /* ok, if that all failed we should prob try and use sysctl to work out the bcast + * and hware addresses + * i'll leave that for another day + */ + } + } + free(buf); + return ARTNET_EOK; + +e_free_list: + free_ifaces(*if_head); +e_free: + free(buf); + close(sd); +e_return: + return ret; +} + +#endif // GETIFADDRS +#endif // not WIN32 + + +/* + * Scan for interfaces, and work out which one the user wanted to use. + */ +int artnet_net_init(node n, const char *preferred_ip) { + iface_t *ift, *ift_head = NULL; + struct in_addr wanted_ip; + + int found = FALSE; + int i; + int ret = ARTNET_EOK; + + if ((ret = get_ifaces(&ift_head))) + goto e_return; + + if (n->state.verbose) { + printf("#### INTERFACES FOUND ####\n"); + for (ift = ift_head; ift != NULL; ift = ift->next) { + printf("IP: %s\n", inet_ntoa(ift->ip_addr.sin_addr)); + printf(" bcast: %s\n" , inet_ntoa(ift->bcast_addr.sin_addr)); + printf(" hwaddr: "); + for (i = 0; i < ARTNET_MAC_SIZE; i++) { + if (i) + printf(":"); + printf("%02x", (uint8_t) ift->hw_addr[i]); + } + printf("\n"); + } + printf("#########################\n"); + } + + if (preferred_ip) { + // search through list of interfaces for one with the correct address + ret = artnet_net_inet_aton(preferred_ip, &wanted_ip); + if (ret) + goto e_cleanup; + + for (ift = ift_head; ift != NULL; ift = ift->next) { + if (ift->ip_addr.sin_addr.s_addr == wanted_ip.s_addr) { + found = TRUE; + n->state.ip_addr = ift->ip_addr.sin_addr; + n->state.bcast_addr = ift->bcast_addr.sin_addr; + memcpy(&n->state.hw_addr, &ift->hw_addr, ARTNET_MAC_SIZE); + break; + } + } + if (!found) { + artnet_error("Cannot find ip %s", preferred_ip); + ret = ARTNET_ENET; + goto e_cleanup; + } + } else { + if (ift_head) { + // pick first address + // copy ip address, bcast address and hardware address + n->state.ip_addr = ift_head->ip_addr.sin_addr; + n->state.bcast_addr = ift_head->bcast_addr.sin_addr; + memcpy(&n->state.hw_addr, &ift_head->hw_addr, ARTNET_MAC_SIZE); + } else { + artnet_error("No interfaces found!"); + ret = ARTNET_ENET; + } + } + +e_cleanup: + free_ifaces(ift_head); +e_return : + return ret; +} + + +/* + * Start listening on the socket + */ +int artnet_net_start(node n) { + int sock; + struct sockaddr_in servAddr; + int true_flag = TRUE; + node tmp; + + // only attempt to bind if we are the group master + if (n->peering.master == TRUE) { + +#ifdef WIN32 + // check winsock version + WSADATA wsaData; + WORD wVersionRequested = MAKEWORD(2, 2); + if (WSAStartup(wVersionRequested, &wsaData) != 0) + return (-1); + if (wsaData.wVersion != wVersionRequested) + return (-2); +#endif + + // create socket + sock = socket(PF_INET, SOCK_DGRAM, 0); + + if (sock < 0) { + artnet_error("Could not create socket %s", artnet_net_last_error()); + return ARTNET_ENET; + } + + memset(&servAddr, 0x00, sizeof(servAddr)); + servAddr.sin_family = AF_INET; + servAddr.sin_port = htons(ARTNET_PORT); + servAddr.sin_addr.s_addr = htonl(INADDR_ANY); + + if (n->state.verbose) + printf("Binding to %s \n", inet_ntoa(servAddr.sin_addr)); + + // bind sockets + if (bind(sock, (SA *) &servAddr, sizeof(servAddr)) == -1) { + artnet_error("Failed to bind to socket %s", artnet_net_last_error()); + artnet_net_close(sock); + return ARTNET_ENET; + } + + // allow bcasting + if (setsockopt(sock, + SOL_SOCKET, + SO_BROADCAST, + (char*) &true_flag, // char* for win32 + sizeof(int)) == -1) { + artnet_error("Failed to bind to socket %s", artnet_net_last_error()); + artnet_net_close(sock); + return ARTNET_ENET; + } + +#ifdef WIN32 + // ### LH - 22.08.2008 + // make it possible to reuse port, if SO_REUSEADDR + // exists on operating system + + // NEVER USE SO_EXCLUSIVEADDRUSE, as that freezes the application + // on WinXP, if port is in use ! + if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &true_flag, + sizeof(true_flag)) < 0) { + + artnet_error("Set reuse failed", artnet_net_last_error()); + artnet_net_close(sock); + return ARTNET_ENET; + } + + u_long true = 1; + if (SOCKET_ERROR == ioctlsocket(sock, FIONBIO, &true)) { + + artnet_error("ioctlsocket", artnet_net_last_error()); + artnet_net_close(sock); + return ARTNET_ENET; + } +#endif + + n->sd = sock; + // Propagate the socket to all our peers + for (tmp = n->peering.peer; tmp && tmp != n; tmp = tmp->peering.peer) + tmp->sd = sock; + } + return ARTNET_EOK; +} + + +/* + * Receive a packet. + */ +int artnet_net_recv(node n, artnet_packet p, int delay) { + ssize_t len; + struct sockaddr_in cliAddr; + socklen_t cliLen = sizeof(cliAddr); + fd_set rset; + struct timeval tv; + int maxfdp1 = n->sd + 1; + + FD_ZERO(&rset); + FD_SET((unsigned int) n->sd, &rset); + + tv.tv_usec = 0; + tv.tv_sec = delay; + p->length = 0; + + switch (select(maxfdp1, &rset, NULL, NULL, &tv)) { + case 0: + // timeout + return RECV_NO_DATA; + break; + case -1: + if ( errno != EINTR) { + artnet_error("Select error %s", artnet_net_last_error()); + return ARTNET_ENET; + } + return ARTNET_EOK; + break; + default: + break; + } + + // need a check here for the amount of data read + // should prob allow an extra byte after data, and pass the size as sizeof(Data) +1 + // then check the size read and if equal to size(data)+1 we have an error + len = recvfrom(n->sd, + (char*) &(p->data), // char* for win32 + sizeof(p->data), + 0, + (SA*) &cliAddr, + &cliLen); + if (len < 0) { + artnet_error("Recvfrom error %s", artnet_net_last_error()); + return ARTNET_ENET; + } + + if (cliAddr.sin_addr.s_addr == n->state.ip_addr.s_addr || + ntohl(cliAddr.sin_addr.s_addr) == LOOPBACK_IP) { + p->length = 0; + return ARTNET_EOK; + } + + p->length = len; + memcpy(&(p->from), &cliAddr.sin_addr, sizeof(struct in_addr)); + // should set to in here if we need it + return ARTNET_EOK; +} + + +/* + * Send a packet. + */ +int artnet_net_send(node n, artnet_packet p) { + struct sockaddr_in addr; + int ret; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + addr.sin_family = AF_INET; + addr.sin_port = htons(ARTNET_PORT); + addr.sin_addr = p->to; + p->from = n->state.ip_addr; + + if (n->state.verbose) + printf("sending to %s\n" , inet_ntoa(addr.sin_addr)); + + ret = sendto(n->sd, + (char*) &p->data, // char* required for win32 + p->length, + 0, + (SA*) &addr, + sizeof(addr)); + if (ret == -1) { + artnet_error("Sendto failed: %s", artnet_net_last_error()); + n->state.report_code = ARTNET_RCUDPFAIL; + return ARTNET_ENET; + + } else if (p->length != ret) { + artnet_error("failed to send full datagram"); + n->state.report_code = ARTNET_RCSOCKETWR1; + return ARTNET_ENET; + } + + if (n->callbacks.send.fh) { + get_type(p); + n->callbacks.send.fh(n, p, n->callbacks.send.data); + } + return ARTNET_EOK; +} + + +/* +int artnet_net_reprogram(node n) { + iface_t *ift_head, *ift; + int i; + + ift_head = get_ifaces(n->sd[0]); + + for (ift = ift_head;ift != NULL; ift = ift->next ) { + printf("IP: %s\n", inet_ntoa(ift->ip_addr.sin_addr) ); + printf(" bcast: %s\n" , inet_ntoa(ift->bcast_addr.sin_addr) ); + printf(" hwaddr: "); + for(i = 0; i < 6; i++ ) { + printf("%hhx:", ift->hw_addr[i] ); + } + printf("\n"); + } + + free_ifaces(ift_head); + +}*/ + + +int artnet_net_set_fdset(node n, fd_set *fdset) { + FD_SET((unsigned int) n->sd, fdset); + return ARTNET_EOK; +} + + +/* + * Close a socket + */ +int artnet_net_close(int sock) { +#ifdef WIN32 + shutdown(sock, SD_BOTH); + closesocket(sock); + //WSACancelBlockingCall(); + WSACleanup(); +#else + if (close(sock)) { + artnet_error(artnet_net_last_error()); + return ARTNET_ENET; + } +#endif + return ARTNET_EOK; +} + + +/* + * Convert a string to an in_addr + */ +int artnet_net_inet_aton(const char *ip_address, struct in_addr *address) { +#ifdef HAVE_INET_ATON + if (!inet_aton(ip_address, address)) { +#else + in_addr_t *addr = (in_addr_t*) address; + if ((*addr = inet_addr(ip_address)) == INADDR_NONE) { +#endif + artnet_error("IP conversion from %s failed", ip_address); + return ARTNET_EARG; + } + return ARTNET_EOK; +} + + +/* + * + */ +const char *artnet_net_last_error() { +#ifdef WIN32 + static char error_str[10]; + int error = WSAGetLastError(); + snprintf(error_str, sizeof(error_str), "%d", error); + return error_str; +#else + return strerror(errno); +#endif +} + diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/packets.h b/open-lighting-architecture/libartnet-1.1.0/artnet/packets.h new file mode 100644 index 0000000..e5a6d62 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/packets.h @@ -0,0 +1,390 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * packets.h + * Datagram definitions for libartnet + * Copyright (C) 2004-2005 Simon Newton + */ + + +#ifndef ARTNET_PACKETS_H +#define ARTNET_PACKETS_H + +#include +#include + +#ifndef WIN32 +#include +#endif + +#include + +enum { ARTNET_MAX_RDM_ADCOUNT = 32 }; + +enum { ARTNET_MAX_UID_COUNT = 200 }; + +// according to the rdm spec, this should be 278 bytes +// we'll set to 512 here, the firmware datagram is still bigger +enum { ARTNET_MAX_RDM_DATA = 512 }; + +enum { ARTNET_FIRMWARE_SIZE = 512 }; + +enum artnet_packet_type_e { + ARTNET_POLL = 0x2000, + ARTNET_REPLY = 0x2100, + ARTNET_DMX = 0x5000, + ARTNET_ADDRESS = 0x6000, + ARTNET_INPUT = 0x7000, + ARTNET_TODREQUEST = 0x8000, + ARTNET_TODDATA = 0x8100, + ARTNET_TODCONTROL = 0x8200, + ARTNET_RDM = 0x8300, + ARTNET_VIDEOSTEUP = 0xa010, + ARTNET_VIDEOPALETTE = 0xa020, + ARTNET_VIDEODATA = 0xa040, + ARTNET_MACMASTER = 0xf000, + ARTNET_MACSLAVE = 0xf100, + ARTNET_FIRMWAREMASTER = 0xf200, + ARTNET_FIRMWAREREPLY = 0xf300, + ARTNET_IPPROG = 0xf800, + ARTNET_IPREPLY = 0xf900, + ARTNET_MEDIA = 0x9000, + ARTNET_MEDIAPATCH = 0x9200, + ARTNET_MEDIACONTROLREPLY = 0x9300 +}__attribute__((packed)); + +typedef enum artnet_packet_type_e artnet_packet_type_t; + + +struct artnet_poll_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t ttm; + uint8_t pad; +} __attribute__((packed)); + +typedef struct artnet_poll_s artnet_poll_t; + +struct artnet_reply_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t ip[4]; + uint16_t port; + uint8_t verH; + uint8_t ver; + uint8_t subH; + uint8_t sub; + uint8_t oemH; + uint8_t oem; + uint8_t ubea; + uint8_t status; + uint8_t etsaman[2]; + uint8_t shortname[ARTNET_SHORT_NAME_LENGTH]; + uint8_t longname[ARTNET_LONG_NAME_LENGTH]; + uint8_t nodereport[ARTNET_REPORT_LENGTH]; + uint8_t numbportsH; + uint8_t numbports; + uint8_t porttypes[ARTNET_MAX_PORTS]; + uint8_t goodinput[ARTNET_MAX_PORTS]; + uint8_t goodoutput[ARTNET_MAX_PORTS]; + uint8_t swin[ARTNET_MAX_PORTS]; + uint8_t swout[ARTNET_MAX_PORTS]; + uint8_t swvideo; + uint8_t swmacro; + uint8_t swremote; + uint8_t sp1; + uint8_t sp2; + uint8_t sp3; + uint8_t style; + uint8_t mac[ARTNET_MAC_SIZE]; + uint8_t filler[32]; +} __attribute__((packed)); + +typedef struct artnet_reply_s artnet_reply_t; + +struct artnet_ipprog_s { + uint8_t id[8]; + uint16_t OpCode; + uint8_t ProVerH; + uint8_t ProVer; + uint8_t Filler1; + uint8_t Filler2; + uint8_t Command; + uint8_t Filler4; + uint8_t ProgIpHi; + uint8_t ProgIp2; + uint8_t ProgIp1; + uint8_t ProgIpLo; + uint8_t ProgSmHi; + uint8_t ProgSm2; + uint8_t ProgSm1; + uint8_t ProgSmLo; + uint8_t ProgPortHi; + uint8_t ProgPortLo; + uint8_t Spare1; + uint8_t Spare2; + uint8_t Spare3; + uint8_t Spare4; + uint8_t Spare5; + uint8_t Spare6; + uint8_t Spare7; + uint8_t Spare8; + +} __attribute__((packed)); + +typedef struct artnet_ipprog_s artnet_ipprog_t; + +struct artnet_ipprog_reply_s { + uint8_t id[8]; + uint16_t OpCode; + uint8_t ProVerH; + uint8_t ProVer; + uint8_t Filler1; + uint8_t Filler2; + uint8_t Filler3; + uint8_t Filler4; + uint8_t ProgIpHi; + uint8_t ProgIp2; + uint8_t ProgIp1; + uint8_t ProgIpLo; + uint8_t ProgSmHi; + uint8_t ProgSm2; + uint8_t ProgSm1; + uint8_t ProgSmLo; + uint8_t ProgPortHi; + uint8_t ProgPortLo; + uint8_t Spare1; + uint8_t Spare2; + uint8_t Spare3; + uint8_t Spare4; + uint8_t Spare5; + uint8_t Spare6; + uint8_t Spare7; + uint8_t Spare8; +} __attribute__((packed)); + +typedef struct artnet_ipprog_reply_s artnet_ipprog_reply_t; + + +struct artnet_address_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t shortname[ARTNET_SHORT_NAME_LENGTH]; + uint8_t longname[ARTNET_LONG_NAME_LENGTH]; + uint8_t swin[ARTNET_MAX_PORTS]; + uint8_t swout[ARTNET_MAX_PORTS]; + uint8_t subnet; + uint8_t swvideo; + uint8_t command; +} __attribute__((packed)); + +typedef struct artnet_address_s artnet_address_t; + + +struct artnet_dmx_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t sequence; + uint8_t physical; + uint16_t universe; + uint8_t lengthHi; + uint8_t length; + uint8_t data[ARTNET_DMX_LENGTH]; +} __attribute__((packed)); + +typedef struct artnet_dmx_s artnet_dmx_t; + + +struct artnet_input_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t numbportsH; + uint8_t numbports; + uint8_t input[ARTNET_MAX_PORTS]; +} __attribute__((packed)); + +typedef struct artnet_input_s artnet_input_t; + + +struct artnet_todrequest_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t command; + uint8_t adCount; + uint8_t address[ARTNET_MAX_RDM_ADCOUNT]; +} __attribute__((packed)); + +typedef struct artnet_todrequest_s artnet_todrequest_t; + + + +struct artnet_toddata_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t rdmVer; + uint8_t port; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t cmdRes; + uint8_t address; + uint8_t uidTotalHi; + uint8_t uidTotal; + uint8_t blockCount; + uint8_t uidCount; + uint8_t tod[ARTNET_MAX_UID_COUNT][ARTNET_RDM_UID_WIDTH]; +} __attribute__((packed)); + +typedef struct artnet_toddata_s artnet_toddata_t; + +struct artnet_firmware_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t type; + uint8_t blockId; + uint8_t length[4]; + uint8_t spare[20]; + uint16_t data[ARTNET_FIRMWARE_SIZE ]; +} __attribute__((packed)); + +typedef struct artnet_firmware_s artnet_firmware_t; + +struct artnet_todcontrol_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t cmd; + uint8_t address; +} __attribute__((packed)); + + +typedef struct artnet_todcontrol_s artnet_todcontrol_t; + + + +struct artnet_rdm_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t rdmVer; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t cmd; + uint8_t address; + uint8_t data[ARTNET_MAX_RDM_DATA]; +} __attribute__((packed)); + + +typedef struct artnet_rdm_s artnet_rdm_t; + + +struct artnet_firmware_reply_s { + uint8_t id[8]; + uint16_t opCode; + uint8_t verH; + uint8_t ver; + uint8_t filler1; + uint8_t filler2; + uint8_t type; + uint8_t spare[21]; +} __attribute__((packed)); + +typedef struct artnet_firmware_reply_s artnet_firmware_reply_t; + + + +// union of all artnet packets +typedef union { + artnet_poll_t ap; + artnet_reply_t ar; + artnet_ipprog_t aip; + artnet_address_t addr; + artnet_dmx_t admx; + artnet_input_t ainput; + artnet_todrequest_t todreq; + artnet_toddata_t toddata; + artnet_firmware_t firmware; + artnet_firmware_reply_t firmwarer; + artnet_todcontrol_t todcontrol; + artnet_rdm_t rdm; +} artnet_packet_union_t; + + +// a packet, containing data, length, type and a src/dst address +typedef struct { + int length; + struct in_addr from; + struct in_addr to; + artnet_packet_type_t type; + artnet_packet_union_t data; +} artnet_packet_t; + +typedef artnet_packet_t *artnet_packet; + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/private.h b/open-lighting-architecture/libartnet-1.1.0/artnet/private.h new file mode 100644 index 0000000..67af205 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/private.h @@ -0,0 +1,504 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * private.h + * Private definitions, data structures, macros and functions for libartnet + * Copyright (C) 2004-2007 Simon Newton + */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifndef WIN32 +#include +#include +#include +#endif + +#include +#include +#include +#include + +#include "artnet.h" +#include "artnet/packets.h" +#include "misc.h" +#include "tod.h" + +#ifndef ARTNET_PRIVATE_H +#define ARTNET_PRIVATE_H + +// these are defined in artnet.c +extern int ARTNET_PORT; +extern char ARTNET_STRING[]; +extern int ARTNET_STRING_SIZE; +extern uint8_t ARTNET_VERSION; +extern uint8_t OEM_HI; +extern uint8_t OEM_LO; +extern char ESTA_HI; +extern char ESTA_LO; +extern uint8_t TTM_BEHAVIOUR_MASK; +extern uint8_t TTM_REPLY_MASK; +extern uint8_t PROGRAM_NO_CHANGE; +extern uint8_t PROGRAM_DEFAULTS; +extern uint8_t PROGRAM_CHANGE_MASK; +extern uint8_t HIGH_NIBBLE; +extern uint8_t LOW_NIBBLE; +extern uint8_t STATUS_PROG_AUTH_MASK; +extern uint8_t PORT_STATUS_LPT_MODE; +extern uint8_t PORT_STATUS_SHORT; +extern uint8_t PORT_STATUS_ERROR; +extern uint8_t PORT_STATUS_DISABLED_MASK; +extern uint8_t ORT_STATUS_MERGE; +extern uint8_t PORT_STATUS_DMX_TEXT; +extern uint8_t PORT_STATUS_DMX_SIP; +extern uint8_t PORT_STATUS_DMX_TEST; +extern uint8_t PORT_STATUS_ACT_MASK; +extern uint8_t PORT_DISABLE_MASK; +extern uint8_t TOD_RESPONSE_FULL; +extern uint8_t TOD_RESPONSE_NAK; +extern uint8_t MIN_PACKET_SIZE; +extern uint8_t MERGE_TIMEOUT_SECONDS; +extern uint8_t FIRMWARE_TIMEOUT_SECONDS; +extern uint8_t RECV_NO_DATA; + +#ifndef TRUE +extern int TRUE; +extern int FALSE; +#endif + +extern uint16_t LOW_BYTE; +extern uint16_t HIGH_BYTE; + +// non artnet specific +#define SA struct sockaddr +#define SI struct in_addr + +#ifndef min +#define min(a, b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef max +#define max(a, b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef INVALID_SOCKET +#define INVALID_SOCKET -1 +#endif + +// byte ordering macros +#define bswap_16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) + +// htols : convert short from host to little endian order +#ifdef WIN32 +# define htols(x) (x) +#else +# ifdef HAVE_ENDIAN_H +# if BYTE_ORDER == __BIG_ENDIAN +# define htols(x) bswap_16 (x) +# else +# define htols(x) (x) +# endif +# else +# if BYTE_ORDER == BIG_ENDIAN +# define htols(x) bswap_16 (x) +# else +# define htols(x) (x) +# endif +# endif +#endif + +// convert from shorts to bytes and back again +#define short_get_high_byte(x) ((HIGH_BYTE & x) >> 8) +#define short_get_low_byte(x) (LOW_BYTE & x) + +#define bytes_to_short(h,l) ( ((h << 8) & 0xff00) | (l & 0x00FF) ); + +/* + * These are enums for fields in packets + * Ordered by packets they appear in. Some of these appear in the public header file + * artnet.h if they have to be used by the user. + * + * They are all in the form artnet_xxx_code in case they have to be made public some day + * + */ + +// ArtPollReply +//----------------------------------------------------------------------------- + +// the node report codes +typedef enum { + ARTNET_RCDEBUG, + ARTNET_RCPOWEROK, + ARTNET_RCPOWERFAIL, + ARTNET_RCSOCKETWR1, + ARTNET_RCPARSEFAIL, + ARTNET_RCUDPFAIL, + ARTNET_RCSHNAMEOK, + ARTNET_RCLONAMEOK, + ARTNET_RCDMXERROR, + ARTNET_RCDMXUDPFULL, + ARTNET_RCDMXRXFULL, + ARTNET_RCSWITCHERR, + ARTNET_RCCONFIGERR, + ARTNET_RCDMXSHORT, + ARTNET_RCFIRMWAREFAIL, + ARTNET_RCUSERFAIL +} artnet_node_report_code; + +// these define the types of node that can exist +// note it's different from artnet_node_type +typedef enum { + STNODE = 0x00, + STSERVER = 0x01, + STMEDIA = 0x02, + STROUTE = 0x03, + STBACKUP = 0x04, + STCONFIG = 0x05 +} artnet_node_style_code; + +// artnet_port_data in artnet.h + +// ArtAddress +//----------------------------------------------------------------------------- + +// artnet_port_command_code in artnet.h + +// ArtFirmwareMaster +//----------------------------------------------------------------------------- + +// defines contents of the firmware packet +typedef enum { + ARTNET_FIRMWARE_FIRMFIRST = 0x00, + ARTNET_FIRMWARE_FIRMCONT = 0x01, + ARTNET_FIRMWARE_FIRMLAST = 0x02, + ARTNET_FIRMWARE_UBEAFIRST = 0x03, + ARTNET_FIRMWARE_UBEACONT = 0x04, + ARTNET_FIRMWARE_UBEALAST = 0x05, +} artnet_firmware_type_code; + +// ArtFirmwareReply +//----------------------------------------------------------------------------- + +// artnet_firmware_status_code in artnet.h + + + +// End packet enums +//----------------------------------------------------------------------------- + + +/* + * Data structures to manage callbacks + */ + +// packet callbacks have a function and some user data +typedef struct { + int (*fh)(artnet_node n, void *p, void *data); + void *data; +} callback_t; + +/* + * the dmx callback is triggered when a dmx packet arrives + */ +typedef struct { + int (*fh)(artnet_node n, int portid, void *data); + void *data; +} dmx_callback_t; + +/* + * firmware callback is triggered when a firmware recieve has been completed sucessfully + */ +typedef struct { + int (*fh)(artnet_node n, int ubea, uint16_t *data, int length, void *d); + void *data; +} firmware_callback_t; + +/* + * called when a node is remote programmed + */ +typedef struct { + int (*fh)(artnet_node n, void *d); + void *data; +} program_callback_t; + +/* + * called when a node receives rdm data + */ +typedef struct { + int (*fh)(artnet_node n, int address, uint8_t *rdm, int length, void *d); + void *data; +} rdm_callback_t; + + +// struct to store callbacks +typedef struct { + callback_t recv; + callback_t send; + callback_t poll; + callback_t reply; + callback_t dmx; + callback_t address; + callback_t input; + callback_t todrequest; + callback_t toddata; + callback_t todcontrol; + callback_t rdm; + callback_t ipprog; + callback_t firmware; + callback_t firmware_reply; + dmx_callback_t dmx_c; + firmware_callback_t firmware_c; + program_callback_t program_c; + rdm_callback_t rdm_c; + dmx_callback_t rdm_init_c; + dmx_callback_t rdm_tod_c; +} node_callbacks_t; + + +// End callback structures +//----------------------------------------------------------------------------- + +/* + * Begin port structures + */ + + + +// first a generic port +typedef struct { + uint8_t addr; // the port address + uint8_t default_addr; // the address set by the hardware + uint8_t net_ctl; // if the port address is under network control + uint8_t status; // status of the port + uint8_t enabled; // true if the port has had it's address set, this is internal only, + // it's not used by the ArtNet protocol, otherwise the node keeps + // picking up packets for the 0x00 port + tod_t tod; +} g_port_t; + +/** + * struct to represent an input port + * input ports need to keep track of sequence numbers + * (this doesn't seem to be used though) + */ +typedef struct { + g_port_t port; + uint8_t seq; +} input_port_t; + + +/** + * For output ports we need to track if they merge in HTP or LTP modes + */ +typedef enum { + ARTNET_MERGE_HTP, + ARTNET_MERGE_LTP +} merge_t; + +/** + * struct to represent an output port + * + * output ports can merge data from two sources in either HTP + * (highest takes precedence) or LPT (lowest takes precedence) mode + * + * we need to store: + * o The data from each source + * o The ip of the source + * o The time the data was recv'ed + * o the tod table, length and max length + */ +typedef struct { + g_port_t port; + int length; // the length of the data THAT HAS CHANGED since the last dmx packet + uint8_t enabled; // true if the port has had it's address set, this is internal only, + // it's not used by the ArtNet protocol, otherwise the node keeps + // picking up packets for the 0x00 port + uint8_t data[ARTNET_DMX_LENGTH]; // output data + merge_t merge_mode; // for merging + uint8_t dataA[ARTNET_DMX_LENGTH]; + uint8_t dataB[ARTNET_DMX_LENGTH]; + time_t timeA; + time_t timeB; + SI ipA; + SI ipB; +} output_port_t; + +// use defines to hide the inner structures +#define port_addr port.addr +#define port_default_addr port.default_addr +#define port_net_ctl port.net_ctl +#define port_status port.status +#define port_enabled port.enabled +#define port_tod port.tod + +// End port structures +//----------------------------------------------------------------------------- + + +/* + * We use a linked list to keep track of nodes on the network + * Here be the structures + */ + +/* firstly we have the potential to do a firmware transfer to any node, + * this struct keeps the information such as how much data has been transfered + * and the address of the peer. It's also used for receiving firmware + */ +typedef struct { + uint16_t *data; + int bytes_current; + int bytes_total; + struct in_addr peer; + int ubea; + time_t last_time; + int expected_block; + int (*callback)(artnet_node n, artnet_firmware_status_code code, void *d); + void *user_data; +} firmware_transfer_t; + +/* + * The node entry in the LL. It contains the public entry, as well as some stuff + * we don't want public like firmware + */ +typedef struct node_entry_private_s { + artnet_node_entry_t pub; + struct node_entry_private_s *next; + firmware_transfer_t firmware; + SI ip; // don't rely on the ip address that the node + // sends, they could be faking it. This is the ip that + // the pollreply was sent from +} node_entry_private_t; + +/** + * The node list stores a pointer to the first, last and current + * entries. + */ +typedef struct { + node_entry_private_t *first; + node_entry_private_t *current; + node_entry_private_t *last; + int length; +} node_list_t; + + +// End node list structures +//----------------------------------------------------------------------------- + + +// the status of the node +typedef enum { + ARTNET_OFF, + ARTNET_STANDBY, + ARTNET_ON +} node_status_t; + + +// struct to hold the state of the node +typedef struct { + artnet_node_type node_type; + node_status_t mode; + SI reply_addr; + SI ip_addr; + SI bcast_addr; + uint8_t hw_addr[ARTNET_MAC_SIZE]; + uint8_t default_subnet; + uint8_t subnet_net_ctl; + int send_apr_on_change; + int ar_count; + int verbose; + char short_name[ARTNET_SHORT_NAME_LENGTH]; + char long_name[ARTNET_LONG_NAME_LENGTH]; + char report[ARTNET_REPORT_LENGTH]; + uint8_t subnet; + uint8_t oem_hi; + uint8_t oem_lo; + uint8_t esta_hi; + uint8_t esta_lo; + int bcast_limit; // the number of nodes after which we change to bcast + artnet_node_report_code report_code; +} node_state_t; + + +typedef struct { + struct artnet_node_s *peer; // peer if we've joined a group + int master; +} node_peering_t; + + +/** + * The main node structure + */ +typedef struct artnet_node_s{ + int sd; // the two sockets + node_state_t state; // the state struct + node_callbacks_t callbacks; // the callbacks struct + struct ports_s { + uint8_t types[ARTNET_MAX_PORTS]; // type of port + input_port_t in[ARTNET_MAX_PORTS]; // input ports + output_port_t out[ARTNET_MAX_PORTS]; // output ports + } ports; + artnet_reply_t ar_temp; // buffered artpoll reply packet + node_list_t node_list; // node list + firmware_transfer_t firmware; // firmware details + node_peering_t peering; // peer if we've joined a group +} artnet_node_t; + + +typedef artnet_node_t *node; + +/* + * Function definitions follow + */ + +// exported from artnet.c +node_entry_private_t *find_private_entry( node n, artnet_node_entry e); +void check_timeouts(node n); +node_entry_private_t *find_entry_from_ip(node_list_t *nl, SI ip); +int artnet_nl_update(node_list_t *nl, artnet_packet reply); + + +// exported from receive.c +int handle(node n, artnet_packet p); +int16_t get_type(artnet_packet p); +void reset_firmware_upload(node n); + + +// exported from transmit.c +int artnet_tx_poll(node n, const char *ip, artnet_ttm_value_t ttm); +int artnet_tx_poll_reply(node n, int reply); +int artnet_tx_tod_data(node n, int id); +int artnet_tx_firmware_reply(node n, in_addr_t ip, artnet_firmware_status_code code); +int artnet_tx_firmware_packet(node n, firmware_transfer_t *firm ); +int artnet_tx_tod_request(node n); +int artnet_tx_tod_control(node n, uint8_t address, artnet_tod_command_code action); +int artnet_tx_rdm(node n, uint8_t address, uint8_t *data, int length); +int artnet_tx_build_art_poll_reply(node n); + + +// exported from network.c +int artnet_net_recv(node n, artnet_packet p, int block); +int artnet_net_send(node n, artnet_packet p); +int artnet_net_set_non_block(node n); +int artnet_net_init(node n, const char *ip); +int artnet_net_start(node n); +int artnet_net_close(int sock); +int artnet_net_join(node n1, node n2); +int artnet_net_set_fdset(node n, fd_set *fdset); +int artnet_net_inet_aton(const char *ip_address, struct in_addr *address); +const char *artnet_net_last_error(); + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/receive.c b/open-lighting-architecture/libartnet-1.1.0/artnet/receive.c new file mode 100644 index 0000000..75c00b7 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/receive.c @@ -0,0 +1,912 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * receive.c + * Handles the receiving of datagrams + * Copyright (C) 2004-2007 Simon Newton + */ + +#include "private.h" + +uint8_t _make_addr(uint8_t subnet, uint8_t addr); +void check_merge_timeouts(node n, int port); +void merge(node n, int port, int length, uint8_t *latest); + +/* + * Checks if the callback is defined, if so call it passing the packet and + * the user supplied data. + * If the callbacks return a non-zero result, further processing is canceled. + */ +int check_callback(node n, artnet_packet p, callback_t callback) { + if (callback.fh != NULL) + return callback.fh(n, p, callback.data); + + return 0; +} + + +/* + * Handle an artpoll packet + */ +int handle_poll(node n, artnet_packet p) { + // run callback if defined + if (check_callback(n, p, n->callbacks.poll)) + return ARTNET_EOK; + + if (n->state.node_type != ARTNET_RAW) { + //if we're told to unicast further replies + if (p->data.ap.ttm & TTM_REPLY_MASK) { + n->state.reply_addr = p->from; + } else { + n->state.reply_addr.s_addr = n->state.bcast_addr.s_addr; + } + + // if we are told to send updates when node conditions change + if (p->data.ap.ttm & TTM_BEHAVIOUR_MASK) { + n->state.send_apr_on_change = TRUE; + } else { + n->state.send_apr_on_change = FALSE; + } + + return artnet_tx_poll_reply(n, TRUE); + + } + return ARTNET_EOK; +} + +/* + * handle an art poll reply + */ +void handle_reply(node n, artnet_packet p) { + // update the node list + artnet_nl_update(&n->node_list, p); + + // run callback if defined + if (check_callback(n, p, n->callbacks.reply)) + return; +} + + +/* + * handle a art dmx packet + */ +void handle_dmx(node n, artnet_packet p) { + int i, data_length; + output_port_t *port; + in_addr_t ipA, ipB; + + // run callback if defined + if (check_callback(n, p, n->callbacks.dmx)) + return; + + data_length = (int) bytes_to_short(p->data.admx.lengthHi, + p->data.admx.length); + data_length = min(data_length, ARTNET_DMX_LENGTH); + + // find matching output ports + for (i = 0; i < ARTNET_MAX_PORTS; i++) { + // if the addr matches and this port is enabled + if (p->data.admx.universe == n->ports.out[i].port_addr && + n->ports.out[i].port_enabled) { + + port = &n->ports.out[i]; + ipA = port->ipA.s_addr; + ipB = port->ipB.s_addr; + + // ok packet matches this port + n->ports.out[i].port_status = n->ports.out[i].port_status | PORT_STATUS_ACT_MASK; + + /** + * 9 cases for merging depending on what the stored ips are. + * here's the truth table + * + * + * \ ipA # # # # + * ------ # empty # # # + * ipB \ # ( 0 ) # p.from # ! p.from # + * ################################################## + * # new node # continued # start # + * empty # first # trans- # merge # + * (0) # packet # mission # # + * ################################################## + * #continued # # cont # + * p.from # trans- # invalid! # merge # + * # mission # # # + * ################################################## + * # start # cont # # + * ! p.from # merge # merge # discard # + * # # # # + * ################################################## + * + * The merge exits when: + * o ACCancel command is received in an ArtAddress packet + * (this is done in handle_address ) + * o no data is recv'ed from one source in 10 seconds + * + */ + + check_merge_timeouts(n,i); + + if (ipA == 0 && ipB == 0) { + // first packet recv on this port + port->ipA.s_addr = p->from.s_addr; + port->timeA = time(NULL); + + memcpy(&port->dataA, &p->data.admx.data, data_length); + port->length = data_length; + memcpy(&port->data, &p->data.admx.data, data_length); + } + else if (ipA == p->from.s_addr && ipB == 0) { + //continued transmission from the same ip (source A) + + port->timeA = time(NULL); + memcpy(&port->dataA, &p->data.admx.data, data_length); + port->length = data_length; + memcpy(&port->data, &p->data.admx.data, data_length); + } + else if (ipA == 0 && ipB == p->from.s_addr) { + //continued transmission from the same ip (source B) + + port->timeB = time(NULL); + memcpy(&port->dataB, &p->data.admx.data, data_length); + port->length = data_length; + memcpy(&port->data, &p->data.admx.data, data_length); + } + else if (ipA != p->from.s_addr && ipB == 0) { + // new source, start the merge + port->ipB.s_addr = p->from.s_addr; + port->timeB = time(NULL); + memcpy(&port->dataB, &p->data.admx.data,data_length); + port->length = data_length; + + // merge, newest data is port B + merge(n,i,data_length, port->dataB); + + // send reply if needed + + } + else if (ipA == 0 && ipB == p->from.s_addr) { + // new source, start the merge + port->ipA.s_addr = p->from.s_addr; + port->timeB = time(NULL); + memcpy(&port->dataB, &p->data.admx.data,data_length); + port->length = data_length; + + // merge, newest data is portA + merge(n,i,data_length, port->dataA); + + // send reply if needed + } + else if (ipA == p->from.s_addr && ipB != p->from.s_addr) { + // continue merge + port->timeA = time(NULL); + memcpy(&port->dataA, &p->data.admx.data,data_length); + port->length = data_length; + + // merge, newest data is portA + merge(n,i,data_length, port->dataA); + + } + else if (ipA != p->from.s_addr && ipB == p->from.s_addr) { + // continue merge + port->timeB = time(NULL); + memcpy(&port->dataB, &p->data.admx.data,data_length); + port->length = data_length; + + // merge newest data is portB + merge(n,i,data_length, port->dataB); + + } + else if (ipA == p->from.s_addr && ipB == p->from.s_addr) { +// err_warn("In handle_dmx, source matches both buffers, this shouldn't be happening!\n"); + + } + else if (ipA != p->from.s_addr && ipB != p->from.s_addr) { +// err_warn("In handle_dmx, more than two sources, discarding data\n"); + + } + else { +// err_warn("In handle_dmx, no cases matched, this shouldn't happen!\n"); + + } + + // do the dmx callback here + if (n->callbacks.dmx_c.fh != NULL) + n->callbacks.dmx_c.fh(n,i, n->callbacks.dmx_c.data); + } + } + return; +} + + +/** + * handle art address packet. + * This can reprogram certain nodes settings such as short/long name, port + * addresses, subnet address etc. + * + */ +int handle_address(node n, artnet_packet p) { + int i, old_subnet; + int addr[ARTNET_MAX_PORTS]; + int ret; + + if (check_callback(n, p, n->callbacks.address)) + return ARTNET_EOK; + + // servers (and raw nodes) don't respond to address packets + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) + return ARTNET_EOK; + + // reprogram shortname if required + if (p->data.addr.shortname[0] != PROGRAM_DEFAULTS && + p->data.addr.shortname[0] != PROGRAM_NO_CHANGE) { + memcpy(&n->state.short_name, &p->data.addr.shortname, ARTNET_SHORT_NAME_LENGTH); + n->state.report_code = ARTNET_RCSHNAMEOK; + } + // reprogram long name if required + if (p->data.addr.longname[0] != PROGRAM_DEFAULTS && + p->data.addr.longname[0] != PROGRAM_NO_CHANGE) { + memcpy(&n->state.long_name, &p->data.addr.longname, ARTNET_LONG_NAME_LENGTH); + n->state.report_code = ARTNET_RCLONAMEOK; + } + + // first of all store existing port addresses + // then we can work out if they change + for (i=0; i< ARTNET_MAX_PORTS; i++) { + addr[i] = n->ports.in[i].port_addr; + } + + // program subnet + old_subnet = p->data.addr.subnet; + if (p->data.addr.subnet == PROGRAM_DEFAULTS) { + // reset to defaults + n->state.subnet = n->state.default_subnet; + n->state.subnet_net_ctl = FALSE; + + } else if (p->data.addr.subnet & PROGRAM_CHANGE_MASK) { + n->state.subnet = p->data.addr.subnet & ~PROGRAM_CHANGE_MASK; + n->state.subnet_net_ctl = TRUE; + } + + // check if subnet has actually changed + if (old_subnet != n->state.subnet) { + // if it does we need to change all port addresses + for(i=0; i< ARTNET_MAX_PORTS; i++) { + n->ports.in[i].port_addr = _make_addr(n->state.subnet, n->ports.in[i].port_addr); + n->ports.out[i].port_addr = _make_addr(n->state.subnet, n->ports.out[i].port_addr); + } + } + + // program swins + for (i =0; i < ARTNET_MAX_PORTS; i++) { + if (p->data.addr.swin[i] == PROGRAM_NO_CHANGE) { + continue; + } else if (p->data.addr.swin[i] == PROGRAM_DEFAULTS) { + // reset to defaults + n->ports.in[i].port_addr = _make_addr(n->state.subnet, n->ports.in[i].port_default_addr); + n->ports.in[i].port_net_ctl = FALSE; + + } else if ( p->data.addr.swin[i] & PROGRAM_CHANGE_MASK) { + n->ports.in[i].port_addr = _make_addr(n->state.subnet, p->data.addr.swin[i]); + n->ports.in[i].port_net_ctl = TRUE; + } + } + + // program swouts + for (i =0; i < ARTNET_MAX_PORTS; i++) { + if (p->data.addr.swout[i] == PROGRAM_NO_CHANGE) { + continue; + } else if (p->data.addr.swout[i] == PROGRAM_DEFAULTS) { + // reset to defaults + n->ports.out[i].port_addr = _make_addr(n->state.subnet, n->ports.out[i].port_default_addr); + n->ports.out[i].port_net_ctl = FALSE; + n->ports.out[i].port_enabled = TRUE; + } else if ( p->data.addr.swout[i] & PROGRAM_CHANGE_MASK) { + n->ports.out[i].port_addr = _make_addr(n->state.subnet, p->data.addr.swout[i]); + n->ports.in[i].port_net_ctl = TRUE; + n->ports.out[i].port_enabled = TRUE; + } + } + + // reset sequence numbers if the addresses change + for (i=0; i< ARTNET_MAX_PORTS; i++) { + if (addr[i] != n->ports.in[i].port_addr) + n->ports.in[i].seq = 0; + } + + // check command + switch (p->data.addr.command) { + case ARTNET_PC_CANCEL: + // fix me + break; + case ARTNET_PC_RESET: + n->ports.out[0].port_status = n->ports.out[0].port_status & ~PORT_STATUS_DMX_SIP & ~PORT_STATUS_DMX_TEST & ~PORT_STATUS_DMX_TEXT; + // need to force a rerun of short tests here + break; + case ARTNET_PC_MERGE_LTP_O: + n->ports.out[0].merge_mode = ARTNET_MERGE_LTP; + n->ports.out[0].port_status = n->ports.out[0].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_LTP_1: + n->ports.out[1].merge_mode = ARTNET_MERGE_LTP; + n->ports.out[1].port_status = n->ports.out[1].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_LTP_2: + n->ports.out[2].merge_mode = ARTNET_MERGE_LTP; + n->ports.out[2].port_status = n->ports.out[2].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_LTP_3: + n->ports.out[3].merge_mode = ARTNET_MERGE_LTP; + n->ports.out[3].port_status = n->ports.out[3].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_HTP_0: + n->ports.out[0].merge_mode = ARTNET_MERGE_HTP; + n->ports.out[0].port_status = n->ports.out[0].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_HTP_1: + n->ports.out[1].merge_mode = ARTNET_MERGE_HTP; + n->ports.out[1].port_status = n->ports.out[1].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_HTP_2: + n->ports.out[2].merge_mode = ARTNET_MERGE_HTP; + n->ports.out[2].port_status = n->ports.out[2].port_status | PORT_STATUS_LPT_MODE; + break; + case ARTNET_PC_MERGE_HTP_3: + n->ports.out[3].merge_mode = ARTNET_MERGE_HTP; + n->ports.out[3].port_status = n->ports.out[3].port_status | PORT_STATUS_LPT_MODE; + break; + + } + + if (n->callbacks.program_c.fh != NULL) + n->callbacks.program_c.fh(n , n->callbacks.program_c.data); + + if ((ret = artnet_tx_build_art_poll_reply(n))) + return ret; + + return artnet_tx_poll_reply(n, TRUE); +} + + +/* + * handle art input. + * ArtInput packets can disable input ports. + */ +int _artnet_handle_input(node n, artnet_packet p) { + int i, ports, ret; + + if (check_callback(n, p, n->callbacks.input)) + return ARTNET_EOK; + + // servers (and raw nodes) don't respond to input packets + if (n->state.node_type != ARTNET_NODE && n->state.node_type != ARTNET_MSRV) + return ARTNET_EOK; + + ports = min( p->data.ainput.numbports, ARTNET_MAX_PORTS); + for (i =0; i < ports; i++) { + if (p->data.ainput.input[i] & PORT_DISABLE_MASK) { + // disable + n->ports.in[i].port_status = n->ports.in[i].port_status | PORT_STATUS_DISABLED_MASK; + } else { + // enable + n->ports.in[i].port_status = n->ports.in[i].port_status & ~PORT_STATUS_DISABLED_MASK; + } + } + + if ((ret = artnet_tx_build_art_poll_reply(n))) + return ret; + + return artnet_tx_poll_reply(n, TRUE); +} + + +/*** + * handle tod request packet + */ +int handle_tod_request(node n, artnet_packet p) { + int i, j, limit; + int ret = ARTNET_EOK; + + if (check_callback(n, p, n->callbacks.todrequest)) + return ARTNET_EOK; + + if (n->state.node_type != ARTNET_NODE) + return ARTNET_EOK; + + // limit to 32 + limit = min(ARTNET_MAX_RDM_ADCOUNT, p->data.todreq.adCount); + + // this should always be true + if (p->data.todreq.command == 0x00) { + for (i=0; i < limit; i++) { + for (j=0; j < ARTNET_MAX_PORTS; j++) { + if (n->ports.out[j].port_addr == p->data.todreq.address[i] && + n->ports.out[j].port_enabled) { + // reply with tod + ret = ret || artnet_tx_tod_data(n, j); + } + } + } + } + +// err_warn("tod request received but command is 0x%02hhx rather than 0x00\n", p->data.todreq.command); + return ret; +} + +/** + * handle tod data packet + * + * we don't maintain a tod of whats out on the network, + * the calling app can deal with this. + */ +void handle_tod_data(node n, artnet_packet p) { + + if (check_callback(n, p, n->callbacks.toddata)) + return; + + // pass data to app + +// if (n->callbacks.rdm_tod_c.fh != NULL) +// n->callbacks.rdm_tod_c.fh(n, i, n->callbacks.rdm_tod_c.data); + + return; +} + + + +int handle_tod_control(node n, artnet_packet p) { + int i; + int ret = ARTNET_EOK; + + if (check_callback(n, p, n->callbacks.todcontrol)) + return ARTNET_EOK; + + for (i=0; i < ARTNET_MAX_PORTS; i++) { + if (n->ports.out[i].port_addr == p->data.todcontrol.address && + n->ports.out[i].port_enabled) { + + if (p->data.todcontrol.cmd == ARTNET_TOD_FLUSH) { + // flush tod for this port + flush_tod(&n->ports.out[i].port_tod); + + //initiate full rdm discovery + // do callback here + if (n->callbacks.rdm_init_c.fh != NULL) + n->callbacks.rdm_init_c.fh(n, i, n->callbacks.rdm_init_c.data); + + // not really sure what to do here, the calling app should do a rdm + // init and call artnet_add_rdm_devices() which will send a tod data + // but do we really trust the caller ? + // Instead we'll send an empty tod data and then another one a bit later + // when our tod is populated + } + // reply with tod + ret = ret || artnet_tx_tod_data(n, i); + } + } + return ret; +} + +/** + * handle rdm packet + * + */ +void handle_rdm(node n, artnet_packet p) { + + + if (check_callback(n, p, n->callbacks.rdm)) + return; + + printf("rdm data\n"); + + // hell dodgy + if (n->callbacks.rdm_c.fh != NULL) + n->callbacks.rdm_c.fh(n, p->data.rdm.address, p->data.rdm.data, ARTNET_MAX_RDM_DATA, n->callbacks.rdm_c.data); + + return; +} + +/** + * handle a firmware master + */ + +// THIS NEEDS TO BE CHECKED FOR BUFFER OVERFLOWS +// IMPORTANT!!!! +int handle_firmware(node n, artnet_packet p) { + int length, offset, block_length, total_blocks, block_id; + artnet_firmware_status_code response_code = ARTNET_FIRMWARE_FAIL; + + // run callback if defined + if (check_callback(n, p, n->callbacks.firmware)) + return ARTNET_EOK; + + /* + * What happens if an upload is less than 512 bytes ????? + */ + + if ( p->data.firmware.type == ARTNET_FIRMWARE_FIRMFIRST || + p->data.firmware.type == ARTNET_FIRMWARE_UBEAFIRST) { + // a new transfer is initiated + + if (n->firmware.peer.s_addr == 0) { + //new transfer + // these are 2 byte words, so we get a total of 1k of data per packet + length = artnet_misc_nbytes_to_32( p->data.firmware.length ) * + sizeof(p->data.firmware.data[0]); + + // set parameters + n->firmware.peer.s_addr = p->from.s_addr; + n->firmware.data = malloc(length); + + if (n->firmware.data == NULL) { + artnet_error_malloc(); + return ARTNET_EMEM; + } + n->firmware.bytes_total = length; + n->firmware.last_time = time(NULL); + n->firmware.expected_block = 1; + + // check if this is a ubea upload or not + if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMFIRST) + n->firmware.ubea = 0; + else + n->firmware.ubea = 1; + + // take the minimum of the total length and the max packet size + block_length = min((unsigned int) length, ARTNET_FIRMWARE_SIZE * + sizeof(p->data.firmware.data[0])); + + memcpy(n->firmware.data, p->data.firmware.data, block_length); + n->firmware.bytes_current = block_length; + + if (block_length == length) { + // this is the first and last packet + // upload was less than 1k bytes + // this behaviour isn't in the spec, presumably no firmware will be less that 1k + response_code = ARTNET_FIRMWARE_ALLGOOD; + + // do the callback here + if (n->callbacks.firmware_c.fh != NULL) + n->callbacks.firmware_c.fh(n, + n->firmware.ubea, + n->firmware.data, + n->firmware.bytes_total, + n->callbacks.firmware_c.data); + + } else { + response_code = ARTNET_FIRMWARE_BLOCKGOOD; + } + + } else { + // already in a transfer + printf("First, but already for a packet\n"); + + // send a failure + response_code = ARTNET_FIRMWARE_FAIL; + } + + } else if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMCONT || + p->data.firmware.type == ARTNET_FIRMWARE_UBEACONT) { + // continued transfer + length = artnet_misc_nbytes_to_32(p->data.firmware.length) * + sizeof(p->data.firmware.data[0]); + total_blocks = length / ARTNET_FIRMWARE_SIZE / 2 + 1; + block_length = ARTNET_FIRMWARE_SIZE * sizeof(uint16_t); + block_id = p->data.firmware.blockId; + + // ok the blockid field is only 1 byte, so it wraps back to 0x00 we + // need to watch for this + if (n->firmware.expected_block > UINT8_MAX && + (n->firmware.expected_block % (UINT8_MAX+1)) == p->data.firmware.blockId) { + + block_id = n->firmware.expected_block; + } + offset = block_id * ARTNET_FIRMWARE_SIZE; + + if (n->firmware.peer.s_addr == p->from.s_addr && + length == n->firmware.bytes_total && + block_id < total_blocks-1) { + + memcpy(n->firmware.data + offset, p->data.firmware.data, block_length); + n->firmware.bytes_current += block_length; + n->firmware.expected_block++; + + response_code = ARTNET_FIRMWARE_BLOCKGOOD; + } else { + printf("cont, ips don't match or length has changed or out of range block num\n" ); + + // in a transfer not from this ip + response_code = ARTNET_FIRMWARE_FAIL; + } + + } else if (p->data.firmware.type == ARTNET_FIRMWARE_FIRMLAST || + p->data.firmware.type == ARTNET_FIRMWARE_UBEALAST) { + length = artnet_misc_nbytes_to_32( p->data.firmware.length) * + sizeof(p->data.firmware.data[0]); + total_blocks = length / ARTNET_FIRMWARE_SIZE / 2 + 1; + + // length should be the remaining data + block_length = n->firmware.bytes_total % (ARTNET_FIRMWARE_SIZE * sizeof(uint16_t)); + block_id = p->data.firmware.blockId; + + // ok the blockid field is only 1 byte, so it wraps back to 0x00 we + // need to watch for this + if (n->firmware.expected_block > UINT8_MAX && + (n->firmware.expected_block % (UINT8_MAX+1)) == p->data.firmware.blockId) { + + block_id = n->firmware.expected_block; + } + offset = block_id * ARTNET_FIRMWARE_SIZE; + + if (n->firmware.peer.s_addr == p->from.s_addr && + length == n->firmware.bytes_total && + block_id == total_blocks-1) { + + // all the checks work out + memcpy(n->firmware.data + offset, p->data.firmware.data, block_length); + n->firmware.bytes_current += block_length; + + // do the callback here + if (n->callbacks.firmware_c.fh != NULL) + n->callbacks.firmware_c.fh(n, n->firmware.ubea, + n->firmware.data, + n->firmware.bytes_total / sizeof(p->data.firmware.data[0]), + n->callbacks.firmware_c.data); + + // reset values and free + reset_firmware_upload(n); + + response_code = ARTNET_FIRMWARE_ALLGOOD; + printf("Firmware upload complete\n"); + + } else if (n->firmware.peer.s_addr != p->from.s_addr) { + // in a transfer not from this ip + printf("last, ips don't match\n" ); + response_code = ARTNET_FIRMWARE_FAIL; + } else if (length != n->firmware.bytes_total) { + // they changed the length mid way thru a transfer + printf("last, lengths have changed %d %d\n", length, n->firmware.bytes_total); + response_code = ARTNET_FIRMWARE_FAIL; + } else if (block_id != total_blocks -1) { + // the blocks don't match up + printf("This is the last block, but not according to the lengths %d %d\n", block_id, total_blocks -1); + response_code = ARTNET_FIRMWARE_FAIL; + } + } + + return artnet_tx_firmware_reply(n, p->from.s_addr, response_code); +} + +/** + * handle an firmware reply + */ +int handle_firmware_reply(node n, artnet_packet p) { + node_entry_private_t *ent; + + // run callback if defined + if (check_callback(n, p, n->callbacks.firmware_reply)) + return ARTNET_EOK; + + ent = find_entry_from_ip(&n->node_list, p->from); + + // node doesn't exist in our list, or we're not doing a transfer to this node + if (ent== NULL || ent->firmware.bytes_total == 0) + return ARTNET_EOK; + + // three types of response, ALLGOOD, BLOCKGOOD and FIRMFAIL + if (p->data.firmwarer.type == ARTNET_FIRMWARE_ALLGOOD) { + + if (ent->firmware.bytes_total == ent->firmware.bytes_current) { + // transfer complete + + // do the callback + if (ent->firmware.callback != NULL) + ent->firmware.callback(n, ARTNET_FIRMWARE_ALLGOOD, ent->firmware.user_data); + + memset(&ent->firmware, 0x0, sizeof(firmware_transfer_t)); + + } else { + // random ALLGOOD received, don't let this abort the transfer + printf("FIRMWARE_ALLGOOD received before transfer completed\n"); + } + + } else if (p->data.firmwarer.type == ARTNET_FIRMWARE_FAIL) { + + // do the callback + if (ent->firmware.callback != NULL) + ent->firmware.callback(n, ARTNET_FIRMWARE_FAIL, ent->firmware.user_data); + + // cancel transfer + memset(&ent->firmware, 0x0, sizeof(firmware_transfer_t)); + + } else if (p->data.firmwarer.type == ARTNET_FIRMWARE_BLOCKGOOD) { + // send the next block (only if we're not done yet) + if (ent->firmware.bytes_total != ent->firmware.bytes_current) { + return artnet_tx_firmware_packet(n, &ent->firmware); + } + } + return ARTNET_EOK; +} + + +/* + * have to sort this one out. + */ +void handle_ipprog(node n, artnet_packet p) { + + if (check_callback(n, p, n->callbacks.ipprog)) + return; + + printf("in ipprog\n"); +} + + +/* + * The main handler for an artnet packet. calls + * the appropriate handler function + */ +int handle(node n, artnet_packet p) { + + if (check_callback(n, p, n->callbacks.recv)) + return 0; + + switch (p->type) { + case ARTNET_POLL: + handle_poll(n, p); + break; + case ARTNET_REPLY: + handle_reply(n,p); + break; + case ARTNET_DMX: + handle_dmx(n, p); + break; + case ARTNET_ADDRESS: + handle_address(n, p); + break; + case ARTNET_INPUT: + _artnet_handle_input(n, p); + break; + case ARTNET_TODREQUEST: + handle_tod_request(n, p); + break; + case ARTNET_TODDATA: + handle_tod_data(n, p); + break; + case ARTNET_TODCONTROL: + handle_tod_control(n, p); + break; + case ARTNET_RDM: + handle_rdm(n, p); + break; + case ARTNET_VIDEOSTEUP: + printf("vid setup\n"); + break; + case ARTNET_VIDEOPALETTE: + printf("video palette\n"); + break; + case ARTNET_VIDEODATA: + printf("video data\n"); + break; + case ARTNET_MACMASTER: + printf("mac master\n"); + break; + case ARTNET_MACSLAVE: + printf("mac slave\n"); + break; + case ARTNET_FIRMWAREMASTER: + handle_firmware(n, p); + break; + case ARTNET_FIRMWAREREPLY: + handle_firmware_reply(n, p); + break; + case ARTNET_IPPROG : + handle_ipprog(n, p); + break; + case ARTNET_IPREPLY: + printf("ip reply\n"); + break; + case ARTNET_MEDIA: + printf("media \n"); + break; + case ARTNET_MEDIAPATCH: + printf("media patch\n"); + break; + case ARTNET_MEDIACONTROLREPLY: + printf("media control reply\n"); + break; + default: + n->state.report_code = ARTNET_RCPARSEFAIL; + printf("artnet but not yet implemented!, op was %hx\n", p->type); + } + return 0; +} + +/** + * this gets the opcode from a packet + */ +int16_t get_type(artnet_packet p) { + uint8_t *data; + + if (p->length < 10) + return 0; + if (!memcmp(&p->data, "Art-Net\0", 8)) { + // not the best here, this needs to be tested on different arch + data = (uint8_t *) &p->data; + + p->type = (data[9] << 8) + data[8]; + return p->type; + } else { + return 0; + } +} + + +/* + * takes a subnet and an address and creates the universe address + */ +uint8_t _make_addr(uint8_t subnet, uint8_t addr) { + return ((subnet & LOW_NIBBLE) << 4) | (addr & LOW_NIBBLE); +} + + +/* + * + */ +void check_merge_timeouts(node n, int port_id) { + output_port_t *port; + time_t now; + time_t timeoutA, timeoutB; + port = &n->ports.out[port_id]; + time(&now); + timeoutA = now - port->timeA; + timeoutB = now - port->timeB; + + if (timeoutA > MERGE_TIMEOUT_SECONDS) { + // A is old, stop the merge + port->ipA.s_addr = 0; + } + + if (timeoutB > MERGE_TIMEOUT_SECONDS) { + // B is old, stop the merge + port->ipB.s_addr = 0; + } +} + + +/* + * merge the data from two sources + */ +void merge(node n, int port_id, int length, uint8_t *latest) { + int i; + output_port_t *port; + port = &n->ports.out[port_id]; + + if (port->merge_mode == ARTNET_MERGE_HTP) { + for (i=0; i< length; i++) + port->data[i] = max(port->dataA[i], port->dataB[i]); + } else { + memcpy(port->data, latest, length); + } +} + + +void reset_firmware_upload(node n) { + n->firmware.bytes_current = 0; + n->firmware.bytes_total = 0; + n->firmware.peer.s_addr = 0; + n->firmware.ubea = 0; + n->firmware.last_time = 0; + free(n->firmware.data); +} diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/tod.c b/open-lighting-architecture/libartnet-1.1.0/artnet/tod.c new file mode 100644 index 0000000..39fa7b6 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/tod.c @@ -0,0 +1,128 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * tod.c + * Functions to manipulate the TOD + * Copyright (C) 2004-2005 Simon Newton + */ + +#include + +#include "tod.h" +#include "misc.h" + +/* + * adds a uid to the table of devices + */ +int add_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]) { + uint8_t *addr; + int size; + + if (tod == NULL) + return -1; + + if (tod->data == NULL) { + // malloc + tod->data = malloc(ARTNET_RDM_UID_WIDTH * ARTNET_TOD_INITIAL_SIZE); + + if (tod->data == NULL) { + artnet_error_malloc(); + return ARTNET_EMEM; + } + tod->length = 1; + tod->max_length = ARTNET_TOD_INITIAL_SIZE; + + } else if (tod->length == tod->max_length) { + // realloc + size = (tod->max_length + ARTNET_TOD_INCREMENT); + tod->data = realloc(tod->data, size * ARTNET_RDM_UID_WIDTH); + + if (tod->data == NULL) { + artnet_error_realloc(); + return ARTNET_EMEM; + } + + tod->max_length = size; + tod->length++; + + } else { + tod->length++; + } + + addr = tod->data + (tod->length-1) * ARTNET_RDM_UID_WIDTH; + memcpy(addr, uid, ARTNET_RDM_UID_WIDTH); + + return 0; +} + +/* + * remove a uid from the table of devices + * + */ +int remove_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]) { + int i; + int offset = 0; + uint8_t *last; + + if (tod == NULL) + return -1; + + if (tod->data == NULL) + return -1; + + for (i=0; i < tod->length; i++) { + offset += ARTNET_RDM_UID_WIDTH; + if (memcmp(tod->data + offset, uid, ARTNET_RDM_UID_WIDTH) == 0) + break; + } + + if (i == tod->length) { + return -1; + } else { + + last = tod->data + (tod->length-1) * ARTNET_RDM_UID_WIDTH; + // copy the last entry over this one + memcpy(tod->data + offset, last ,ARTNET_RDM_UID_WIDTH); + + tod->length--; + return 0; + } +} + +/* + * clear the table of devices + */ +int flush_tod(tod_t *tod) { + if (tod == NULL) + return -1; + + free(tod->data); + tod->data = NULL; + tod->length = 0; + tod->max_length = 0; + + return 0; +} + + +int reset_tod(tod_t *tod) { + if (tod == NULL) + return -1; + + tod->data = NULL; + tod->length = 0; + tod->max_length = 0; + return 0; +} diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/tod.h b/open-lighting-architecture/libartnet-1.1.0/artnet/tod.h new file mode 100644 index 0000000..eb43a53 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/tod.h @@ -0,0 +1,45 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * tod.h + * Header file for tod.h + * Copyright (C) 2004-2005 Simon Newton + */ + +#ifndef ARTNET_TOD_H +#define ARTNET_TOD_H + +#include +#include "common.h" + +enum { ARTNET_TOD_INITIAL_SIZE = 100 }; +enum { ARTNET_TOD_INCREMENT = 50 }; + +/* + * table of devices + */ +typedef struct { + uint8_t *data; + int length; + int max_length; +} tod_t; + + +extern int add_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]); +extern int remove_tod_uid(tod_t *tod, uint8_t uid[ARTNET_RDM_UID_WIDTH]); +extern int flush_tod(tod_t *tod); +extern int reset_tod(tod_t *tod); + +#endif diff --git a/open-lighting-architecture/libartnet-1.1.0/artnet/transmit.c b/open-lighting-architecture/libartnet-1.1.0/artnet/transmit.c new file mode 100644 index 0000000..56167bc --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/artnet/transmit.c @@ -0,0 +1,445 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * transmit.c + * Functions to handle sending datagrams + * Copyright (C) 2004-2005 Simon Newton + */ + +#include "private.h" + +/* + * Send an art poll + * + * @param ip the ip address to send to + * @param ttm the talk to me value, either ARTNET_TTM_DEFAULT, + * ARTNET_TTM_PRIVATE or ARTNET_TTM_AUTO + */ +int artnet_tx_poll(node n, const char *ip, artnet_ttm_value_t ttm) { + artnet_packet_t p; + int ret; + + if (n->state.mode != ARTNET_ON) + return ARTNET_EACTION; + + if (n->state.node_type == ARTNET_SRV || n->state.node_type == ARTNET_RAW) { + if (ip) { + ret = artnet_net_inet_aton(ip, &p.to); + if (ret) + return ret; + } else { + p.to.s_addr = n->state.bcast_addr.s_addr; + } + + memcpy(&p.data.ap.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.ap.opCode = htols(ARTNET_POLL); + p.data.ap.verH = 0; + p.data.ap.ver = ARTNET_VERSION; + p.data.ap.ttm = ~ttm; + p.data.ap.pad = 0; + + p.length = sizeof(artnet_poll_t); + return artnet_net_send(n, &p); + + } else { + artnet_error("Not sending poll, not a server or raw device"); + return ARTNET_EACTION; + } +} + +/* + * Send an ArtPollReply + * @param n the node + * @param response true if this reply is in response to a network packet + * false if this reply is due to the node changing it's conditions + */ +int artnet_tx_poll_reply(node n, int response) { + artnet_packet_t reply; + int i; + + if (!response && n->state.mode == ARTNET_ON) { + n->state.ar_count++; + } + + reply.to = n->state.reply_addr; + reply.type = ARTNET_REPLY; + reply.length = sizeof(artnet_reply_t); + + // copy from a poll reply template + memcpy(&reply.data, &n->ar_temp, sizeof(artnet_reply_t)); + + for (i=0; i< ARTNET_MAX_PORTS; i++) { + reply.data.ar.goodinput[i] = n->ports.in[i].port_status; + reply.data.ar.goodoutput[i] = n->ports.out[i].port_status; + } + + snprintf((char *) &reply.data.ar.nodereport, + sizeof(reply.data.ar.nodereport), + "%04hx [%04i] libartnet", + n->state.report_code, + n->state.ar_count); + + return artnet_net_send(n, &reply); +} + + +/* + * Send a tod request + */ +int artnet_tx_tod_request(node n) { + int i; + artnet_packet_t todreq; + + todreq.to = n->state.bcast_addr; + todreq.type = ARTNET_TODREQUEST; + todreq.length = sizeof(artnet_todrequest_t); + memset(&todreq.data,0x00, todreq.length); + + // set up the data + memcpy(&todreq.data.todreq.id, ARTNET_STRING, ARTNET_STRING_SIZE); + todreq.data.todreq.opCode = htols(ARTNET_TODREQUEST); + todreq.data.todreq.verH = 0; + todreq.data.todreq.ver = ARTNET_VERSION; + todreq.data.todreq.command = ARTNET_TOD_FULL; // todfull + todreq.data.todreq.adCount = 0; + + // include all enabled ports + for (i=0; i < ARTNET_MAX_PORTS; i++) { + if (n->ports.out[i].port_enabled) { + todreq.data.todreq.address[todreq.data.todreq.adCount++] = n->ports.out[i].port_addr; + } + } + + return artnet_net_send(n, &todreq); +} + + +/* + * Send a tod data for port number id + * @param id the number of the port to send data for + */ +int artnet_tx_tod_data(node n, int id) { + artnet_packet_t tod; + int lim, remaining, bloc, offset; + int ret = ARTNET_EOK; + + // ok we need to check how many uid's we have, + // may need to send more than one datagram + + tod.to = n->state.bcast_addr; + tod.type = ARTNET_TODDATA; + tod.length = sizeof(artnet_toddata_t); + + memset(&tod.data,0x00, tod.length); + + // set up the data + memcpy(&tod.data.toddata.id, ARTNET_STRING, ARTNET_STRING_SIZE); + tod.data.toddata.opCode = htols(ARTNET_TODDATA); + tod.data.toddata.verH = 0; + tod.data.toddata.ver = ARTNET_VERSION; + tod.data.toddata.port = id; + + // this is interesting, the spec mentions TOD_ADD and TOD_SUBTRACT, but the + // codes aren't given. The windows drivers don't have these either.... + tod.data.toddata.cmdRes = ARTNET_TOD_FULL; + + tod.data.toddata.address = n->ports.out[id].port_addr; + tod.data.toddata.uidTotalHi = short_get_high_byte(n->ports.out[id].port_tod.length); + tod.data.toddata.uidTotal = short_get_low_byte(n->ports.out[id].port_tod.length); + + remaining = n->ports.out[id].port_tod.length; + bloc = 0; + + while (remaining > 0) { + memset(&tod.data.toddata.tod,0x00, ARTNET_MAX_UID_COUNT); + lim = min(ARTNET_MAX_UID_COUNT, remaining); + tod.data.toddata.blockCount = bloc++; + tod.data.toddata.uidCount = lim; + + offset = (n->ports.out[id].port_tod.length - remaining) * ARTNET_RDM_UID_WIDTH; + if (n->ports.out[id].port_tod.data != NULL) + memcpy(tod.data.toddata.tod, + n->ports.out[id].port_tod.data + offset, + lim * ARTNET_RDM_UID_WIDTH); + + ret = ret || artnet_net_send(n, &tod); + remaining = remaining - lim; + } + return ret; +} + + +/* + * Send a tod data for port number id + * @param id the number of the port to send data for + */ +int artnet_tx_tod_control(node n, + uint8_t address, + artnet_tod_command_code action) { + artnet_packet_t tod; + + tod.to = n->state.bcast_addr; + tod.type = ARTNET_TODCONTROL; + tod.length = sizeof(artnet_todcontrol_t); + + memset(&tod.data,0x00, tod.length); + + // set up the data + memcpy(&tod.data.todcontrol.id, ARTNET_STRING, ARTNET_STRING_SIZE); + tod.data.todcontrol.opCode = htols(ARTNET_TODCONTROL); + tod.data.todcontrol.verH = 0; + tod.data.todcontrol.ver = ARTNET_VERSION; + tod.data.todcontrol.cmd = action; + tod.data.todcontrol.address = address; + + return artnet_net_send(n, &tod); +} + + +/* + * Send a RDM message + * @param address the universe to address this datagram to + * @param action the action to perform. Either ARTNET_TOD_FULL or + * ARTNET_TOD_FLUSH + */ +int artnet_tx_rdm(node n, uint8_t address, uint8_t *data, int length) { + artnet_packet_t rdm; + int len; + + rdm.to = n->state.bcast_addr; + rdm.type = ARTNET_RDM; + rdm.length = sizeof(artnet_rdm_t); + + memset(&rdm.data,0x00, rdm.length); + + // set up the data + memcpy(&rdm.data.todcontrol.id, ARTNET_STRING, ARTNET_STRING_SIZE); + rdm.data.rdm.opCode = htols(ARTNET_RDM); + rdm.data.rdm.verH = 0; + rdm.data.rdm.ver = ARTNET_VERSION; + rdm.data.rdm.cmd = 0x00; + rdm.data.rdm.address = address; + + len = min(length, ARTNET_MAX_RDM_DATA); + memcpy(&rdm.data.rdm.data, data, len); + return artnet_net_send(n, &rdm); + +} + + +/* + * Send a firmware reply + * @param ip the ip address to send to + * @param code the response code + */ +int artnet_tx_firmware_reply(node n, in_addr_t ip, + artnet_firmware_status_code code) { + artnet_packet_t p; + memset(&p, 0x0, sizeof(p)); + + p.to.s_addr = ip; + p.length = sizeof(artnet_firmware_t); + p.type = ARTNET_FIRMWAREREPLY; + + // now build packet + memcpy(&p.data.firmware.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.firmware.opCode = htols(ARTNET_FIRMWAREREPLY); + p.data.firmware.verH = 0; + p.data.firmware.ver = ARTNET_VERSION; + p.data.firmware.type = code; + + return artnet_net_send(n, &p); +} + + +/* + * Send an firmware data datagram + * + * @param firm a pointer to the firmware structure for this transfer + */ +int artnet_tx_firmware_packet(node n, firmware_transfer_t *firm) { + artnet_packet_t p; + uint8_t type = 0; + int data_len, max_len, ret; + + memset(&p, 0x0, sizeof(p)); + + // max value of data_len is 1024; + max_len = ARTNET_FIRMWARE_SIZE * sizeof(p.data.firmware.data[0]); + + // calculate length + data_len = firm->bytes_total - firm->bytes_current; + data_len = min(data_len, max_len); + + // work out type - 6 cases + if(firm->ubea) { + // ubea upload + if (firm->bytes_current == 0) { + // first + type = ARTNET_FIRMWARE_UBEAFIRST; + } else if (data_len == max_len) { + // cont + type = ARTNET_FIRMWARE_UBEACONT; + } else if (data_len < max_len) { + // last + type = ARTNET_FIRMWARE_UBEALAST; + } else { + // this should never happen, something has gone wrong + artnet_error("Attempting to send %d when the max is %d, very very bad...\n", data_len, max_len); + } + } else { + // firmware upload + if (firm->bytes_current == 0) { + // first + type = ARTNET_FIRMWARE_FIRMFIRST; + } else if (data_len == max_len) { + // cont + type = ARTNET_FIRMWARE_FIRMCONT; + } else if (data_len < max_len) { + // last + type = ARTNET_FIRMWARE_FIRMLAST; + } else { + // this should never happen, something has gone wrong + artnet_error("Attempting to send %d when the max is %d, very very bad...\n", data_len, max_len); + } + } + + // set packet properties + p.to.s_addr = firm->peer.s_addr; + p.length = sizeof(artnet_firmware_t); + p.type = ARTNET_FIRMWAREMASTER; + + // now build packet + memcpy(&p.data.firmware.id, ARTNET_STRING, ARTNET_STRING_SIZE); + p.data.firmware.opCode = htols(ARTNET_FIRMWAREMASTER); + p.data.firmware.verH = 0; + p.data.firmware.ver = ARTNET_VERSION; + p.data.firmware.type = type; + p.data.firmware.blockId = firm->expected_block; + + artnet_misc_int_to_bytes(firm->bytes_total / sizeof(uint16_t), + p.data.firmware.length); + + memcpy(&p.data.firmware.data, + firm->data + (firm->bytes_current / sizeof(uint16_t)), + data_len); + + if ((ret = artnet_net_send(n, &p))) { + // send failed + return ret; + } else { + // update stats + firm->bytes_current = firm->bytes_current + data_len; + firm->last_time = time(NULL); + firm->expected_block++; + // limit between 0 and 255 (only 8 bits wide) + // we dont' actually need this cause it will be shorted when assigned above + firm->expected_block %= UINT8_MAX; + } + return ARTNET_EOK; +} + + +// this is called when the node's state changes to rebuild the +// artpollreply packet +int artnet_tx_build_art_poll_reply(node n) { + int i; + + // shorten the amount we have to type + artnet_reply_t *ar = &n->ar_temp; + + memset(ar, 0x00, sizeof(artnet_reply_t)); + + memcpy(&ar->id, ARTNET_STRING, ARTNET_STRING_SIZE); + ar->opCode = htols(ARTNET_REPLY); + memcpy(&ar->ip, &n->state.ip_addr.s_addr, 4); + ar->port = htols(ARTNET_PORT); + ar->verH = 0; + ar->ver = 0; + ar->subH = 0; + ar->sub = n->state.subnet; + ar->oemH = n->state.oem_hi; + ar->oem = n->state.oem_lo; + ar->ubea = 0; + // ar->status + +// if(n->state + + // status need to be recalc everytime + //ar->status + + // ESTA Manufacturer ID + // Assigned 18/4/2006 + ar->etsaman[0] = n->state.esta_hi; + ar->etsaman[1] = n->state.esta_lo; + + memcpy(&ar->shortname, &n->state.short_name, sizeof(n->state.short_name)); + memcpy(&ar->longname, &n->state.long_name, sizeof(n->state.long_name)); + + // the report is generated on every send + + // port stuff here + ar->numbportsH = 0; + + for (i = ARTNET_MAX_PORTS; i > 0; i--) { + if (n->ports.out[i-1].port_enabled || n->ports.in[i-1].port_enabled) + break; + } + + ar->numbports = i; + + for (i=0; i< ARTNET_MAX_PORTS; i++) { + ar->porttypes[i] = n->ports.types[i]; + ar->goodinput[i] = n->ports.in[i].port_status; + ar->goodoutput[i] = n->ports.out[i].port_status; + ar->swin[i] = n->ports.in[i].port_addr; + ar->swout[i] = n->ports.out[i].port_addr; + } + + ar->swvideo = 0; + ar->swmacro = 0; + ar->swremote = 0; + + // spares + ar->sp1 = 0; + ar->sp2 = 0; + ar->sp3 = 0; + + // hw address + memcpy(&ar->mac, &n->state.hw_addr, ARTNET_MAC_SIZE); + + // set style + switch (n->state.node_type) { + case ARTNET_SRV: + ar->style = STSERVER; + break; + case ARTNET_NODE: + ar->style = STNODE; + break; + case ARTNET_MSRV: + ar->style = STMEDIA; + break; + // we should fix this, it'll do for now + case ARTNET_RAW: + ar->style = STNODE; + break; + default: + artnet_error("Node type not recognised!"); + ar->style = STNODE; + return ARTNET_ESTATE; + } + + return ARTNET_EOK; +} diff --git a/open-lighting-architecture/libartnet-1.1.0/config.guess b/open-lighting-architecture/libartnet-1.1.0/config.guess new file mode 100755 index 0000000..396482d --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/config.guess @@ -0,0 +1,1500 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-07-02' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# 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 build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +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\n"); 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`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%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) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# 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_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# 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 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/libartnet-1.1.0/config.h.in b/open-lighting-architecture/libartnet-1.1.0/config.h.in new file mode 100644 index 0000000..63e6f25 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/config.h.in @@ -0,0 +1,162 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the `getifaddrs' function. */ +#undef HAVE_GETIFADDRS + +/* Define to 1 if you have the `inet_aton' function. */ +#undef HAVE_INET_ATON + +/* Define to 1 if you have the `inet_ntoa' function. */ +#undef HAVE_INET_NTOA + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PPC_ENDIAN_H + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* define if socket address structures have length fields */ +#undef HAVE_SOCKADDR_SA_LEN + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_HI + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if the system supports IPv6 */ +#undef IPV6 + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/open-lighting-architecture/libartnet-1.1.0/config.sub b/open-lighting-architecture/libartnet-1.1.0/config.sub new file mode 100755 index 0000000..fab0aa3 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/config.sub @@ -0,0 +1,1616 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-09-20' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# 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. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -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* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/libartnet-1.1.0/configure b/open-lighting-architecture/libartnet-1.1.0/configure new file mode 100755 index 0000000..6182256 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/configure @@ -0,0 +1,23019 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="configure.in" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +LN_S +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +GREP +EGREP +ECHO +AR +RANLIB +DLLTOOL +AS +OBJDUMP +CPP +CXX +CXXFLAGS +ac_ct_CXX +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +CXXCPP +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +LIBOBJS +USING_WIN32_TRUE +USING_WIN32_FALSE +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +F77 +FFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] include additional configurations [automatic] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.10' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=libartnet + VERSION=1.1.0 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4408 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 +echo "${ECHO_T}$DLLTOOL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 +echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AS="${ac_tool_prefix}as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { echo "$as_me:$LINENO: result: $AS" >&5 +echo "${ECHO_T}$AS" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AS="as" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 +echo "${ECHO_T}$ac_ct_AS" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 +echo "${ECHO_T}$OBJDUMP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 +echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; + +esac + +need_locks="$enable_libtool_lock" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_prog_f77_g=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } +else + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=yes + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7424: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7428: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7692: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7696: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7796: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7800: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* 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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* 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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which library types will actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" +fi + + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12540: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12544: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12644: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12648: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14214: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14218: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14318: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14322: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16516: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16520: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16784: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16788: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16888: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16892: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +# Checks for header files. +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + + + + + + + +for ac_header in endian.h ppc/endian.h arpa/inet.h netinet/in.h stddef.h \ + stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h \ + unistd.hi linux/if_packet.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdbool_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Bool ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Bool=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + + +# Checks for library functions. +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + +{ echo "$as_me:$LINENO: checking for working memcmp" >&5 +echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_working=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memcmp_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 +echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } +if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_realloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *realloc (); +#endif + +int +main () +{ +return ! realloc (0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_realloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_realloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } +if test $ac_cv_func_realloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_REALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" realloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define realloc rpl_realloc +_ACEOF + +fi + + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +{ echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; } +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _doprnt (); +/* 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__doprnt || defined __stub____doprnt +choke me +#endif + +int +main () +{ +return _doprnt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func__doprnt=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6; } +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + + + + + + + + + + +for ac_func in inet_ntoa inet_aton memset select socket strchr strdup \ + strerror getifaddrs +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# check for ipv6 support - taken from unp +{ echo "$as_me:$LINENO: checking for IPv6 support" >&5 +echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6; } +if test "${ac_cv_ipv6+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_ipv6=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# include +# include +# include + /* Make sure the definitions for AF_INET6 and struct sockaddr_in6 + * are defined, and that we can actually create an IPv6 TCP socket. + */ + main() + { + int fd; + struct sockaddr_in6 foo; + fd = socket(AF_INET6, SOCK_STREAM, 0); + exit(fd >= 0 ? 0 : 1); + } +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_ipv6=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_ipv6=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_ipv6" >&5 +echo "${ECHO_T}$ac_cv_ipv6" >&6; } +if test $ac_cv_ipv6 = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define IPV6 1 +_ACEOF + +fi + + +# Check if sockaddr{} has sa_len member. +{ echo "$as_me:$LINENO: checking for struct sockaddr.sa_len" >&5 +echo $ECHO_N "checking for struct sockaddr.sa_len... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_sockaddr_sa_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +static struct sockaddr ac_aggr; +if (ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +static struct sockaddr ac_aggr; +if (sizeof ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_sockaddr_sa_len=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_sa_len" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sockaddr_sa_len" >&6; } +if test $ac_cv_member_struct_sockaddr_sa_len = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKADDR_SA_LEN 1 +_ACEOF + +fi + + +# check for win32 + if test "$host_os" = 'mingw32'; then + USING_WIN32_TRUE= + USING_WIN32_FALSE='#' +else + USING_WIN32_TRUE='#' + USING_WIN32_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile artnet/Makefile libartnet.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USING_WIN32_TRUE}" && test -z "${USING_WIN32_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USING_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USING_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "artnet/Makefile") CONFIG_FILES="$CONFIG_FILES artnet/Makefile" ;; + "libartnet.pc") CONFIG_FILES="$CONFIG_FILES libartnet.pc" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +LN_S!$LN_S$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ECHO!$ECHO$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +DLLTOOL!$DLLTOOL$ac_delim +AS!$AS$ac_delim +OBJDUMP!$OBJDUMP$ac_delim +CPP!$CPP$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +CXXCPP!$CXXCPP$ac_delim +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +USING_WIN32_TRUE!$USING_WIN32_TRUE$ac_delim +USING_WIN32_FALSE!$USING_WIN32_FALSE$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 11; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| . 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/open-lighting-architecture/libartnet-1.1.0/configure.in b/open-lighting-architecture/libartnet-1.1.0/configure.in new file mode 100644 index 0000000..51f2a55 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/configure.in @@ -0,0 +1,78 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(configure.in) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(libartnet, 1.1.0) + +# Checks for programs. +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_LIBTOOL_WIN32_DLL +AC_PROG_LIBTOOL + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([endian.h ppc/endian.h arpa/inet.h netinet/in.h stddef.h \ + stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h \ + unistd.hi linux/if_packet.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_HEADER_STDBOOL + +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_REALLOC +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([inet_ntoa inet_aton memset select socket strchr strdup \ + strerror getifaddrs]) + +# check for ipv6 support - taken from unp +AC_MSG_CHECKING(for IPv6 support) +AC_CACHE_VAL(ac_cv_ipv6, + AC_TRY_RUN([ +# include +# include +# include + /* Make sure the definitions for AF_INET6 and struct sockaddr_in6 + * are defined, and that we can actually create an IPv6 TCP socket. + */ + main() + { + int fd; + struct sockaddr_in6 foo; + fd = socket(AF_INET6, SOCK_STREAM, 0); + exit(fd >= 0 ? 0 : 1); + }], + ac_cv_ipv6=yes, + ac_cv_ipv6=no, + ac_cv_ipv6=no)) +AC_MSG_RESULT($ac_cv_ipv6) +if test $ac_cv_ipv6 = yes ; then + AC_DEFINE(IPV6, 1, Define to 1 if the system supports IPv6) +fi + + +# Check if sockaddr{} has sa_len member. +AC_CHECK_MEMBER([struct sockaddr.sa_len], + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, + define if socket address structures have length fields),, + [ +#include +#include ]) + +# check for win32 +AM_CONDITIONAL(USING_WIN32, test "$host_os" = 'mingw32') + +AC_OUTPUT(Makefile \ + artnet/Makefile \ + libartnet.pc) diff --git a/open-lighting-architecture/libartnet-1.1.0/depcomp b/open-lighting-architecture/libartnet-1.1.0/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/libartnet-1.1.0/install-sh b/open-lighting-architecture/libartnet-1.1.0/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/libartnet-1.1.0/libartnet.pc.in b/open-lighting-architecture/libartnet-1.1.0/libartnet.pc.in new file mode 100644 index 0000000..81b12cb --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/libartnet.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + + +Name: libartnet +Version: @VERSION@ +Description: libartnet +Requires: +Libs: -L${libdir} -lartnet +Cflags: -I${includedir}/libartnet diff --git a/open-lighting-architecture/libartnet-1.1.0/ltmain.sh b/open-lighting-architecture/libartnet-1.1.0/ltmain.sh new file mode 100644 index 0000000..06823e0 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/ltmain.sh @@ -0,0 +1,6863 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_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 $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/open-lighting-architecture/libartnet-1.1.0/missing b/open-lighting-architecture/libartnet-1.1.0/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/open-lighting-architecture/libartnet-1.1.0/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/AUTHORS b/open-lighting-architecture/ola-0.8.4/AUTHORS new file mode 100644 index 0000000..0f3326a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/AUTHORS @@ -0,0 +1,9 @@ +Please do not email the author directly, instead use +open-lighting@googlegroups.com + + +Primary author: + Simon Newton (nomis52@gmail.com) + +Contributors: + Bastien Andrès (dmx4linux plugin) diff --git a/open-lighting-architecture/ola-0.8.4/COPYING b/open-lighting-architecture/ola-0.8.4/COPYING new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/open-lighting-architecture/ola-0.8.4/ChangeLog b/open-lighting-architecture/ola-0.8.4/ChangeLog new file mode 100644 index 0000000..c153d11 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ChangeLog @@ -0,0 +1,79 @@ +11/21/2009 Simon Newton + * OLA v0.5.0 + +10/18/2009 Simon Newton + * OLA v0.4.0 + +8/26/2009 Simon Newton + * OLA v0.3.1 + +8/8/2009 Simon Newton + * OLA v0.3 + +14/10/2007 Simon Newton < + * refactored the plugins and cleaned up all the plugin code + * added 'enable' and 'debug' parameters for the plugins + * bugfixes to the python buildfiles + +15/9/2007 Simon Newton < + * fixed a memory leak + * fixed a bug in calling upload_plugins multiple times + * added the dmx4linux plugin + * fixed the bug that triggered on usb pro removal + +15/9/2007 Simon Newton < + * stageprofi plugin + * fixed the bug with the DMX USB Pro + +3/3/2007 Simon Newton < + * initial thread support in the client libraries + +26/2/2007 Simon Newton < + * Integrated the python libs into autotools + * Minor bugfix + * Wrote port patching regression tests + +16/2/2007 Simon Newton < + * reduced memory usage in plugins + * started on test framework + +14/1/2007 Simon Newton < + * Pathport plugin added + +13/1/2007 Simon Newton < + * Added a plugin for the Stage Profi USB Device + +1/1/2007 Simon Newton < + * fixed the problem on the USB Pro when changing modes + +30/12/2006 Simon Newton < + * Fixed the Usb Pro last-channel-corrupt bug + +30/12/2006 Simon Newton < + * Fixed problems so that it would acutally compile again + +25/12/2006 Simon Newton < + * universes now save names and merge mode + * fixed a bunch of memory leaks + +24/12/2006 Simon Newton < + * Got device config messages working + * Add configuration commands to the Pro Device + * Added universe merge capability + * Improved the tool to autogen protocol messages + * Added merge mode for universes with device sources (no client support yet) + +28/11/2006 Simon Newton < + * Started on a general RPC framework + * Changed the client to C++, events are now handled asynchronously + +27/4/2006 Simon Newton < + * Art-Net plugin bug fix + +17/4/2006 Simon Newton < + * Added support for multiple preference values per key + * Pro Plugin now supports multiple devices + +16/4/2006 Simon Newton < + * USR1 signals now used to change logging levels + diff --git a/open-lighting-architecture/ola-0.8.4/INSTALL b/open-lighting-architecture/ola-0.8.4/INSTALL new file mode 100644 index 0000000..7d1c323 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + 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, 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 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.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You 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: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. 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, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. 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. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +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. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 can use 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 `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer 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. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +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. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + 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'. + + 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. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +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 +`--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 + +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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +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 +================ + + 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. + +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 + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--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' + 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. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/open-lighting-architecture/ola-0.8.4/Makefile.am b/open-lighting-architecture/ola-0.8.4/Makefile.am new file mode 100644 index 0000000..4b1b2d8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/Makefile.am @@ -0,0 +1,13 @@ +auxdir = @ac_aux_dir@ +AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \ + $(auxdir)/mkinstalldirs + +SUBDIRS = include common ola plugins olad python tools debian + +EXTRA_DIST = README.rpm ola.spec + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libola.pc libolaserver.pc + +ACLOCAL = aclocal -I $(auxdir) +ACLOCAL_AMFLAGS = -I config diff --git a/open-lighting-architecture/ola-0.8.4/Makefile.in b/open-lighting-architecture/ola-0.8.4/Makefile.in new file mode 100644 index 0000000..108604a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/Makefile.in @@ -0,0 +1,699 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/libola.pc.in $(srcdir)/libolaserver.pc.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + TODO config/config.guess config/config.sub config/depcomp \ + config/install-sh config/ltmain.sh config/missing \ + config/py-compile +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = libola.pc libolaserver.pc +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = aclocal -I $(auxdir) +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +auxdir = @ac_aux_dir@ +AUX_DIST = $(auxdir)/install-sh $(auxdir)/missing \ + $(auxdir)/mkinstalldirs + +SUBDIRS = include common ola plugins olad python tools debian +EXTRA_DIST = README.rpm ola.spec +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libola.pc libolaserver.pc +ACLOCAL_AMFLAGS = -I config +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +libola.pc: $(top_builddir)/config.status $(srcdir)/libola.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libolaserver.pc: $(top_builddir)/config.status $(srcdir)/libolaserver.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) config.h +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-pkgconfigDATA + +# 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/open-lighting-architecture/ola-0.8.4/NEWS b/open-lighting-architecture/ola-0.8.4/NEWS new file mode 100644 index 0000000..4a4f9f1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/NEWS @@ -0,0 +1,130 @@ +19/10/2010 ola-0.8.4 + Add the RDM web UI + Work around an ArtNet RDM bug + Handle ACK overflow in the DMX-TRI + +23/9/2010 ola-0.8.3 + Add Manufacturer / Device name resolution to the web UI for RDM devices. + Fix a couple of compile bugs. + For each DMX-over-IP plugin, display the bound IP address in the device name. + Change the DMX console to send a packet every second even if nothing changes. + Fix a memory leak in the RDM controller + +19/9/2010 ola-0.8.2 + Moved the DMX Console to the new UI + Removed the old web UI, no more requirements for ctemplate + Added ACK_OVERFLOW support for RDM over ArtNet + Added Support for the last remaining E1.20 PIDS + Re-factored the Ola Client code to fix the problem of de-multiplexing + responses. + Add the OlaCallbackClient as the recommended C++ API + Moved the HTTP Server to using the OlaCallbackClient directly. + +2/9/2010 ola-0.8.1 + New web UI + Fixed some bugs in the device shutdown code + Fixed some compiler warnings with gcc 4.4 + +7/8/2010 ola-0.8.0 + Initial RDM support for the ArtNet, Dummy & DMX-TRI devices + New ArtNet stack to support RDM - no more dependency on libartnet + Support for packetheads DMX dongle + Make the FPS limit for USB Pro devices configurable + +20/5/2010 ola-0.7.4 + Fixed the python API + Fixed the client deadlock issue + Fixed the USBDMX2 firmware loading + Fixed ARM alignment bug in E1.31 + Fixed ambiguous errors when plugins were disabled + Added the /reload handler the reload plugins + Turn off SIGPIPEs + Clean up the streaming client API + Use the serial number to identify uDMX devices + +18/4/2010 ola-0.7.2 / 0.7.3 + Added support for the Velleman 8062 + Added support for the uDMX + Added support for the USBDMX2 + Added support for the DMXKing + Fixed a crash if olad was started while another instance was running + Random build fixes + +27/3/2010 ola-0.7.1 + Implemented the Usb Protocol Extensions + Added output rate throttling for the Usb Pro devices + Added the streaming DMX client + Fixed some uuid detection issues + Made the server more resistant to bad clients + ./configure script fixes + +28/2/2010 ola-0.7.0 + Added E1.31 merging & sequencing support + Improved USB Pro handling + Added port priorities & multi source merging + TX support for the DMX-TRI + Support for the Ardiuno RGB Mixer + DSCP for E1.31 + Support for using the OSSP uuid library + Removal of run-time loadable plugins. + +10/1/2010 ola-0.6.0 + Added Pathport support + Added support for the final version of the E1.31 Standard + Changed to link time plugins rather than run time (required for win32 port) + Cleanup of the dmx4linux plugin (thanks to Bastien) + Linted almost everything + Many more export map variables + Restructure of the Port class internals + +21/11/2009 ola-0.5.0 + Added Sandnet Support + Added automatic USB Pro device detection + Fixed a HTP merging bug + +18/10/2009 ola-0.4.0 + Added E1.13 Support + +26/8/2009 ola-0.3.1 + Fixed the open dmx usb off by one bug + Minor build tool fixes + +8/8/2009 ola-0.3.0 + Changed the name of the project to Open Lighting Architecture + Major rewrite + - added export_map + - added http server & web interface + - added web dmx console + - now works on mac + - converted to using protocol buffers + - supports embedding + - port patches persist across restarts + - plenty of unittests (more required) + +14/10/2007 lla-0.2.3 + Plugins can now be disabled from the config files + +14/9/2007 lla-0.2.2 + Fixed a bug with the DMX USB Pro + Refinements to the StageProfi plugin + +1/1/2007 lla-0.2.1 + Added support for the Stage Profi widget + Added Pathport support + +1/1/2007 lla-0.2.0 + Added Sandnet Support + Added Open DMX USB Support + Re-write of the client library + Added universe merge modes + Added persistent universe names and merge modes + Added device config messages + +27/4/2006 lla-0.1.3 + Bugfixes + +17/4/2006 lla-0.1.2 + Support for multiple Enttec Pro devices + Logging levels can be changed with -USR1 signals + + diff --git a/open-lighting-architecture/ola-0.8.4/README b/open-lighting-architecture/ola-0.8.4/README new file mode 100644 index 0000000..edce095 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/README @@ -0,0 +1,51 @@ +Open Lighting Architecture - OLA +=============================================================================== + +OLA consists of three parts, the daemon olad, the olad plugins and the client +library, libola. + +For documentation on OLA, including examples on how to get started please see +http://www.opendmx.net/index.php/OLA + + +Plugins +------------------------------------------------------------------------------ + +Are located in ./plugins. To create a new plugin you'll need to subclass the +Plugin, Device and Port classes. See any of the current plugins for an example. + + +C++ Library +------------------------------------------------------------------------------- + +Is located in ./ola . You'll want to create a new OlaClient and call start(). +To do anything useful you'll need to subclass OlaClientObserver and implement +some of the methods. + +If you have pthreads installed this library *should* be thread safe (currently +implemented with one big lock). + + +Libraries in Other Languages (Python) +------------------------------------------------------------------------------- + +There are experimental Python libraries you can build by running configure with +--enable-python-libs. For examples see the tests directory. + +The python library seems to be working well. Perl isn't supported as the +current version of SWIG doesn't support Perl directors. + + +Credits +------------------------------------------------------------------------------- + +Thanks to the following people/organisations: + + - Wayne and Simon from Artistic Licence for providing a Net-Lynx + - Nic from Enttec who provided a DMX USB Pro for testing. + - West Australian Academy of Performing Arts (WAAPA) for access to a Strand + console. + - Shaun Jackman from Pathway, for answering my questions about the Pathport + protocol + - Florian from eventa.ag who donated a StageProfi and a USBDMX2 + - Hamish Dumbreck for jese.co.uk who donated a DMX-TRI diff --git a/open-lighting-architecture/ola-0.8.4/README.rpm b/open-lighting-architecture/ola-0.8.4/README.rpm new file mode 100644 index 0000000..b512536 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/README.rpm @@ -0,0 +1,34 @@ +Instructions on how to build a RPM for Mandriva, this may work with other RPM +based distros. + +1. Install RPM build tools: + $ urpmi rpm-build libtool spec-helper + +2. Create the build environment: + $ mkdir -p ~/rpm/{BUILD,RPMS/{i586,noarch,x86_64},SOURCES,SRPMS,SPECS,tmp} + +3. Either download the latest tarball, or if you want to build a RPM from the + git repo: + $ cd /tmp + $ urpmi git + $ git clone http://www.nomis52.net/git/lla + $ cd lla + $ autoreconf -i -f && ./configure && make dist + $ cp ola-X.Y.Z.tar.gz ~/rpm/SOURCES/ + +4. Add Kev's repository to get latest libmicrohttpd and protobuf + (here for 64bits Mandriva 2009.1): + $ urpmi.addmedia --update kev-rpms \ + http://kev.coolcavemen.com/static/repository/mandriva/2009.1/x86_64 + + For more details, see http://kev.coolcavemen.com/mandriva-rpm-repository/ + +5. Install requires build dependencies of ola: + $ urpmi libmicrohttpd-devel libcppunit-devel protobuf-devel + +6. Build ola from the spec file: + $ cd ~/rpm/SPECS/ + $ cp /tmp/lla/ola/spec ./ + $ rpmbuild -ba ./ola.spec + +7. Et voila ! Your RPM is in ~/rpm/SPECS// ! diff --git a/open-lighting-architecture/ola-0.8.4/TODO b/open-lighting-architecture/ola-0.8.4/TODO new file mode 100644 index 0000000..2fb173d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/TODO @@ -0,0 +1,20 @@ + +See http://code.google.com/p/linux-lighting/issues/list + +--URGENT-- +resend DMX on idle (artnet every 4s) + +--REQUIRED-- + +* allow for finer grained channel control (set_block, set_channel) +* regression tests for plugins + +--WISH LIST-- + +* consider using filters: + o split dmx to different universes OUT = SPLIT(1,0,255) + o invert channels OUT = INV(1) + o different merge modes OUT = HTP(1,2) + o change offset / map OUT = OFFSET(1, +50) + o scaler (OUT = SCALE(1, %40) ) + o clip (OUT = CLIP(1,%80) ) diff --git a/open-lighting-architecture/ola-0.8.4/aclocal.m4 b/open-lighting-architecture/ola-0.8.4/aclocal.m4 new file mode 100644 index 0000000..31279cb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/aclocal.m4 @@ -0,0 +1,7435 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +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_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------------- +# Adds support for distributing Python modules and packages. To +# install modules, copy them to $(pythondir), using the python_PYTHON +# automake variable. To install a package with the same name as the +# automake package, install to $(pkgpythondir), or use the +# pkgpython_PYTHON automake variable. +# +# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as +# locations to install python extension modules (shared libraries). +# Another macro is required to find the appropriate flags to compile +# extension modules. +# +# If your package is configured with a different prefix to python, +# users will have to add the install directory to the PYTHONPATH +# environment variable, or create a .pth file (see the python +# documentation for details). +# +# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will +# cause an error if the version of python installed on the system +# doesn't meet the requirement. MINIMUM-VERSION should consist of +# numbers and dots only. +AC_DEFUN([AM_PATH_PYTHON], + [ + dnl Find a Python interpreter. Python versions prior to 1.5 are not + dnl supported because the default installation locations changed from + dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages + dnl in 1.5. + m4_define_default([_AM_PYTHON_INTERPRETER_LIST], + [python python2 python2.5 python2.4 python2.3 python2.2 dnl +python2.1 python2.0 python1.6 python1.5]) + + m4_if([$1],[],[ + dnl No version check is needed. + # Find any Python interpreter. + if test -z "$PYTHON"; then + AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) + fi + am_display_PYTHON=python + ], [ + dnl A version check is needed. + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + AC_MSG_CHECKING([whether $PYTHON version >= $1]) + AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR(too old)]) + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + AC_CACHE_CHECK([for a Python interpreter with version >= $1], + [am_cv_pathless_PYTHON],[ + for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do + test "$am_cv_pathless_PYTHON" = none && break + AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) + done]) + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + ]) + + if test "$PYTHON" = :; then + dnl Run any user-specified action, or abort. + m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) + else + + dnl Query Python for its version number. Getting [:3] seems to be + dnl the best way to do this; it's what "site.py" does in the standard + dnl library. + + AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], + [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) + AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) + + dnl Use the values of $prefix and $exec_prefix for the corresponding + dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made + dnl distinct variables so they can be overridden if need be. However, + dnl general consensus is that you shouldn't need this ability. + + AC_SUBST([PYTHON_PREFIX], ['${prefix}']) + AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) + + dnl At times (like when building shared libraries) you may want + dnl to know which OS platform Python thinks this is. + + AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], + [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) + AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) + + + dnl Set up 4 directories: + + dnl pythondir -- where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) + + dnl pkgpythondir -- $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + + AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) + + dnl pyexecdir -- directory for installing python extension modules + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) + + dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) + + AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) + + dnl Run any user-specified action. + $2 + fi + +]) + + +# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------------------- +# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. +# Run ACTION-IF-FALSE otherwise. +# This test uses sys.hexversion instead of the string equivalent (first +# word of sys.version), in order to cope with versions such as 2.2c1. +# hexversion has been introduced in Python 1.5.2; it's probably not +# worth to support older versions (1.5.1 was released on October 31, 1998). +AC_DEFUN([AM_PYTHON_CHECK_VERSION], + [prog="import sys, string +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] +sys.exit(sys.hexversion < minverhex)" + AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([config/cppunit.m4]) +m4_include([config/ola.m4]) +m4_include([config/pkg.m4]) diff --git a/open-lighting-architecture/ola-0.8.4/common.mk b/open-lighting-architecture/ola-0.8.4/common.mk new file mode 100644 index 0000000..db6c53c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common.mk @@ -0,0 +1 @@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated diff --git a/open-lighting-architecture/ola-0.8.4/common/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/Makefile.am new file mode 100644 index 0000000..ceb608e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/Makefile.am @@ -0,0 +1,11 @@ +lib_LTLIBRARIES = libolacommon.la +libolacommon_la_SOURCES = +libolacommon_la_LIBADD = export_map/libolaexportmap.la \ + logging/liblogging.la \ + protocol/libolaproto.la \ + rdm/libolardm.la \ + rpc/libstreamrpcchannel.la \ + network/libolanetwork.la \ + utils/libolautils.la + +SUBDIRS = export_map logging protocol rdm rpc network utils web diff --git a/open-lighting-architecture/ola-0.8.4/common/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/Makefile.in new file mode 100644 index 0000000..20b65e1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/Makefile.in @@ -0,0 +1,587 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = common +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolacommon_la_DEPENDENCIES = export_map/libolaexportmap.la \ + logging/liblogging.la protocol/libolaproto.la rdm/libolardm.la \ + rpc/libstreamrpcchannel.la network/libolanetwork.la \ + utils/libolautils.la +am_libolacommon_la_OBJECTS = +libolacommon_la_OBJECTS = $(am_libolacommon_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolacommon_la_SOURCES) +DIST_SOURCES = $(libolacommon_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +lib_LTLIBRARIES = libolacommon.la +libolacommon_la_SOURCES = +libolacommon_la_LIBADD = export_map/libolaexportmap.la \ + logging/liblogging.la \ + protocol/libolaproto.la \ + rdm/libolardm.la \ + rpc/libstreamrpcchannel.la \ + network/libolanetwork.la \ + utils/libolautils.la + +SUBDIRS = export_map logging protocol rdm rpc network utils web +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolacommon.la: $(libolacommon_la_OBJECTS) $(libolacommon_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libolacommon_la_OBJECTS) $(libolacommon_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMap.cpp b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMap.cpp new file mode 100644 index 0000000..41c8ac4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMap.cpp @@ -0,0 +1,205 @@ +/* + * 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 Library 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. + * + * ExportMap.cpp + * Exported Variables + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include "ola/ExportMap.h" +#include "ola/StringUtils.h" + +namespace ola { + +using std::string; +using std::stringstream; + + +/* + * Return the string representation of this map variable. + * The form is: + * var_name map:label_name key1:value1 key2:value2 + * @return the string representation of the variable. + */ +template +const string MapVariable::Value() const { + stringstream value; + value << "map:" << m_label; + typename map::const_iterator iter; + for (iter = m_variables.begin(); iter != m_variables.end(); ++iter) + value << " " << iter->first << ":" << iter->second; + return value.str(); +} + + +/* + * Strings need to be quoted + */ +template<> +const string MapVariable::Value() const { + stringstream value; + value << "map:" << m_label; + map::const_iterator iter; + for (iter = m_variables.begin(); iter != m_variables.end(); ++iter) { + std::string var = iter->second; + Escape(&var); + value << " " << iter->first << ":\"" << var << "\""; + } + return value.str(); +} + + +ExportMap::~ExportMap() { + DeleteVariables(&m_int_variables); + DeleteVariables(&m_counter_variables); + DeleteVariables(&m_string_variables); + DeleteVariables(&m_str_map_variables); + DeleteVariables(&m_uint_map_variables); + DeleteVariables(&m_int_map_variables); +} + + +/* + * Lookup or create an integer variable. + * @param name the name of this variable. + * @return an IntergerVariable + */ +IntegerVariable *ExportMap::GetIntegerVar(const string &name) { + return GetVar(&m_int_variables, name); +} + + +/* + * Lookup or create a counter variable. + * @param name the name of the variable. + * @return a CounterVariable. + */ +CounterVariable *ExportMap::GetCounterVar(const string &name) { + return GetVar(&m_counter_variables, name); +} + + +/* + * Lookup or create a string variable. + * @param name the name of the variable. + * @return a StringVariable. + */ +StringVariable *ExportMap::GetStringVar(const string &name) { + return GetVar(&m_string_variables, name); +} + + +/* + * Lookup or create a string map variable + * @param name the name of the variable + * @param label the label to use for the map (optional) + * @return a MapVariable + */ +StringMap *ExportMap::GetStringMapVar(const string &name, const string &label) { + return GetMapVar(&m_str_map_variables, name, label); +} + + +/* + * Lookup or create an int map variable + * @param name the name of the variable + * @param label the label to use for the map (optional) + * @return a MapVariable + */ +IntMap *ExportMap::GetIntMapVar(const string &name, const string &label) { + return GetMapVar(&m_int_map_variables, name, label); +} + + +/* + * Lookup or create an unsigned int map variable + * @param name the name of the variable + * @param label the label to use for the map (optional) + * @return a MapVariable + */ +UIntMap *ExportMap::GetUIntMapVar(const string &name, const string &label) { + return GetMapVar(&m_uint_map_variables, name, label); +} + + +/* + * Return a list of all variables. + * @return a vector of all variables. + */ +vector ExportMap::AllVariables() const { + vector variables; + AddVariablesToVector(&variables, m_int_variables); + AddVariablesToVector(&variables, m_counter_variables); + AddVariablesToVector(&variables, m_string_variables); + AddVariablesToVector(&variables, m_str_map_variables); + AddVariablesToVector(&variables, m_int_map_variables); + AddVariablesToVector(&variables, m_uint_map_variables); + + sort(variables.begin(), variables.end(), VariableLessThan()); + return variables; +} + + +template +Type *ExportMap::GetVar(map *var_map, const string &name) { + typename map::iterator iter; + iter = var_map->find(name); + + if (iter == var_map->end()) { + Type *var = new Type(name); + (*var_map)[name] = var; + return var; + } + return iter->second; +} + + +template +Type *ExportMap::GetMapVar(map *var_map, + const string &name, + const string &label) { + typename map::iterator iter; + iter = var_map->find(name); + + if (iter == var_map->end()) { + Type *var = new Type(name, label); + (*var_map)[name] = var; + return var; + } + return iter->second; +} + +template +void ExportMap::AddVariablesToVector(vector *variables, + const Type &var_map) const { + typename Type::const_iterator iter; + for (iter = var_map.begin(); iter != var_map.end(); ++iter) + variables->push_back(iter->second); +} + + +template +void ExportMap::DeleteVariables(Type *var_map) const { + typename Type::const_iterator iter; + for (iter = var_map->begin(); iter != var_map->end(); iter++) + delete iter->second; + var_map->clear(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTest.cpp b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTest.cpp new file mode 100644 index 0000000..3e03b3a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTest.cpp @@ -0,0 +1,216 @@ +/* + * 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 Library 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. + * + * ExportMap.cpp + * Test fixture for the ExportMap and Variable classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +#include "ola/ExportMap.h" + +using ola::BaseVariable; +using ola::CounterVariable; +using ola::ExportMap; +using ola::IntMap; +using ola::IntegerVariable; +using ola::StringMap; +using ola::StringVariable; +using std::string; +using std::vector; + + +class ExportMapTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ExportMapTest); + CPPUNIT_TEST(testIntegerVariable); + CPPUNIT_TEST(testCounterVariable); + CPPUNIT_TEST(testStringVariable); + CPPUNIT_TEST(testStringMapVariable); + CPPUNIT_TEST(testIntMapVariable); + CPPUNIT_TEST(testExportMap); + CPPUNIT_TEST_SUITE_END(); + + public: + void testIntegerVariable(); + void testCounterVariable(); + void testStringVariable(); + void testStringMapVariable(); + void testIntMapVariable(); + void testExportMap(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(ExportMapTest); + + +/* + * Check that the IntegerVariable works correctly. + */ +void ExportMapTest::testIntegerVariable() { + string name = "foo"; + IntegerVariable var(name); + + CPPUNIT_ASSERT_EQUAL(var.Name(), name); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("0")); + CPPUNIT_ASSERT_EQUAL(var.Get(), 0); + var++; + CPPUNIT_ASSERT_EQUAL(var.Get(), 1); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("1")); + var--; + CPPUNIT_ASSERT_EQUAL(var.Get(), 0); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("0")); + var.Set(100); + CPPUNIT_ASSERT_EQUAL(var.Get(), 100); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("100")); +} + + +/* + * Check that the CounterVariable works correctly. + */ +void ExportMapTest::testCounterVariable() { + string name = "foo"; + CounterVariable var(name); + + CPPUNIT_ASSERT_EQUAL(var.Name(), name); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("0")); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, var.Get()); + var++; + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, var.Get()); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("1")); + var += 10; + CPPUNIT_ASSERT_EQUAL((unsigned int) 11, var.Get()); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("11")); + var += 100; + CPPUNIT_ASSERT_EQUAL((unsigned int) 111, var.Get()); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("111")); +} + + +/* + * Check that the StringVariable works correctly. + */ +void ExportMapTest::testStringVariable() { + string name = "foo"; + StringVariable var(name); + + CPPUNIT_ASSERT_EQUAL(var.Name(), name); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("")); + CPPUNIT_ASSERT_EQUAL(var.Get(), string("")); + var.Set("bar"); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("bar")); + CPPUNIT_ASSERT_EQUAL(var.Get(), string("bar")); +} + + +/* + * Check that the StringMap works correctly. + */ +void ExportMapTest::testStringMapVariable() { + string name = "foo"; + string label = "count"; + StringMap var(name, label); + + CPPUNIT_ASSERT_EQUAL(var.Name(), name); + CPPUNIT_ASSERT_EQUAL(var.Label(), label); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count")); + + string key1 = "key1"; + string value1 = "value1"; + var[key1] = value1; + CPPUNIT_ASSERT_EQUAL(value1, var[key1]); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:\"value1\"")); + + string key2 = "key2"; + string value2 = "value 2"; + var[key2] = value2; + CPPUNIT_ASSERT_EQUAL(value2, var[key2]); + CPPUNIT_ASSERT_EQUAL(var.Value(), + string("map:count key1:\"value1\" key2:\"value 2\"")); + + var.Remove(key1); + CPPUNIT_ASSERT_EQUAL(string(""), var[key1]); + var.Remove(key1); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:\"value 2\"")); + var[key2] = "foo\""; + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:\"foo\\\"\"")); +} + + +/* + * Check that the IntMap works correctly. + */ +void ExportMapTest::testIntMapVariable() { + string name = "foo"; + string label = "count"; + IntMap var(name, label); + + CPPUNIT_ASSERT_EQUAL(var.Name(), name); + CPPUNIT_ASSERT_EQUAL(var.Label(), label); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count")); + + string key1 = "key1"; + var[key1] = 100; + CPPUNIT_ASSERT_EQUAL(100, var[key1]); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:100")); + + string key2 = "key2"; + var[key2] = 99; + CPPUNIT_ASSERT_EQUAL(99, var[key2]); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key1:100 key2:99")); + + var.Remove(key1); + CPPUNIT_ASSERT_EQUAL(0, var[key1]); + var.Remove(key1); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key2:99")); + var.Remove(key2); + + // check references work + string key3 = "key3"; + int &var1 = var[key3]; + CPPUNIT_ASSERT_EQUAL(0, var1); + var1++; + CPPUNIT_ASSERT_EQUAL(1, var[key3]); + CPPUNIT_ASSERT_EQUAL(var.Value(), string("map:count key3:1")); +} + +/* + * Check the export map works correctly. + */ +void ExportMapTest::testExportMap() { + ExportMap map; + string int_var_name = "int_var"; + string str_var_name = "str_var"; + string map_var_name = "map_var"; + string map_var_label = "label"; + IntegerVariable *int_var = map.GetIntegerVar(int_var_name); + StringVariable *str_var = map.GetStringVar(str_var_name); + StringMap *map_var = map.GetStringMapVar(map_var_name, map_var_label); + + CPPUNIT_ASSERT_EQUAL(int_var->Name(), int_var_name); + CPPUNIT_ASSERT_EQUAL(str_var->Name(), str_var_name); + CPPUNIT_ASSERT_EQUAL(map_var->Name(), map_var_name); + CPPUNIT_ASSERT_EQUAL(map_var->Label(), map_var_label); + + map_var = map.GetStringMapVar(map_var_name); + CPPUNIT_ASSERT_EQUAL(map_var->Name(), map_var_name); + CPPUNIT_ASSERT_EQUAL(map_var->Label(), map_var_label); + + vector variables = map.AllVariables(); + CPPUNIT_ASSERT_EQUAL(variables.size(), (size_t) 3); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTester.cpp b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTester.cpp new file mode 100644 index 0000000..31a76e5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/export_map/ExportMapTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * ExportMapTester.h + * Runs all the export map tests + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.am new file mode 100644 index 0000000..125988e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = libolaexportmap.la +libolaexportmap_la_SOURCES = ExportMap.cpp + +TESTS = ExportMapTester +check_PROGRAMS = $(TESTS) +ExportMapTester_SOURCES = ExportMapTester.cpp ExportMapTest.cpp +ExportMapTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +ExportMapTester_LDFLAGS = $(CPPUNIT_LIBS) +ExportMapTester_LDADD = ./libolaexportmap.la ../utils/libolautils.la diff --git a/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.in new file mode 100644 index 0000000..b2b46c7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/export_map/Makefile.in @@ -0,0 +1,595 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = ExportMapTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/export_map +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolaexportmap_la_LIBADD = +am_libolaexportmap_la_OBJECTS = ExportMap.lo +libolaexportmap_la_OBJECTS = $(am_libolaexportmap_la_OBJECTS) +am__EXEEXT_1 = ExportMapTester$(EXEEXT) +am_ExportMapTester_OBJECTS = \ + ExportMapTester-ExportMapTester.$(OBJEXT) \ + ExportMapTester-ExportMapTest.$(OBJEXT) +ExportMapTester_OBJECTS = $(am_ExportMapTester_OBJECTS) +ExportMapTester_DEPENDENCIES = ./libolaexportmap.la \ + ../utils/libolautils.la +ExportMapTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) \ + $(ExportMapTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaexportmap_la_SOURCES) $(ExportMapTester_SOURCES) +DIST_SOURCES = $(libolaexportmap_la_SOURCES) \ + $(ExportMapTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libolaexportmap.la +libolaexportmap_la_SOURCES = ExportMap.cpp +ExportMapTester_SOURCES = ExportMapTester.cpp ExportMapTest.cpp +ExportMapTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +ExportMapTester_LDFLAGS = $(CPPUNIT_LIBS) +ExportMapTester_LDADD = ./libolaexportmap.la ../utils/libolautils.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/export_map/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/export_map/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaexportmap.la: $(libolaexportmap_la_OBJECTS) $(libolaexportmap_la_DEPENDENCIES) + $(CXXLINK) $(libolaexportmap_la_OBJECTS) $(libolaexportmap_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +ExportMapTester$(EXEEXT): $(ExportMapTester_OBJECTS) $(ExportMapTester_DEPENDENCIES) + @rm -f ExportMapTester$(EXEEXT) + $(ExportMapTester_LINK) $(ExportMapTester_OBJECTS) $(ExportMapTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMapTester-ExportMapTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExportMapTester-ExportMapTester.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +ExportMapTester-ExportMapTester.o: ExportMapTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTester.o -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo -c -o ExportMapTester-ExportMapTester.o `test -f 'ExportMapTester.cpp' || echo '$(srcdir)/'`ExportMapTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo $(DEPDIR)/ExportMapTester-ExportMapTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTester.cpp' object='ExportMapTester-ExportMapTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTester.o `test -f 'ExportMapTester.cpp' || echo '$(srcdir)/'`ExportMapTester.cpp + +ExportMapTester-ExportMapTester.obj: ExportMapTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTester.obj -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo -c -o ExportMapTester-ExportMapTester.obj `if test -f 'ExportMapTester.cpp'; then $(CYGPATH_W) 'ExportMapTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTester.Tpo $(DEPDIR)/ExportMapTester-ExportMapTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTester.cpp' object='ExportMapTester-ExportMapTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTester.obj `if test -f 'ExportMapTester.cpp'; then $(CYGPATH_W) 'ExportMapTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTester.cpp'; fi` + +ExportMapTester-ExportMapTest.o: ExportMapTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTest.o -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo -c -o ExportMapTester-ExportMapTest.o `test -f 'ExportMapTest.cpp' || echo '$(srcdir)/'`ExportMapTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo $(DEPDIR)/ExportMapTester-ExportMapTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTest.cpp' object='ExportMapTester-ExportMapTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTest.o `test -f 'ExportMapTest.cpp' || echo '$(srcdir)/'`ExportMapTest.cpp + +ExportMapTester-ExportMapTest.obj: ExportMapTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -MT ExportMapTester-ExportMapTest.obj -MD -MP -MF $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo -c -o ExportMapTester-ExportMapTest.obj `if test -f 'ExportMapTest.cpp'; then $(CYGPATH_W) 'ExportMapTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ExportMapTester-ExportMapTest.Tpo $(DEPDIR)/ExportMapTester-ExportMapTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ExportMapTest.cpp' object='ExportMapTester-ExportMapTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ExportMapTester_CXXFLAGS) $(CXXFLAGS) -c -o ExportMapTester-ExportMapTest.obj `if test -f 'ExportMapTest.cpp'; then $(CYGPATH_W) 'ExportMapTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ExportMapTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/logging/Logging.cpp b/open-lighting-architecture/ola-0.8.4/common/logging/Logging.cpp new file mode 100644 index 0000000..d94aab5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/logging/Logging.cpp @@ -0,0 +1,197 @@ +/* + * 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 Library 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. + * + * Logging.cpp + * The logging functions. See include/ola/Logging.h for details on how to use + * these. + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifdef WIN32 +#include +#else +#include +#endif + +#include +#include +#include "ola/Logging.h" + +namespace ola { + +using std::string; +using std::ostringstream; + +LogDestination *log_target = NULL; +log_level logging_level = OLA_LOG_WARN; + +/* + * Set the log level. + * @param level the new log level + */ +void SetLogLevel(log_level level) { + logging_level = level; +} + +/* + * Increment the log level, We reset to OLA_LOG_FATAL when we wrap. + */ +void IncrementLogLevel() { + logging_level = (log_level) (logging_level + 1); + if (logging_level == OLA_LOG_MAX) + logging_level = OLA_LOG_NONE; +} + + + +/* + * Init the logging system. + * @param level the log level + * @param output the log output + */ +bool InitLogging(log_level level, log_output output) { + LogDestination *destination; + if (output == OLA_LOG_SYSLOG) { + SyslogDestination *syslog_dest = new SyslogDestination(); + if (!syslog_dest->Init()) { + delete syslog_dest; + return false; + } + destination = syslog_dest; + } else if (output == OLA_LOG_STDERR) { + destination = new StdErrorLogDestination(); + } else { + destination = NULL; + } + InitLogging(level, destination); + return true; +} + + +/* + * Init the logging system. + * @param level the log level + * @param destination A LogDestination object + */ +void InitLogging(log_level level, LogDestination *destination) { + SetLogLevel(level); + log_target = destination; +} + + +LogLine::LogLine(const char *file, + int line, + log_level level): + m_level(level), + m_stream(ostringstream::out) { + m_stream << file << ":" << line << ": "; + m_prefix_length = m_stream.str().length(); +} + +LogLine::~LogLine() { + Write(); +} + +void LogLine::Write() { + if (m_stream.str().length() == m_prefix_length) + return; + + if (m_level > logging_level) + return; + + string line = m_stream.str(); + + if (line.at(line.length() - 1) != '\n') + line.append("\n"); + + if (log_target) + log_target->Write(m_level, line); +} + +void StdErrorLogDestination::Write(log_level level, const string &log_line) { + std::cerr << log_line; + (void) level; +} + + +bool SyslogDestination::Init() { +#ifdef WIN32 + m_eventlog = RegisterEventSourceA(NULL, "OLA"); + if (!m_eventlog) { + printf("Failed to initialize event logging\n"); + return false; + } +#endif + return true; +} + + +/* + * Write a line to the system logger. This is syslog on *nix or the event log + * on widnows + */ +void SyslogDestination::Write(log_level level, const string &log_line) { +#ifdef WIN32 + WORD pri; + const char* strings[1]; + strings[0] = log_line.data(); + + switch (level) { + case OLA_LOG_FATAL: + pri = EVENTLOG_ERROR_TYPE; + break; + case OLA_LOG_WARN: + pri = EVENTLOG_WARNING_TYPE; + break; + case OLA_LOG_INFO: + pri = EVENTLOG_INFORMATION_TYPE; + break; + case OLA_LOG_DEBUG: + pri = EVENTLOG_INFORMATION_TYPE; + break; + default: + pri = EVENTLOG_INFORMATION_TYPE; + } + ReportEventA(m_eventlog, + pri, + (WORD) NULL, + (DWORD) NULL, + NULL, + 1, + 0, + strings, + NULL); +#else + int pri; + switch (level) { + case OLA_LOG_FATAL: + pri = LOG_CRIT; + break; + case OLA_LOG_WARN: + pri = LOG_WARNING; + break; + case OLA_LOG_INFO: + pri = LOG_INFO; + break; + case OLA_LOG_DEBUG: + pri = LOG_DEBUG; + break; + default : + pri = LOG_INFO; + } + syslog(pri, "%s", log_line.data()); +#endif +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTest.cpp b/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTest.cpp new file mode 100644 index 0000000..65b8618 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTest.cpp @@ -0,0 +1,124 @@ +/* + * 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 Library 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. + * + * LoggingTest.cpp + * Test fixture for the Logging framework + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include "ola/Logging.h" +#include "ola/StringUtils.h" + +using std::deque; +using std::vector; +using std::string; +using ola::IncrementLogLevel; +using ola::log_level; + + +class LoggingTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(LoggingTest); + CPPUNIT_TEST(testLogging); + CPPUNIT_TEST_SUITE_END(); + + public: + void testLogging(); +}; + + +class MockLogDestination: public ola::LogDestination { + public: + void AddExpected(log_level level, string log_line); + void Write(log_level level, const string &log_line); + int LinesRemaining() const { return m_log_lines.size(); } + private: + deque > m_log_lines; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(LoggingTest); + + +void MockLogDestination::AddExpected(log_level level, string log_line) { + std::pair expected_result(level, log_line); + m_log_lines.push_back(expected_result); +} + + +/* + * Check that what gets written is what we expected + */ +void MockLogDestination::Write(log_level level, const string &log_line) { + vector tokens; + ola::StringSplit(log_line, tokens, ":"); + vector::iterator iter; + CPPUNIT_ASSERT_EQUAL(tokens.size() , (size_t) 3); + CPPUNIT_ASSERT(m_log_lines.size() > 0); + std::pair expected_result = m_log_lines.at(0); + m_log_lines.pop_front(); + CPPUNIT_ASSERT_EQUAL(expected_result.first, level); + CPPUNIT_ASSERT_EQUAL(expected_result.second, tokens.at(2)); +} + +/* + * Check that logging works correctly. + */ +void LoggingTest::testLogging() { + MockLogDestination *destination = new MockLogDestination(); + InitLogging(ola::OLA_LOG_DEBUG, destination); + destination->AddExpected(ola::OLA_LOG_DEBUG, " debug\n"); + OLA_DEBUG << "debug"; + destination->AddExpected(ola::OLA_LOG_INFO, " info\n"); + OLA_INFO << "info"; + destination->AddExpected(ola::OLA_LOG_WARN, " warn\n"); + OLA_WARN << "warn"; + destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n"); + OLA_FATAL << "fatal"; + + // Now make sure nothing below WARN is logged + ola::SetLogLevel(ola::OLA_LOG_WARN); + OLA_DEBUG << "debug"; + OLA_INFO << "info"; + destination->AddExpected(ola::OLA_LOG_WARN, " warn\n"); + OLA_WARN << "warn"; + destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n"); + OLA_FATAL << "fatal"; + CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0); + + // set the log level to INFO + IncrementLogLevel(); + OLA_DEBUG << "debug"; + destination->AddExpected(ola::OLA_LOG_INFO, " info\n"); + OLA_INFO << "info"; + destination->AddExpected(ola::OLA_LOG_WARN, " warn\n"); + OLA_WARN << "warn"; + destination->AddExpected(ola::OLA_LOG_FATAL, " fatal\n"); + OLA_FATAL << "fatal"; + CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0); + + IncrementLogLevel(); + // this should wrap to NONE + IncrementLogLevel(); + OLA_DEBUG << "debug"; + OLA_INFO << "info"; + OLA_WARN << "warn"; + OLA_FATAL << "fatal"; + CPPUNIT_ASSERT_EQUAL(destination->LinesRemaining(), 0); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTester.cpp b/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTester.cpp new file mode 100644 index 0000000..ddc4436 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/logging/LoggingTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * LoggingTester.h + * Runs all the Logging tests + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), + std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.am new file mode 100644 index 0000000..38f4474 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.am @@ -0,0 +1,12 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = liblogging.la +liblogging_la_SOURCES = Logging.cpp + +TESTS = LoggingTester +check_PROGRAMS = $(TESTS) + +LoggingTester_SOURCES = LoggingTester.cpp LoggingTest.cpp +LoggingTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +LoggingTester_LDFLAGS = $(CPPUNIT_LIBS) +LoggingTester_LDADD = ./liblogging.la ../utils/libolautils.la diff --git a/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.in new file mode 100644 index 0000000..dde023e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/logging/Makefile.in @@ -0,0 +1,591 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = LoggingTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/logging +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +liblogging_la_LIBADD = +am_liblogging_la_OBJECTS = Logging.lo +liblogging_la_OBJECTS = $(am_liblogging_la_OBJECTS) +am__EXEEXT_1 = LoggingTester$(EXEEXT) +am_LoggingTester_OBJECTS = LoggingTester-LoggingTester.$(OBJEXT) \ + LoggingTester-LoggingTest.$(OBJEXT) +LoggingTester_OBJECTS = $(am_LoggingTester_OBJECTS) +LoggingTester_DEPENDENCIES = ./liblogging.la ../utils/libolautils.la +LoggingTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(LoggingTester_CXXFLAGS) \ + $(CXXFLAGS) $(LoggingTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liblogging_la_SOURCES) $(LoggingTester_SOURCES) +DIST_SOURCES = $(liblogging_la_SOURCES) $(LoggingTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = liblogging.la +liblogging_la_SOURCES = Logging.cpp +LoggingTester_SOURCES = LoggingTester.cpp LoggingTest.cpp +LoggingTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +LoggingTester_LDFLAGS = $(CPPUNIT_LIBS) +LoggingTester_LDADD = ./liblogging.la ../utils/libolautils.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/logging/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/logging/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liblogging.la: $(liblogging_la_OBJECTS) $(liblogging_la_DEPENDENCIES) + $(CXXLINK) $(liblogging_la_OBJECTS) $(liblogging_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +LoggingTester$(EXEEXT): $(LoggingTester_OBJECTS) $(LoggingTester_DEPENDENCIES) + @rm -f LoggingTester$(EXEEXT) + $(LoggingTester_LINK) $(LoggingTester_OBJECTS) $(LoggingTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Logging.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LoggingTester-LoggingTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LoggingTester-LoggingTester.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +LoggingTester-LoggingTester.o: LoggingTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTester.o -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTester.Tpo -c -o LoggingTester-LoggingTester.o `test -f 'LoggingTester.cpp' || echo '$(srcdir)/'`LoggingTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTester.Tpo $(DEPDIR)/LoggingTester-LoggingTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTester.cpp' object='LoggingTester-LoggingTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTester.o `test -f 'LoggingTester.cpp' || echo '$(srcdir)/'`LoggingTester.cpp + +LoggingTester-LoggingTester.obj: LoggingTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTester.obj -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTester.Tpo -c -o LoggingTester-LoggingTester.obj `if test -f 'LoggingTester.cpp'; then $(CYGPATH_W) 'LoggingTester.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTester.Tpo $(DEPDIR)/LoggingTester-LoggingTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTester.cpp' object='LoggingTester-LoggingTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTester.obj `if test -f 'LoggingTester.cpp'; then $(CYGPATH_W) 'LoggingTester.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTester.cpp'; fi` + +LoggingTester-LoggingTest.o: LoggingTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTest.o -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTest.Tpo -c -o LoggingTester-LoggingTest.o `test -f 'LoggingTest.cpp' || echo '$(srcdir)/'`LoggingTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTest.Tpo $(DEPDIR)/LoggingTester-LoggingTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTest.cpp' object='LoggingTester-LoggingTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTest.o `test -f 'LoggingTest.cpp' || echo '$(srcdir)/'`LoggingTest.cpp + +LoggingTester-LoggingTest.obj: LoggingTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -MT LoggingTester-LoggingTest.obj -MD -MP -MF $(DEPDIR)/LoggingTester-LoggingTest.Tpo -c -o LoggingTester-LoggingTest.obj `if test -f 'LoggingTest.cpp'; then $(CYGPATH_W) 'LoggingTest.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/LoggingTester-LoggingTest.Tpo $(DEPDIR)/LoggingTester-LoggingTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='LoggingTest.cpp' object='LoggingTester-LoggingTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(LoggingTester_CXXFLAGS) $(CXXFLAGS) -c -o LoggingTester-LoggingTest.obj `if test -f 'LoggingTest.cpp'; then $(CYGPATH_W) 'LoggingTest.cpp'; else $(CYGPATH_W) '$(srcdir)/LoggingTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/network/InterfacePicker.cpp b/open-lighting-architecture/ola-0.8.4/common/network/InterfacePicker.cpp new file mode 100644 index 0000000..79dff7d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/InterfacePicker.cpp @@ -0,0 +1,125 @@ +/* + * 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 Library 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. + * + * InterfacePicker.cpp + * Chooses an interface to listen on + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/NetworkUtils.h" + +#ifdef WIN32 +#include "common/network/WindowsInterfacePicker.h" +#else +#include "common/network/PosixInterfacePicker.h" +#endif + +namespace ola { +namespace network { + +using std::string; +using std::vector; + + +Interface::Interface() { + ip_address.s_addr = 0; + bcast_address.s_addr = 0; + subnet_address.s_addr = 0; + memset(hw_address, 0, MAC_LENGTH); +} + + +Interface::Interface(const Interface &other) { + name = other.name; + ip_address = other.ip_address; + bcast_address = other.bcast_address; + subnet_address = other.subnet_address; + memcpy(hw_address, other.hw_address, MAC_LENGTH); +} + + +Interface& Interface::operator=(const Interface &other) { + if (this != &other) { + name = other.name; + ip_address = other.ip_address; + bcast_address = other.bcast_address; + subnet_address = other.subnet_address; + memcpy(hw_address, other.hw_address, MAC_LENGTH); + } + return *this; +} + + +bool Interface::operator==(const Interface &other) { + return (name == other.name && + ip_address.s_addr == other.ip_address.s_addr && + subnet_address.s_addr == other.subnet_address.s_addr); +} + + +/* + * Select an interface to use + * @param interface, the interface to populate + * @param preferred_ip the ip address of the local interface we'd prefer to use + * @return true if we found an interface, false otherwise + */ +bool InterfacePicker::ChooseInterface(Interface *iface, + const string &preferred_ip) const { + struct in_addr wanted_ip; + bool use_preferred = false; + vector interfaces = GetInterfaces(); + + if (!interfaces.size()) { + OLA_INFO << "No interfaces found"; + return false; + } + + if (!preferred_ip.empty()) { + if (StringToAddress(preferred_ip, wanted_ip)) + use_preferred = true; + } + + if (use_preferred) { + vector::const_iterator iter; + for (iter = interfaces.begin(); iter != interfaces.end(); ++iter) { + if ((*iter).ip_address.s_addr == wanted_ip.s_addr) { + *iface = *iter; + return true; + } + } + } + *iface = interfaces[0]; + return true; +} + + +/* + * Create the appropriate picker + */ +InterfacePicker *InterfacePicker::NewPicker() { +#ifdef WIN32 + return new WindowsInterfacePicker(); +#else + return new PosixInterfacePicker(); +#endif +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/InterfacePickerTest.cpp b/open-lighting-architecture/ola-0.8.4/common/network/InterfacePickerTest.cpp new file mode 100644 index 0000000..831bacc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/InterfacePickerTest.cpp @@ -0,0 +1,116 @@ +/* + * 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 Library 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. + * + * InterfacePickerTest.cpp + * Test fixture for the InterfacePicker class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/network/InterfacePicker.h" +#include "ola/network/NetworkUtils.h" +#include "ola/Logging.h" + +using ola::network::InterfacePicker; +using ola::network::Interface; +using ola::network::StringToAddress; +using std::vector; +using std::cout; +using std::endl; + +class InterfacePickerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(InterfacePickerTest); + CPPUNIT_TEST(testGetInterfaces); + CPPUNIT_TEST(testChooseInterface); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetInterfaces(); + void testChooseInterface(); +}; + +class MockPicker: public InterfacePicker { + public: + explicit MockPicker(const vector &interfaces) + : InterfacePicker(), + m_interfaces(interfaces) {} + std::vector GetInterfaces() const { return m_interfaces; } + private: + const vector &m_interfaces; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(InterfacePickerTest); + + +/* + * Check that we find at least one candidate interface. + */ +void InterfacePickerTest::testGetInterfaces() { + InterfacePicker *picker = InterfacePicker::NewPicker(); + vector interfaces = picker->GetInterfaces(); + CPPUNIT_ASSERT(interfaces.size() > 0); + + vector::iterator iter; + cout << endl; + for (iter = interfaces.begin(); iter != interfaces.end(); ++iter) { + cout << iter->name << endl; + cout << " ip: " << inet_ntoa(iter->ip_address) << endl; + cout << " bcast: " << inet_ntoa(iter->bcast_address) << endl; + cout << " subnet: " << inet_ntoa(iter->subnet_address) << endl; + cout << " hw_addr: "; + for (unsigned int i = 0; i < ola::network::MAC_LENGTH; i++) { + if (i) + cout << ':'; + cout << std::setw(2) << std::setfill('0') << std::hex << + 0 + (uint8_t) iter->hw_address[i]; + } + cout << endl; + cout << "---------------" << endl; + } + delete picker; +} + + +void InterfacePickerTest::testChooseInterface() { + vector interfaces; + MockPicker picker(interfaces); + + // no interfaces + Interface interface; + CPPUNIT_ASSERT(!picker.ChooseInterface(&interface, "")); + + // now with one interface that doesn't match + Interface iface1; + StringToAddress("10.0.0.1", iface1.ip_address); + interfaces.push_back(iface1); + CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "192.168.1.1")); + CPPUNIT_ASSERT(iface1 == interface); + + // check that preferred works + Interface iface2; + StringToAddress("192.168.1.1", iface2.ip_address); + interfaces.push_back(iface2); + CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "192.168.1.1")); + CPPUNIT_ASSERT(iface2 == interface); + + // a invalid address should return the first one + CPPUNIT_ASSERT(picker.ChooseInterface(&interface, "foo")); + CPPUNIT_ASSERT(iface1 == interface); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/network/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/network/Makefile.am new file mode 100644 index 0000000..e13c723 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/Makefile.am @@ -0,0 +1,25 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = libolanetwork.la +libolanetwork_la_SOURCES = InterfacePicker.cpp NetworkUtils.cpp \ + SelectServer.cpp Socket.cpp + +if USING_WIN32 +libolanetwork_la_SOURCES += WindowsInterfacePicker.cpp +else +libolanetwork_la_SOURCES += PosixInterfacePicker.cpp +endif + +EXTRA_DIST = PosixInterfacePicker.h WindowsInterfacePicker.h + +TESTS = NetworkTester +check_PROGRAMS = $(TESTS) +NetworkTester_SOURCES = SelectServerTester.cpp SocketTest.cpp \ + NetworkTest.cpp NetworkUtilsTest.cpp \ + InterfacePickerTest.cpp +NetworkTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +NetworkTester_LDFLAGS = $(CPPUNIT_LIBS) +NetworkTester_LDADD = ./libolanetwork.la \ + ../export_map/libolaexportmap.la \ + ../logging/liblogging.la \ + ../utils/libolautils.la diff --git a/open-lighting-architecture/ola-0.8.4/common/network/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/network/Makefile.in new file mode 100644 index 0000000..6ed9fc6 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/Makefile.in @@ -0,0 +1,664 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +@USING_WIN32_TRUE@am__append_1 = WindowsInterfacePicker.cpp +@USING_WIN32_FALSE@am__append_2 = PosixInterfacePicker.cpp +TESTS = NetworkTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/network +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolanetwork_la_LIBADD = +am__libolanetwork_la_SOURCES_DIST = InterfacePicker.cpp \ + NetworkUtils.cpp SelectServer.cpp Socket.cpp \ + WindowsInterfacePicker.cpp PosixInterfacePicker.cpp +@USING_WIN32_TRUE@am__objects_1 = WindowsInterfacePicker.lo +@USING_WIN32_FALSE@am__objects_2 = PosixInterfacePicker.lo +am_libolanetwork_la_OBJECTS = InterfacePicker.lo NetworkUtils.lo \ + SelectServer.lo Socket.lo $(am__objects_1) $(am__objects_2) +libolanetwork_la_OBJECTS = $(am_libolanetwork_la_OBJECTS) +am__EXEEXT_1 = NetworkTester$(EXEEXT) +am_NetworkTester_OBJECTS = NetworkTester-SelectServerTester.$(OBJEXT) \ + NetworkTester-SocketTest.$(OBJEXT) \ + NetworkTester-NetworkTest.$(OBJEXT) \ + NetworkTester-NetworkUtilsTest.$(OBJEXT) \ + NetworkTester-InterfacePickerTest.$(OBJEXT) +NetworkTester_OBJECTS = $(am_NetworkTester_OBJECTS) +NetworkTester_DEPENDENCIES = ./libolanetwork.la \ + ../export_map/libolaexportmap.la ../logging/liblogging.la \ + ../utils/libolautils.la +NetworkTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(NetworkTester_CXXFLAGS) \ + $(CXXFLAGS) $(NetworkTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolanetwork_la_SOURCES) $(NetworkTester_SOURCES) +DIST_SOURCES = $(am__libolanetwork_la_SOURCES_DIST) \ + $(NetworkTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libolanetwork.la +libolanetwork_la_SOURCES = InterfacePicker.cpp NetworkUtils.cpp \ + SelectServer.cpp Socket.cpp $(am__append_1) $(am__append_2) +EXTRA_DIST = PosixInterfacePicker.h WindowsInterfacePicker.h +NetworkTester_SOURCES = SelectServerTester.cpp SocketTest.cpp \ + NetworkTest.cpp NetworkUtilsTest.cpp \ + InterfacePickerTest.cpp + +NetworkTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +NetworkTester_LDFLAGS = $(CPPUNIT_LIBS) +NetworkTester_LDADD = ./libolanetwork.la \ + ../export_map/libolaexportmap.la \ + ../logging/liblogging.la \ + ../utils/libolautils.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/network/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/network/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolanetwork.la: $(libolanetwork_la_OBJECTS) $(libolanetwork_la_DEPENDENCIES) + $(CXXLINK) $(libolanetwork_la_OBJECTS) $(libolanetwork_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +NetworkTester$(EXEEXT): $(NetworkTester_OBJECTS) $(NetworkTester_DEPENDENCIES) + @rm -f NetworkTester$(EXEEXT) + $(NetworkTester_LINK) $(NetworkTester_OBJECTS) $(NetworkTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InterfacePicker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-InterfacePickerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-NetworkTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-NetworkUtilsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-SelectServerTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkTester-SocketTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NetworkUtils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PosixInterfacePicker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectServer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Socket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WindowsInterfacePicker.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +NetworkTester-SelectServerTester.o: SelectServerTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SelectServerTester.o -MD -MP -MF $(DEPDIR)/NetworkTester-SelectServerTester.Tpo -c -o NetworkTester-SelectServerTester.o `test -f 'SelectServerTester.cpp' || echo '$(srcdir)/'`SelectServerTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SelectServerTester.Tpo $(DEPDIR)/NetworkTester-SelectServerTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SelectServerTester.cpp' object='NetworkTester-SelectServerTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SelectServerTester.o `test -f 'SelectServerTester.cpp' || echo '$(srcdir)/'`SelectServerTester.cpp + +NetworkTester-SelectServerTester.obj: SelectServerTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SelectServerTester.obj -MD -MP -MF $(DEPDIR)/NetworkTester-SelectServerTester.Tpo -c -o NetworkTester-SelectServerTester.obj `if test -f 'SelectServerTester.cpp'; then $(CYGPATH_W) 'SelectServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/SelectServerTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SelectServerTester.Tpo $(DEPDIR)/NetworkTester-SelectServerTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SelectServerTester.cpp' object='NetworkTester-SelectServerTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SelectServerTester.obj `if test -f 'SelectServerTester.cpp'; then $(CYGPATH_W) 'SelectServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/SelectServerTester.cpp'; fi` + +NetworkTester-SocketTest.o: SocketTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SocketTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-SocketTest.Tpo -c -o NetworkTester-SocketTest.o `test -f 'SocketTest.cpp' || echo '$(srcdir)/'`SocketTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SocketTest.Tpo $(DEPDIR)/NetworkTester-SocketTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SocketTest.cpp' object='NetworkTester-SocketTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SocketTest.o `test -f 'SocketTest.cpp' || echo '$(srcdir)/'`SocketTest.cpp + +NetworkTester-SocketTest.obj: SocketTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-SocketTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-SocketTest.Tpo -c -o NetworkTester-SocketTest.obj `if test -f 'SocketTest.cpp'; then $(CYGPATH_W) 'SocketTest.cpp'; else $(CYGPATH_W) '$(srcdir)/SocketTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-SocketTest.Tpo $(DEPDIR)/NetworkTester-SocketTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SocketTest.cpp' object='NetworkTester-SocketTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-SocketTest.obj `if test -f 'SocketTest.cpp'; then $(CYGPATH_W) 'SocketTest.cpp'; else $(CYGPATH_W) '$(srcdir)/SocketTest.cpp'; fi` + +NetworkTester-NetworkTest.o: NetworkTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkTest.Tpo -c -o NetworkTester-NetworkTest.o `test -f 'NetworkTest.cpp' || echo '$(srcdir)/'`NetworkTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkTest.Tpo $(DEPDIR)/NetworkTester-NetworkTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkTest.cpp' object='NetworkTester-NetworkTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkTest.o `test -f 'NetworkTest.cpp' || echo '$(srcdir)/'`NetworkTest.cpp + +NetworkTester-NetworkTest.obj: NetworkTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkTest.Tpo -c -o NetworkTester-NetworkTest.obj `if test -f 'NetworkTest.cpp'; then $(CYGPATH_W) 'NetworkTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkTest.Tpo $(DEPDIR)/NetworkTester-NetworkTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkTest.cpp' object='NetworkTester-NetworkTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkTest.obj `if test -f 'NetworkTest.cpp'; then $(CYGPATH_W) 'NetworkTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkTest.cpp'; fi` + +NetworkTester-NetworkUtilsTest.o: NetworkUtilsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkUtilsTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo -c -o NetworkTester-NetworkUtilsTest.o `test -f 'NetworkUtilsTest.cpp' || echo '$(srcdir)/'`NetworkUtilsTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo $(DEPDIR)/NetworkTester-NetworkUtilsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkUtilsTest.cpp' object='NetworkTester-NetworkUtilsTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkUtilsTest.o `test -f 'NetworkUtilsTest.cpp' || echo '$(srcdir)/'`NetworkUtilsTest.cpp + +NetworkTester-NetworkUtilsTest.obj: NetworkUtilsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-NetworkUtilsTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo -c -o NetworkTester-NetworkUtilsTest.obj `if test -f 'NetworkUtilsTest.cpp'; then $(CYGPATH_W) 'NetworkUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkUtilsTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-NetworkUtilsTest.Tpo $(DEPDIR)/NetworkTester-NetworkUtilsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='NetworkUtilsTest.cpp' object='NetworkTester-NetworkUtilsTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-NetworkUtilsTest.obj `if test -f 'NetworkUtilsTest.cpp'; then $(CYGPATH_W) 'NetworkUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/NetworkUtilsTest.cpp'; fi` + +NetworkTester-InterfacePickerTest.o: InterfacePickerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-InterfacePickerTest.o -MD -MP -MF $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo -c -o NetworkTester-InterfacePickerTest.o `test -f 'InterfacePickerTest.cpp' || echo '$(srcdir)/'`InterfacePickerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo $(DEPDIR)/NetworkTester-InterfacePickerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InterfacePickerTest.cpp' object='NetworkTester-InterfacePickerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-InterfacePickerTest.o `test -f 'InterfacePickerTest.cpp' || echo '$(srcdir)/'`InterfacePickerTest.cpp + +NetworkTester-InterfacePickerTest.obj: InterfacePickerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -MT NetworkTester-InterfacePickerTest.obj -MD -MP -MF $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo -c -o NetworkTester-InterfacePickerTest.obj `if test -f 'InterfacePickerTest.cpp'; then $(CYGPATH_W) 'InterfacePickerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/InterfacePickerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/NetworkTester-InterfacePickerTest.Tpo $(DEPDIR)/NetworkTester-InterfacePickerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InterfacePickerTest.cpp' object='NetworkTester-InterfacePickerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(NetworkTester_CXXFLAGS) $(CXXFLAGS) -c -o NetworkTester-InterfacePickerTest.obj `if test -f 'InterfacePickerTest.cpp'; then $(CYGPATH_W) 'InterfacePickerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/InterfacePickerTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/network/NetworkTest.cpp b/open-lighting-architecture/ola-0.8.4/common/network/NetworkTest.cpp new file mode 100644 index 0000000..eff75a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/NetworkTest.cpp @@ -0,0 +1,191 @@ +/* + * 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 Library 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. + * + * SelectServerTest.cpp + * Test fixture for the Socket classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include + +#include "ola/Clock.h" +#include "ola/ExportMap.h" +#include "ola/Closure.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" + +using ola::ExportMap; +using ola::IntegerVariable; +using ola::network::LoopbackSocket; +using ola::network::SelectServer; +using ola::network::UdpSocket; + +class SelectServerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(SelectServerTest); + CPPUNIT_TEST(testAddRemoveSocket); + CPPUNIT_TEST(testTimeout); + CPPUNIT_TEST(testLoopClosures); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testAddRemoveSocket(); + void testTimeout(); + void testLoopClosures(); + + void FatalTimeout() { + CPPUNIT_ASSERT(false); + } + + void TerminateTimeout() { + if (m_ss) { m_ss->Terminate(); } + } + + void SingleIncrementTimeout() { m_timeout_counter++; } + + bool IncrementTimeout() { + m_timeout_counter++; + return true; + } + + void IncrementLoopCounter() { m_loop_counter++; } + + private: + unsigned int m_timeout_counter; + unsigned int m_loop_counter; + ExportMap *m_map; + SelectServer *m_ss; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(SelectServerTest); + + +void SelectServerTest::setUp() { + m_map = new ExportMap(); + m_ss = new SelectServer(m_map); + m_timeout_counter = 0; + m_loop_counter = 0; +} + + +void SelectServerTest::tearDown() { + delete m_ss; + delete m_map; +} + + +/* + * Check AddSocket/RemoveSocket works correctly and that the export map is + * updated. + */ +void SelectServerTest::testAddRemoveSocket() { + LoopbackSocket bad_socket; + IntegerVariable *connected_socket_count = + m_map->GetIntegerVar(SelectServer::K_CONNECTED_SOCKET_VAR); + IntegerVariable *socket_count = + m_map->GetIntegerVar(SelectServer::K_SOCKET_VAR); + CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(0, socket_count->Get()); + // adding and removin a non-connected socket should fail + CPPUNIT_ASSERT(!m_ss->AddSocket(&bad_socket)); + CPPUNIT_ASSERT(!m_ss->RemoveSocket(&bad_socket)); + + LoopbackSocket loopback_socket; + loopback_socket.Init(); + CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(0, socket_count->Get()); + CPPUNIT_ASSERT(m_ss->AddSocket(&loopback_socket)); + // Adding a second time should fail + CPPUNIT_ASSERT(!m_ss->AddSocket(&loopback_socket)); + CPPUNIT_ASSERT_EQUAL(1, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(0, socket_count->Get()); + + // Add a udp socket + UdpSocket udp_socket; + CPPUNIT_ASSERT(udp_socket.Init()); + CPPUNIT_ASSERT(m_ss->AddSocket(&udp_socket)); + CPPUNIT_ASSERT(!m_ss->AddSocket(&udp_socket)); + CPPUNIT_ASSERT_EQUAL(1, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(1, socket_count->Get()); + + // Check remove works + CPPUNIT_ASSERT(m_ss->RemoveSocket(&loopback_socket)); + CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(1, socket_count->Get()); + CPPUNIT_ASSERT(m_ss->RemoveSocket(&udp_socket)); + CPPUNIT_ASSERT_EQUAL(0, connected_socket_count->Get()); + CPPUNIT_ASSERT_EQUAL(0, socket_count->Get()); + + // Remove again should fail + CPPUNIT_ASSERT(!m_ss->RemoveSocket(&loopback_socket)); +} + + +/* + * Timeout tests + */ +void SelectServerTest::testTimeout() { + // check a single timeout + m_ss->RegisterSingleTimeout( + 10, + ola::NewSingleClosure(this, &SelectServerTest::SingleIncrementTimeout)); + m_ss->RegisterSingleTimeout( + 20, + ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout)); + m_ss->Run(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, m_timeout_counter); + + // check repeating timeouts + m_timeout_counter = 0; + m_ss->RegisterRepeatingTimeout( + 10, + ola::NewClosure(this, &SelectServerTest::IncrementTimeout)); + m_ss->RegisterSingleTimeout( + 98, + ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout)); + m_ss->Restart(); + m_ss->Run(); + // Some systems have bad timing and only do 8 ticks here + CPPUNIT_ASSERT(m_timeout_counter == 8 || m_timeout_counter == 9); + + // check timeouts are removed correctly + ola::network::timeout_id timeout1 = m_ss->RegisterSingleTimeout( + 10, + ola::NewSingleClosure(this, &SelectServerTest::FatalTimeout)); + m_ss->RegisterSingleTimeout( + 20, + ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout)); + m_ss->RemoveTimeout(timeout1); + m_ss->Restart(); + m_ss->Run(); +} + + +/* + * Check that the loop closures are called + */ +void SelectServerTest::testLoopClosures() { + m_ss->SetDefaultInterval(ola::TimeInterval(0, 100000)); // poll every 100ms + m_ss->RunInLoop(ola::NewClosure(this, + &SelectServerTest::IncrementLoopCounter)); + m_ss->RegisterSingleTimeout( + 500, + ola::NewSingleClosure(this, &SelectServerTest::TerminateTimeout)); + m_ss->Run(); + // we should have at least 5 calls to IncrementLoopCounter + CPPUNIT_ASSERT(m_loop_counter >= 5); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtils.cpp b/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtils.cpp new file mode 100644 index 0000000..ea5979e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtils.cpp @@ -0,0 +1,222 @@ +/* + * 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 Library 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. + * + * NetworkUtils.h + * Abstract various network functions. + * Copyright (C) 2005-2009 Simon Newton + */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifdef WIN32 +#include +typedef unsigned long in_addr_t; +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "ola/network/Interface.h" + + +namespace ola { +namespace network { + + +/* + * Convert a string to a struct in_addr + */ +bool StringToAddress(const string &address, struct in_addr &addr) { +#ifdef HAVE_INET_ATON + if (!inet_aton(address.data(), &addr)) { +#else + in_addr_t *ip_addr4 = reinterpret_cast(&addr); + if ((*ip_addr4 = inet_addr(address.data())) == INADDR_NONE) { +#endif + OLA_WARN << "Could not convert address " << address; + return false; + } + return true; +} + + +string AddressToString(const struct in_addr &addr) { + return inet_ntoa(addr); +} + + +/* + * Convert a mac address to a human readable string + * @param hw_address the mac address. + * @return a string + */ +std::string HardwareAddressToString(uint8_t hw_address[MAC_LENGTH]) { + std::stringstream str; + for (unsigned int i = 0 ; i < ola::network::MAC_LENGTH; i++) { + if (i != 0) + str << ":"; + str << std::hex << std::setfill('0') << std::setw(2) << + static_cast(hw_address[i]); + } + return str.str(); +} + + +uint8_t NetworkToHost(uint8_t value) { + return value; +} + + +/* + * Convert a uint16_t from network to host byte order + */ +uint16_t NetworkToHost(uint16_t value) { + return ntohs(value); +} + + +/* + * Convert a uint32_t from network to host byte order + */ +uint32_t NetworkToHost(uint32_t value) { + return ntohl(value); +} + + +int8_t NetworkToHost(int8_t value) { + return value; +} + + +/* + * Convert a int16_t from network to host byte order + */ +int16_t NetworkToHost(int16_t value) { + return ntohs(value); +} + + +/* + * Convert a int32_t from network to host byte order + */ +int32_t NetworkToHost(int32_t value) { + return ntohl(value); +} + +uint8_t HostToNetwork(uint8_t value) { + return value; +} + + +/* + * Convert a uint16_t from network to host byte order + */ +uint16_t HostToNetwork(uint16_t value) { + return htons(value); +} + + +/* + * Convert a uint32_t from host to network byte order + */ +uint32_t HostToNetwork(uint32_t value) { + return htonl(value); +} + + +uint8_t HostToLittleEndian(uint8_t value) { + return value; +} + + +uint16_t HostToLittleEndian(uint16_t value) { +#ifdef HAVE_ENDIAN_H +# if BYTE_ORDER == __BIG_ENDIAN + return ((value & 0xff) << 8) | (value >> 8); +# else + return value; +# endif +#else +# if BYTE_ORDER == BIG_ENDIAN + return ((value & 0xff) << 8) | (value >> 8); +# else + return value; +# endif +#endif +} + + +uint8_t LittleEndianToHost(uint8_t value) { + return value; +} + + +uint16_t LittleEndianToHost(uint16_t value) { +#ifdef HAVE_ENDIAN_H +# if BYTE_ORDER == __BIG_ENDIAN + return (value >> 8) | ((value & 0xff) << 8); +# else + return value; +# endif +#else +# if BYTE_ORDER == BIG_ENDIAN + return (value >> 8) | ((value & 0xff) << 8); +# else + return value; +# endif +#endif +} + +/* + * Return the full hostname + */ +string FullHostname() { +#ifdef _POSIX_HOST_NAME_MAX + char hostname[_POSIX_HOST_NAME_MAX]; +#else + char hostname[256]; +#endif + int ret = gethostname(hostname, sizeof(hostname)); + + if (ret) { + OLA_WARN << "gethostname failed: " << strerror(errno); + return ""; + } + return hostname; +} + + +/* + * Return the hostname as a string. + */ +string Hostname() { + string hostname = FullHostname(); + std::vector tokens; + StringSplit(hostname, tokens, "."); + return string(tokens[0]); +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtilsTest.cpp b/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtilsTest.cpp new file mode 100644 index 0000000..23654c0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/NetworkUtilsTest.cpp @@ -0,0 +1,85 @@ +/* + * 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 Library 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. + * + * NetworkUtilsTest.cpp + * Test fixture for the NetworkUtils class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include + +#include "ola/network/NetworkUtils.h" +#include "ola/Logging.h" + +using ola::network::HardwareAddressToString; +using ola::network::HostToLittleEndian; +using ola::network::HostToNetwork; +using ola::network::LittleEndianToHost; +using ola::network::NetworkToHost; + +class NetworkUtilsTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(NetworkUtilsTest); + CPPUNIT_TEST(testHardwareAddressToString); + CPPUNIT_TEST(testToFromNetwork); + CPPUNIT_TEST(testToFromLittleEndian); + CPPUNIT_TEST_SUITE_END(); + + public: + void testHardwareAddressToString(); + void testToFromNetwork(); + void testToFromLittleEndian(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(NetworkUtilsTest); + + +/* + * Check that HardwareAddressToString works + */ +void NetworkUtilsTest::testHardwareAddressToString() { + uint8_t hw_address[ola::network::MAC_LENGTH] = { + 0x0, 0xa, 0xff, 0x10, 0x25, 0x4}; + const std::string mac_address = HardwareAddressToString(hw_address); + CPPUNIT_ASSERT_EQUAL(std::string("00:0a:ff:10:25:04"), mac_address); +} + + +/* + * Check that we can convert to/from network byte order + */ +void NetworkUtilsTest::testToFromNetwork() { + uint8_t v1 = 10; + CPPUNIT_ASSERT_EQUAL(v1, HostToNetwork(v1)); + CPPUNIT_ASSERT_EQUAL(v1, NetworkToHost(HostToNetwork(v1))); + + uint16_t v2 = 0x0102; + CPPUNIT_ASSERT_EQUAL(v2, NetworkToHost(HostToNetwork(v2))); + + uint32_t v3 = 0x01020304; + CPPUNIT_ASSERT_EQUAL(v3, NetworkToHost(HostToNetwork(v3))); +} + + +/* + * Check that we can convert to/from little endian order + */ +void NetworkUtilsTest::testToFromLittleEndian() { + uint8_t v1 = 10; + CPPUNIT_ASSERT_EQUAL(v1, HostToLittleEndian(v1)); + CPPUNIT_ASSERT_EQUAL(v1, LittleEndianToHost(HostToLittleEndian(v1))); + + uint16_t v2 = 0x0102; + CPPUNIT_ASSERT_EQUAL(v2, LittleEndianToHost(HostToLittleEndian(v2))); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.cpp b/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.cpp new file mode 100644 index 0000000..9aa34d6 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.cpp @@ -0,0 +1,235 @@ +/* + * 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 Library 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. + * + * InterfacePicker.cpp + * Chooses an interface to listen on + * Copyright (C) 2005-2010 Simon Newton + */ + +#if HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_GETIFADDRS + #ifdef HAVE_LINUX_IF_PACKET_H + #define OLA_USE_GETIFADDRS + #endif +#endif + + +#ifdef OLA_USE_GETIFADDRS + #include + #include + #include +#endif + +#include +#include +#include +#ifdef HAVE_SOCKADDR_DL_STRUCT +#include +#endif +#include +#include +#include +#include +#include + +#include "common/network/PosixInterfacePicker.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" + +namespace ola { +namespace network { + +using std::string; +using std::vector; + +/* + * Return a vector of interfaces on the system. + */ +vector PosixInterfacePicker::GetInterfaces() const { + vector interfaces; + string last_dl_iface_name; + uint8_t hwlen = 0; + char *hwaddr = NULL; + + // create socket to get iface config + int sd = socket(PF_INET, SOCK_DGRAM, 0); + + if (sd < 0) { + OLA_WARN << "Could not create socket " << strerror(errno); + return interfaces; + } + + // use ioctl to get a listing of interfaces + char *buffer; // holds the iface data + unsigned int lastlen = 0; // the amount of data returned by the last ioctl + unsigned int len = INITIAL_IFACE_COUNT; + + while (true) { + struct ifconf ifc; + ifc.ifc_len = len * sizeof(struct ifreq); + buffer = new char[ifc.ifc_len]; + ifc.ifc_buf = buffer; + + if (ioctl(sd, SIOCGIFCONF, &ifc) < 0) { + if (errno != EINVAL || lastlen != 0) { + OLA_WARN << "ioctl error " << strerror(errno); + delete[] buffer; + return interfaces; + } + } else { + if (static_cast(ifc.ifc_len) == lastlen) { + lastlen = ifc.ifc_len; + break; + } + lastlen = ifc.ifc_len; + } + len += IFACE_COUNT_INC; + delete[] buffer; + } + + // loop through each iface + for (char *ptr = buffer; ptr < buffer + lastlen;) { + struct ifreq *iface = (struct ifreq*) ptr; + ptr += GetIfReqSize(ptr); + +#ifdef HAVE_SOCKADDR_DL_STRUCT + if (iface->ifr_addr.sa_family == AF_LINK) { + struct sockaddr_dl *sdl = (struct sockaddr_dl*) &iface->ifr_addr; + last_dl_iface_name.assign(sdl->sdl_data, sdl->sdl_nlen); + hwaddr = sdl->sdl_data + sdl->sdl_nlen; + hwlen = sdl->sdl_alen; + } +#endif + + // look for AF_INET interfaces only + if (iface->ifr_addr.sa_family != AF_INET) { + OLA_DEBUG << "skipping " << iface->ifr_name << + " because it's not af_inet"; + continue; + } + + struct ifreq ifrcopy = *iface; + if (ioctl(sd, SIOCGIFFLAGS, &ifrcopy) < 0) { + OLA_WARN << "ioctl error for " << iface->ifr_name << ":" + << strerror(errno); + continue; + } + + if (!(ifrcopy.ifr_flags & IFF_UP)) { + OLA_DEBUG << "skipping " << iface->ifr_name << " because it's down"; + continue; + } + + if (ifrcopy.ifr_flags & IFF_LOOPBACK) { + OLA_DEBUG << "skipping " << iface->ifr_name << + " because it's a loopback"; + continue; + } + + Interface interface; + interface.name = iface->ifr_name; + if (interface.name == last_dl_iface_name && hwaddr) { + memcpy(interface.hw_address, hwaddr, + std::min(hwlen, (uint8_t) MAC_LENGTH)); + } + struct sockaddr_in *sin = (struct sockaddr_in *) &iface->ifr_addr; + interface.ip_address = sin->sin_addr; + + // fetch bcast address +#ifdef SIOCGIFBRDADDR + if (ifrcopy.ifr_flags & IFF_BROADCAST) { + if (ioctl(sd, SIOCGIFBRDADDR, &ifrcopy) < 0) { + OLA_WARN << "ioctl error " << strerror(errno); + } else { + sin = (struct sockaddr_in *) &ifrcopy.ifr_broadaddr; + interface.bcast_address = sin->sin_addr; + } + } +#endif + + // fetch subnet address +#ifdef SIOCGIFNETMASK + if (ioctl(sd, SIOCGIFNETMASK, &ifrcopy) < 0) { + OLA_WARN << "ioctl error " << strerror(errno); + } else { + sin = (struct sockaddr_in *) &ifrcopy.ifr_broadaddr; + interface.subnet_address = sin->sin_addr; + } +#endif + + // fetch hardware address +#ifdef SIOCGIFHWADDR + if (ifrcopy.ifr_flags & SIOCGIFHWADDR) { + if (ioctl(sd, SIOCGIFHWADDR, &ifrcopy) < 0) { + OLA_WARN << "ioctl error" << strerror(errno); + } else { + memcpy(interface.hw_address, ifrcopy.ifr_hwaddr.sa_data, MAC_LENGTH); + } + } +#endif + + /* ok, if that all failed we should prob try and use sysctl to work out the bcast + * and hware addresses + * i'll leave that for another day + */ + interfaces.push_back(interface); + } + close(sd); + delete[] buffer; + return interfaces; +} + + +/* + * Return the size of an ifreq structure in a cross platform manner. + * @param data a pointer to an ifreq structure + * @return the size of the ifreq structure + */ +unsigned int PosixInterfacePicker::GetIfReqSize(const char *data) const { + const struct ifreq *iface = (struct ifreq*) data; + +#ifdef HAVE_SOCKADDR_SA_LEN + unsigned int socket_len = iface->ifr_addr.sa_len; +#else + unsigned int socket_len = sizeof(struct sockaddr); + switch (iface->ifr_addr.sa_family) { + case AF_INET: + socket_len = sizeof(struct sockaddr_in); + break; +#ifdef IPV6 + case AF_INET6: + socket_len = sizeof(struct sockaddr_in6); + break; +#endif +#ifdef HAVE_SOCKADDR_DL_STRUCT + case AF_LINK: + socket_len = sizeof(struct sockaddr_dl); + break; +#endif + } +#endif + + // We can't assume sizeof(ifreq) = IFNAMSIZ + sizeof(sockaddr), this isn't + // the case on some 64bit linux systems. + if (socket_len > sizeof(struct ifreq) - IFNAMSIZ) + return IFNAMSIZ + socket_len; + else + return sizeof(struct ifreq); +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.h b/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.h new file mode 100644 index 0000000..58c52c1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/PosixInterfacePicker.h @@ -0,0 +1,45 @@ +/* + * 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 Library 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. + * + * PosixInterfacePicker.h + * Choose an interface to listen on + * Copyright (C) 2005-2010 Simon Newton + */ +#ifndef COMMON_NETWORK_POSIXINTERFACEPICKER_H_ +#define COMMON_NETWORK_POSIXINTERFACEPICKER_H_ + +#include +#include "ola/network/InterfacePicker.h" + +namespace ola { +namespace network { + + +/* + * The InterfacePicker for posix systems + */ +class PosixInterfacePicker: public InterfacePicker { + public: + std::vector GetInterfaces() const; + + private: + static const unsigned int INITIAL_IFACE_COUNT = 10; + static const unsigned int IFACE_COUNT_INC = 5; + unsigned int GetIfReqSize(const char *data) const; +}; +} // network +} // ola +#endif // COMMON_NETWORK_POSIXINTERFACEPICKER_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/common/network/SelectServer.cpp b/open-lighting-architecture/ola-0.8.4/common/network/SelectServer.cpp new file mode 100644 index 0000000..0ffcd05 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/SelectServer.cpp @@ -0,0 +1,595 @@ +/* + * 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 Library 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. + * + * SelectServer.cpp + * Implementation of the SelectServer class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifdef WIN32 +#include +#else +#include +#endif + +#include +#include + +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" + + +namespace ola { +namespace network { + +// # of sockets registered +const char SelectServer::K_SOCKET_VAR[] = "ss-sockets"; +// # of sockets registered for writing +const char SelectServer::K_WRITE_SOCKET_VAR[] = "ss-write-sockets"; +// # of connected sockets registered +const char SelectServer::K_CONNECTED_SOCKET_VAR[] = "ss-connections"; +// # of timer functions registered +const char SelectServer::K_TIMER_VAR[] = "ss-timers"; +// time spent processing events/timeouts in microseconds +const char SelectServer::K_LOOP_TIME[] = "ss-loop-time"; +// iterations through the select server +const char SelectServer::K_LOOP_COUNT[] = "ss-loop-count"; + +using std::max; +using std::set; +using ola::ExportMap; +using ola::Closure; + +/* + * Constructor + * @param export_map an ExportMap to update + * @param wake_up_time a TimeStamp which is updated with the current wake up + * time. + */ +SelectServer::SelectServer(ExportMap *export_map, + TimeStamp *wake_up_time) + : m_terminate(false), + m_free_wake_up_time(false), + m_poll_interval(POLL_INTERVAL_SECOND, POLL_INTERVAL_USECOND), + m_export_map(export_map), + m_loop_iterations(NULL), + m_loop_time(NULL), + m_wake_up_time(wake_up_time) { + + if (m_export_map) { + m_export_map->GetIntegerVar(K_SOCKET_VAR); + m_export_map->GetIntegerVar(K_TIMER_VAR); + m_loop_time = m_export_map->GetCounterVar(K_LOOP_TIME); + m_loop_iterations = m_export_map->GetCounterVar(K_LOOP_COUNT); + } + + if (!m_wake_up_time) { + m_wake_up_time = new TimeStamp(); + m_free_wake_up_time = true; + } +} + + +/* + * Clean up + */ +SelectServer::~SelectServer() { + UnregisterAll(); + if (m_free_wake_up_time) + delete m_wake_up_time; +} + + +/* + * Set the default poll delay time + */ +void SelectServer::SetDefaultInterval(const TimeInterval &poll_interval) { + m_poll_interval = poll_interval; +} + + +/* + * Run the select server until Terminate() is called. + */ +void SelectServer::Run() { + while (!m_terminate) { + // false indicates an error in CheckForEvents(); + if (!CheckForEvents(m_poll_interval)) + break; + } +} + + +/* + * Run one iteration of the select server + */ +void SelectServer::RunOnce(unsigned int delay_sec, + unsigned int delay_usec) { + CheckForEvents(TimeInterval(delay_sec, delay_usec)); +} + + +/* + * Register a Socket with the select server. + * @param Socket the socket to register. The OnData closure of this socket will + * be called when there is data available for reading. + * @return true on success, false on failure. + */ +bool SelectServer::AddSocket(Socket *socket) { + if (socket->ReadDescriptor() == Socket::INVALID_SOCKET) { + OLA_WARN << "AddSocket failed, fd: " << socket->ReadDescriptor(); + return false; + } + + set::const_iterator iter = m_sockets.find(socket); + if (iter != m_sockets.end()) + return false; + + m_sockets.insert(socket); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_SOCKET_VAR))++; + return true; +} + + +/* + * Register a ConnectedSocket with the select server. + * @param socket the socket to register. The OnData method will be called when + * there is data available for reading. Additionally, OnClose will be called + * if the other end closes the connection + * @param delete_on_close controls whether the select server deletes the socket + * once it's closed. + * @return true on success, false on failure. + */ +bool SelectServer::AddSocket(ConnectedSocket *socket, + bool delete_on_close) { + if (socket->ReadDescriptor() == Socket::INVALID_SOCKET) { + OLA_WARN << "AddSocket failed, fd: " << socket->ReadDescriptor(); + return false; + } + + connected_socket_t registered_socket; + registered_socket.socket = socket; + registered_socket.delete_on_close = delete_on_close; + + set::const_iterator iter; + for (iter = m_connected_sockets.begin(); iter != m_connected_sockets.end(); + ++iter) { + if (iter->socket->ReadDescriptor() == socket->ReadDescriptor()) + return false; + } + + m_connected_sockets.insert(registered_socket); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_CONNECTED_SOCKET_VAR))++; + return true; +} + + +/* + * Unregister a Socket with the select server + * @param socket the Socket to remove + * @return true if removed successfully, false otherwise + */ +bool SelectServer::RemoveSocket(Socket *socket) { + if (socket->ReadDescriptor() == Socket::INVALID_SOCKET) + OLA_WARN << "Removing a closed socket: " << socket->ReadDescriptor(); + + set::iterator iter = m_sockets.find(socket); + if (iter != m_sockets.end()) { + m_sockets.erase(iter); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_SOCKET_VAR))--; + return true; + } + return false; +} + + +/* + * Unregister a ConnectedSocket with the select server + * @param socket the Socket to remove + * @return true if removed successfully, false otherwise + */ +bool SelectServer::RemoveSocket(ConnectedSocket *socket) { + if (socket->ReadDescriptor() == Socket::INVALID_SOCKET) + OLA_WARN << "Removing a closed socket: " << socket; + + set::iterator iter; + for (iter = m_connected_sockets.begin(); iter != m_connected_sockets.end(); + ++iter) { + if (iter->socket->ReadDescriptor() == socket->ReadDescriptor()) { + m_connected_sockets.erase(iter); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_CONNECTED_SOCKET_VAR))--; + return true; + } + } + return false; +} + + +/* + * Register a socket to receive ready-to-write event notifications + * @param socket the socket to register. The PerformWrite method will be called + * when the socket is ready for writing. + * @return true on success, false on failure. + */ +bool SelectServer::RegisterWriteSocket(class BidirectionalSocket *socket) { + if (socket->WriteDescriptor() == Socket::INVALID_SOCKET) { + OLA_WARN << "AddSocket failed, fd: " << socket->WriteDescriptor(); + return false; + } + + set::const_iterator iter = + m_write_sockets.find(socket); + if (iter != m_write_sockets.end()) + return false; + + m_write_sockets.insert(socket); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_WRITE_SOCKET_VAR))++; + return true; +} + + +/* + * UnRegister a socket from receiving ready-to-write event notifications + * @param socket the socket to register. + * @return true on success, false on failure. + */ +bool SelectServer::UnRegisterWriteSocket(class BidirectionalSocket *socket) { + if (socket->WriteDescriptor() == Socket::INVALID_SOCKET) + OLA_WARN << "Removing a closed socket: " << socket->WriteDescriptor(); + + set::iterator iter = m_write_sockets.find(socket); + if (iter != m_write_sockets.end()) { + m_write_sockets.erase(iter); + if (m_export_map) + (*m_export_map->GetIntegerVar(K_WRITE_SOCKET_VAR))--; + return true; + } + return false; +} + + +/* + * Register a repeating timeout function. Returning 0 from the closure will + * cancel this timeout. + * @param seconds the delay between function calls + * @param closure the closure to call when the event triggers. Ownership is + * given up to the select server - make sure nothing else uses this closure. + * @returns the identifier for this timeout, this can be used to remove it + * later. + */ +timeout_id SelectServer::RegisterRepeatingTimeout( + unsigned int ms, + ola::Closure *closure) { + if (!closure) + return INVALID_TIMEOUT; + + if (m_export_map) + (*m_export_map->GetIntegerVar(K_TIMER_VAR))++; + + Event *event = new RepeatingEvent(ms, closure); + m_events.push(event); + return event; +} + + +/* + * Register a single use timeout function. + * @param seconds the delay between function calls + * @param closure the closure to call when the event triggers + * @returns the identifier for this timeout, this can be used to remove it + * later. + */ +timeout_id SelectServer::RegisterSingleTimeout( + unsigned int ms, + ola::SingleUseClosure *closure) { + if (!closure) + return INVALID_TIMEOUT; + + if (m_export_map) + (*m_export_map->GetIntegerVar(K_TIMER_VAR))++; + + Event *event = new SingleEvent(ms, closure); + m_events.push(event); + return event; +} + + +/* + * Remove a previously registered timeout + * @param timeout_id the id of the timeout + */ +void SelectServer::RemoveTimeout(timeout_id id) { + if (!m_removed_timeouts.insert(id).second) + OLA_WARN << "timeout " << id << " already in remove set"; +} + + +/* + * Add a closure to be run every loop iteration. The closure is run after any + * i/o and timeouts have been handled. + * Ownership is transferred to the select server. + */ +void SelectServer::RunInLoop(Closure *closure) { + m_loop_closures.insert(closure); +} + + +/* + * One iteration of the select() loop. + * @return false on error, true on success. + */ +bool SelectServer::CheckForEvents(const TimeInterval &poll_interval) { + int maxsd; + fd_set r_fds, w_fds; + TimeStamp now; + struct timeval tv; + + set*>::iterator loop_iter; + for (loop_iter = m_loop_closures.begin(); loop_iter != m_loop_closures.end(); + ++loop_iter) + (*loop_iter)->Run(); + + maxsd = 0; + FD_ZERO(&r_fds); + FD_ZERO(&w_fds); + Clock::CurrentTime(&now); + now = CheckTimeouts(now); + + // adding sockets should be the last thing we do, they may have changed due + // to timeouts above. + AddSocketsToSet(&r_fds, &w_fds, &maxsd); + + if (m_wake_up_time->IsSet()) { + TimeInterval loop_time = now - *m_wake_up_time; + OLA_DEBUG << "ss process time was " << loop_time.ToString(); + if (m_loop_time) + (*m_loop_time) += loop_time.AsInt(); + if (m_loop_iterations) + (*m_loop_iterations)++; + } + + if (m_terminate) + return true; + + poll_interval.AsTimeval(&tv); + if (!m_events.empty()) { + TimeInterval interval = m_events.top()->NextTime() - now; + if (interval < poll_interval) + interval.AsTimeval(&tv); + } + + switch (select(maxsd + 1, &r_fds, &w_fds, NULL, &tv)) { + case 0: + // timeout + Clock::CurrentTime(m_wake_up_time); + return true; + case -1: + if (errno == EINTR) + return true; + OLA_WARN << "select() error, " << strerror(errno); + return false; + default: + Clock::CurrentTime(m_wake_up_time); + CheckTimeouts(*m_wake_up_time); + CheckSockets(&r_fds, &w_fds); + Clock::CurrentTime(m_wake_up_time); + CheckTimeouts(*m_wake_up_time); + } + return true; +} + + +/* + * Add all the read sockets to the FD_SET + */ +void SelectServer::AddSocketsToSet(fd_set *r_set, + fd_set *w_set, + int *max_sd) { + set::iterator iter = m_sockets.begin(); + while (iter != m_sockets.end()) { + if ((*iter)->ReadDescriptor() == Socket::INVALID_SOCKET) { + // The socket was probably closed without removing it from the select + // server + if (m_export_map) + (*m_export_map->GetIntegerVar(K_SOCKET_VAR))--; + m_sockets.erase(iter++); + OLA_WARN << "Removed a disconnected socket from the select server"; + } else { + *max_sd = max(*max_sd, (*iter)->ReadDescriptor()); + FD_SET((*iter)->ReadDescriptor(), r_set); + iter++; + } + } + + set::iterator con_iter = m_connected_sockets.begin(); + while (con_iter != m_connected_sockets.end()) { + if (con_iter->socket->ReadDescriptor() == Socket::INVALID_SOCKET) { + // The socket was closed without removing it from the select server + if (con_iter->delete_on_close) + delete con_iter->socket; + if (m_export_map) + (*m_export_map->GetIntegerVar(K_CONNECTED_SOCKET_VAR))--; + m_connected_sockets.erase(con_iter++); + OLA_WARN << "Removed a disconnected socket from the select server"; + } else { + *max_sd = max(*max_sd, con_iter->socket->ReadDescriptor()); + FD_SET(con_iter->socket->ReadDescriptor(), r_set); + con_iter++; + } + } + + set::iterator write_iter = m_write_sockets.begin(); + while (write_iter != m_write_sockets.end()) { + if ((*write_iter)->WriteDescriptor() == Socket::INVALID_SOCKET) { + // The socket was probably closed without removing it from the select + // server + if (m_export_map) + (*m_export_map->GetIntegerVar(K_WRITE_SOCKET_VAR))--; + m_write_sockets.erase(write_iter++); + OLA_WARN << "Removed a disconnected socket from the select server"; + } else { + *max_sd = max(*max_sd, (*write_iter)->WriteDescriptor()); + FD_SET((*write_iter)->WriteDescriptor(), w_set); + write_iter++; + } + } +} + + +/* + * Check all the registered sockets: + * - Execute the callback for sockets with data + * - Excute OnClose if a remote end closed the connection + */ +void SelectServer::CheckSockets(fd_set *r_set, fd_set *w_set) { + // Because the callbacks can add or remove sockets from the select server, we + // have to call them after we've used the iterators. + std::queue*> read_ready_queue; + std::queue*> write_ready_queue; + + set::iterator iter; + for (iter = m_sockets.begin(); iter != m_sockets.end(); ++iter) { + if (FD_ISSET((*iter)->ReadDescriptor(), r_set)) { + if ((*iter)->OnData()) + read_ready_queue.push((*iter)->OnData()); + else + OLA_FATAL << "Socket " << (*iter)->ReadDescriptor() << + "is ready but no handler attached, this is bad!"; + } + } + + set::iterator con_iter = m_connected_sockets.begin(); + while (con_iter != m_connected_sockets.end()) { + if (FD_ISSET(con_iter->socket->ReadDescriptor(), r_set)) { + if (con_iter->socket->CheckIfClosed()) { + if (con_iter->delete_on_close) + delete con_iter->socket; + if (m_export_map) + (*m_export_map->GetIntegerVar(K_CONNECTED_SOCKET_VAR))--; + m_connected_sockets.erase(con_iter++); + continue; + } else { + if (con_iter->socket->OnData()) + read_ready_queue.push(con_iter->socket->OnData()); + else + OLA_FATAL << "Socket " << con_iter->socket->ReadDescriptor() << + "is ready but no handler attached, this is bad!"; + } + } + con_iter++; + } + + set::iterator write_iter = m_write_sockets.begin(); + for (;write_iter != m_write_sockets.end(); write_iter++) { + if (FD_ISSET((*write_iter)->WriteDescriptor(), w_set)) { + if ((*write_iter)->PerformWrite()) + write_ready_queue.push((*write_iter)->PerformWrite()); + else + OLA_FATAL << "Socket " << (*write_iter)->WriteDescriptor() << + "is ready but no write handler attached, this is bad!"; + } + } + + while (!read_ready_queue.empty()) { + Closure *closure = read_ready_queue.front(); + closure->Run(); + read_ready_queue.pop(); + } + + while (!write_ready_queue.empty()) { + Closure *closure = write_ready_queue.front(); + closure->Run(); + write_ready_queue.pop(); + } +} + + +/* + * Check for expired timeouts and call them. + * @returns a struct timeval of the time up to where we checked. + */ +TimeStamp SelectServer::CheckTimeouts(const TimeStamp ¤t_time) { + TimeStamp now = current_time; + + Event *e; + if (m_events.empty()) + return now; + + for (e = m_events.top(); !m_events.empty() && (e->NextTime() < now); + e = m_events.top()) { + m_events.pop(); + + // if this was removed, skip it + if (m_removed_timeouts.erase(e)) { + delete e; + if (m_export_map) + (*m_export_map->GetIntegerVar(K_TIMER_VAR))--; + continue; + } + + if (e->Trigger()) { + // true implies we need to run this again + e->UpdateTime(now); + m_events.push(e); + } else { + delete e; + if (m_export_map) + (*m_export_map->GetIntegerVar(K_TIMER_VAR))--; + } + Clock::CurrentTime(&now); + } + return now; +} + + +/* + * Remove all registrations. + */ +void SelectServer::UnregisterAll() { + set::iterator iter = m_connected_sockets.begin(); + for (; iter != m_connected_sockets.end(); ++iter) { + if (iter->delete_on_close) { + delete iter->socket; + } + } + m_sockets.clear(); + m_connected_sockets.clear(); + m_write_sockets.clear(); + m_removed_timeouts.clear(); + + while (!m_events.empty()) { + delete m_events.top(); + m_events.pop(); + } + + set*>::iterator loop_iter; + for (loop_iter = m_loop_closures.begin(); loop_iter != m_loop_closures.end(); + ++loop_iter) + delete *loop_iter; + m_loop_closures.clear(); +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/SelectServerTester.cpp b/open-lighting-architecture/ola-0.8.4/common/network/SelectServerTester.cpp new file mode 100644 index 0000000..a7fc1e6 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/SelectServerTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * SelectServerTester.h + * Runs all the RPC tests + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/network/Socket.cpp b/open-lighting-architecture/ola-0.8.4/common/network/Socket.cpp new file mode 100644 index 0000000..8b98a5b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/Socket.cpp @@ -0,0 +1,727 @@ +/* + * 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 Library 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. + * + * Socket.cpp + * Implementation of the Socket classes + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "ola/Logging.h" +#include "ola/network/Socket.h" +#include "ola/network/NetworkUtils.h" + +namespace ola { +namespace network { + +// ConnectedSocket +// ------------------------------------------------ + + +/* + * Turn on non-blocking reads. + * @param fd the descriptor to enable non-blocking on + * @return true if it worked, false otherwise + */ +bool ConnectedSocket::SetNonBlocking(int fd) { + if (fd == INVALID_SOCKET) + return false; + + int val = fcntl(fd, F_GETFL, 0); + int ret = fcntl(fd, F_SETFL, val | O_NONBLOCK); + if (ret) { + OLA_WARN << "failed to set " << fd << " non-blocking: " << strerror(errno); + return false; + } + return true; +} + + +/* + * Turn off the SIGPIPE for this socket + */ +bool ConnectedSocket::SetNoSigPipe(int fd) { + #ifdef SO_NOSIGPIPE + int sig_pipe_flag = 1; + if (setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &sig_pipe_flag, + sizeof(sig_pipe_flag)) == -1) { + OLA_WARN << "Failed to disable SIGPIPE on " << fd << ": " << + strerror(errno); + return false; + } + #else + (void) fd; + #endif + return true; +} + + +/* + * Find out how much data is left to read + * @return the amount of unread data for the socket + */ +int ConnectedSocket::DataRemaining() const { + int unread; + if (ReadDescriptor() == INVALID_SOCKET) + return 0; + + if (ioctl(ReadDescriptor(), FIONREAD, &unread) < 0) { + OLA_WARN << "ioctl error for " << ReadDescriptor() << ", " + << strerror(errno); + return 0; + } + return unread; +} + + +/* + * Write data to this socket. + * @param fd the descriptor to write to + * @param buffer the data to write + * @param size the length of the data + * @return the number of bytes sent + */ +ssize_t ConnectedSocket::FDSend(int fd, + const uint8_t *buffer, + unsigned int size) const { + if (fd == INVALID_SOCKET) + return 0; + +#ifdef HAVE_DECL_MSG_NOSIGNAL + ssize_t bytes_sent = send(fd, buffer, size, MSG_NOSIGNAL); +#else + ssize_t bytes_sent = write(fd, buffer, size); +#endif + + if (bytes_sent < 0 || static_cast(bytes_sent) != size) + OLA_WARN << "Failed to send on " << fd << ":" << strerror(errno); + return bytes_sent; +} + + +/* + * Read data from this socket. + * @param fd the descriptor to read from + * @param buffer a pointer to the buffer to store new data in + * @param size the size of the buffer + * @param data_read a value result argument which returns the amount of data + * copied into the buffer + * @returns -1 on error, 0 on success. + */ +int ConnectedSocket::FDReceive(int fd, + uint8_t *buffer, + unsigned int size, + unsigned int &data_read) { + int ret; + uint8_t *data = buffer; + data_read = 0; + if (fd == INVALID_SOCKET) + return -1; + + while (data_read < size) { + if ((ret = read(fd, data, size - data_read)) < 0) { + if (errno == EAGAIN) + return 0; + if (errno != EINTR) { + OLA_WARN << "read failed, " << strerror(errno); + return -1; + } + } else if (ret == 0) { + return 0; + } + data_read += ret; + data += data_read; + } + return 0; +} + + +/* + * Check if the remote end has closed the connection. + * @return true if the socket is closed, false otherwise + */ +bool ConnectedSocket::IsClosed() const { + return DataRemaining() == 0; +} + + +// LoopbackSocket +// ------------------------------------------------ + + +/* + * Setup this loopback socket + */ +bool LoopbackSocket::Init() { + if (m_fd_pair[0] != INVALID_SOCKET || m_fd_pair[1] != INVALID_SOCKET) + return false; + + if (pipe(m_fd_pair) < 0) { + OLA_WARN << "pipe() failed, " << strerror(errno); + return false; + } + + SetReadNonBlocking(); + SetNoSigPipe(WriteDescriptor()); + return true; +} + + +/* + * Close the loopback socket + * @return true if close succeeded, false otherwise + */ +bool LoopbackSocket::Close() { + if (m_fd_pair[0] != INVALID_SOCKET) + close(m_fd_pair[0]); + + if (m_fd_pair[1] != INVALID_SOCKET) + close(m_fd_pair[1]); + + m_fd_pair[0] = INVALID_SOCKET; + m_fd_pair[1] = INVALID_SOCKET; + return true; +} + + +/* + * Close the write portion of the loopback socket + * @return true if close succeeded, false otherwise + */ +bool LoopbackSocket::CloseClient() { + if (m_fd_pair[1] != INVALID_SOCKET) + close(m_fd_pair[1]); + + m_fd_pair[1] = INVALID_SOCKET; + return true; +} + + + +// PipeSocket +// ------------------------------------------------ + +/* + * Create a new pipe socket + */ +bool PipeSocket::Init() { + if (m_in_pair[0] != INVALID_SOCKET || m_out_pair[1] != INVALID_SOCKET) + return false; + + if (pipe(m_in_pair) < 0) { + OLA_WARN << "pipe() failed, " << strerror(errno); + return false; + } + + if (pipe(m_out_pair) < 0) { + OLA_WARN << "pipe() failed, " << strerror(errno); + close(m_in_pair[0]); + close(m_in_pair[1]); + m_in_pair[0] = m_in_pair[1] = INVALID_SOCKET; + return false; + } + + SetReadNonBlocking(); + SetNoSigPipe(WriteDescriptor()); + return true; +} + + +/* + * Fetch the other end of the pipe socket. The caller now owns the new + * PipeSocket. + * @returns NULL if the socket wasn't initialized correctly. + */ +PipeSocket *PipeSocket::OppositeEnd() { + if (m_in_pair[0] == INVALID_SOCKET || m_out_pair[1] == INVALID_SOCKET) + return NULL; + + if (!m_other_end) { + m_other_end = new PipeSocket(m_out_pair, m_in_pair, this); + m_other_end->SetReadNonBlocking(); + } + return m_other_end; +} + + +/* + * Close this PipeSocket + */ +bool PipeSocket::Close() { + if (m_in_pair[0] != INVALID_SOCKET) + close(m_in_pair[0]); + + if (m_out_pair[1] != INVALID_SOCKET) + close(m_out_pair[1]); + + m_in_pair[0] = INVALID_SOCKET; + m_out_pair[1] = INVALID_SOCKET; + return true; +} + + +/* + * Close the write portion of this PipeSocket + */ +bool PipeSocket::CloseClient() { + if (m_out_pair[1] != INVALID_SOCKET) + close(m_out_pair[1]); + + m_out_pair[1] = INVALID_SOCKET; + return true; +} + + +// TcpSocket +// ------------------------------------------------ + +/* + * Connect + * @param ip_address the IP to connect to + * @param port the port to connect to + */ +TcpSocket* TcpSocket::Connect(const std::string &ip_address, + unsigned short port) { + struct sockaddr_in server_address; + socklen_t length = sizeof(server_address); + + int sd = socket(AF_INET, SOCK_STREAM, 0); + if (sd < 0) { + OLA_WARN << "socket() failed, " << strerror(errno); + return NULL; + } + + // setup + memset(&server_address, 0x00, sizeof(server_address)); + server_address.sin_family = AF_INET; + server_address.sin_port = HostToNetwork(port); + + if (!StringToAddress(ip_address, server_address.sin_addr)) { + close(sd); + return NULL; + } + + if (connect(sd, (struct sockaddr*) &server_address, length)) { + OLA_WARN << "connect to " << ip_address << ":" << port << " failed, " + << strerror(errno); + return false; + } + TcpSocket *socket = new TcpSocket(sd); + socket->SetReadNonBlocking(); + return socket; +} + + +/* + * Close this TcpSocket + */ +bool TcpSocket::Close() { + if (m_sd != INVALID_SOCKET) { + close(m_sd); + m_sd = INVALID_SOCKET; + } + return true; +} + + +// DeviceSocket +// ------------------------------------------------ + +bool DeviceSocket::Close() { + if (m_fd == INVALID_SOCKET) + return true; + + int ret = close(m_fd); + m_fd = INVALID_SOCKET; + return ret == 0; +} + + +// UdpSocket +// ------------------------------------------------ + +/* + * Start listening + * @return true if it succeeded, false otherwise + */ +bool UdpSocket::Init() { + if (m_fd != INVALID_SOCKET) + return false; + + int sd = socket(PF_INET, SOCK_DGRAM, 0); + + if (sd < 0) { + OLA_WARN << "Could not create socket " << strerror(errno); + return false; + } + + m_fd = sd; + return true; +} + + +/* + * Bind this socket to an external address/port + */ +bool UdpSocket::Bind(unsigned short port) { + if (m_fd == INVALID_SOCKET) + return false; + + struct sockaddr_in servAddr; + memset(&servAddr, 0x00, sizeof(servAddr)); + servAddr.sin_family = AF_INET; + servAddr.sin_port = HostToNetwork(port); + servAddr.sin_addr.s_addr = HostToNetwork(INADDR_ANY); + + OLA_DEBUG << "Binding to " << inet_ntoa(servAddr.sin_addr) << ":" << port; + + if (bind(m_fd, (struct sockaddr*) &servAddr, sizeof(servAddr)) == -1) { + OLA_INFO << "Failed to bind socket " << strerror(errno); + return false; + } + m_bound_to_port = true; + return true; +} + + +/* + * Close this socket + */ +bool UdpSocket::Close() { + if (m_fd == INVALID_SOCKET) + return false; + + m_bound_to_port = false; + int ret = true; + if (close(m_fd)) { + OLA_WARN << "close() failed, " << strerror(errno); + ret = false; + } + m_fd = INVALID_SOCKET; + return true; +} + + +/* + * Send data. + * @param buffer the data to send + * @param size the length of the data + * @param destination to destination to sent to + * @return the number of bytes sent + */ +ssize_t UdpSocket::SendTo(const uint8_t *buffer, + unsigned int size, + const struct sockaddr_in &destination) const { + ssize_t bytes_sent = sendto(m_fd, buffer, size, 0, + (struct sockaddr*) &destination, + sizeof(struct sockaddr)); + if (bytes_sent < 0 || static_cast(bytes_sent) != size) + OLA_WARN << "Failed to send, " << strerror(errno); + return bytes_sent; +} + + +/* + * Send data + * @param buffer the data to send + * @param size the length of the data + * @param ip_address the IP to send to + * @param port the port to send to + * @return the number of bytes sent + */ +ssize_t UdpSocket::SendTo(const uint8_t *buffer, + unsigned int size, + const std::string &ip_address, + unsigned short port) const { + struct sockaddr_in destination; + memset(&destination, 0x00, sizeof(destination)); + destination.sin_family = AF_INET; + destination.sin_port = HostToNetwork(port); + + if (!StringToAddress(ip_address, destination.sin_addr)) + return 0; + return SendTo(buffer, size, destination); +} + + +/* + * Receive data + * @param buffer the buffer to store the data + * @param data_read the size of the buffer, updated with the number of bytes + * read + * @return true or false + */ +bool UdpSocket::RecvFrom(uint8_t *buffer, ssize_t *data_read) const { + socklen_t length = 0; + return _RecvFrom(buffer, data_read, NULL, &length); +} + + +/* + * Receive data and record the src address & port + * @param buffer the buffer to store the data + * @param data_read the size of the buffer, updated with the number of bytes + * read + * @return true or false + */ +bool UdpSocket::RecvFrom(uint8_t *buffer, + ssize_t *data_read, + struct sockaddr_in &source, + socklen_t &src_size) const { + return _RecvFrom(buffer, data_read, &source, &src_size); +} + + +/* + * Enable broadcasting for this socket. + * @return true if it worked, false otherwise + */ +bool UdpSocket::EnableBroadcast() { + if (m_fd == INVALID_SOCKET) + return false; + + int broadcast_flag = 1; + if (setsockopt(m_fd, SOL_SOCKET, SO_BROADCAST, &broadcast_flag, + sizeof(broadcast_flag)) + == -1) { + OLA_WARN << "Failed to enable broadcasting: " << strerror(errno); + return false; + } + return true; +} + + +/* + * Join a multicast group + * @param group the address of the group to join + * @return true if it worked, false otherwise + */ +bool UdpSocket::JoinMulticast(const struct in_addr &interface, + const struct in_addr &group, + bool multicast_loop) { + uint8_t loop = multicast_loop; + struct ip_mreq mreq; + mreq.imr_interface = interface; + mreq.imr_multiaddr = group; + + if (setsockopt(m_fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, + sizeof(mreq)) < 0) { + OLA_WARN << "Failed to join multicast group " << inet_ntoa(group) << + ": " << strerror(errno); + return false; + } + + if (!multicast_loop) { + if (setsockopt(m_fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loop, sizeof(loop))) { + OLA_WARN << "Failed to disable looping for " << m_fd << ":" << + strerror(errno); + return false; + } + } + return true; +} + + +/* + * Join a multicase group + */ +bool UdpSocket::JoinMulticast(const struct in_addr &interface, + const string &address, + bool loop) { + struct in_addr addr; + if (!StringToAddress(address, addr)) + return false; + return JoinMulticast(interface, addr, loop); +} + + +/* + * Leave a multicast group + * @param group the address of the group to join + * @return true if it worked, false otherwise + */ +bool UdpSocket::LeaveMulticast(const struct in_addr &interface, + const struct in_addr &group) { + struct ip_mreq mreq; + mreq.imr_interface = interface; + mreq.imr_multiaddr = group; + + if (setsockopt(m_fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, + sizeof(mreq)) < 0) { + OLA_WARN << "Failed to leave multicast group " << inet_ntoa(group) << + ": " << strerror(errno); + return false; + } + return true; +} + + +/* + * Leave a multicase group + */ +bool UdpSocket::LeaveMulticast(const struct in_addr &interface, + const string &address) { + struct in_addr addr; + if (!StringToAddress(address, addr)) + return false; + return LeaveMulticast(interface, addr); +} + +bool UdpSocket::_RecvFrom(uint8_t *buffer, + ssize_t *data_read, + struct sockaddr_in *source, + socklen_t *src_size) const { + *data_read = recvfrom(m_fd, buffer, *data_read, 0, + (struct sockaddr*) source, + src_size); + if (*data_read < 0) { + OLA_WARN << "recvfrom failed: " << strerror(errno); + return false; + } + return true; +} + + +/* + * Set the tos field for a socket + * @param tos the tos field + */ +bool UdpSocket::SetTos(uint8_t tos) { + unsigned int value = tos & 0xFC; // zero the ECN fields + if (setsockopt(m_fd, IPPROTO_IP, IP_TOS, &value, sizeof(value))) { + OLA_WARN << "Failed to set tos for " << m_fd << ", " << strerror(errno); + return false; + } + return true; +} + + +// TcpAcceptingSocket +// ------------------------------------------------ + +/* + * Create a new TcpListeningSocket + * @param address the address to listen on + * @param port the port to listen on + * @param backlog the backlog + */ +TcpAcceptingSocket::TcpAcceptingSocket(const std::string &address, + unsigned short port, + int backlog): + AcceptingSocket(), + m_address(address), + m_port(port), + m_sd(INVALID_SOCKET), + m_backlog(backlog) { +} + + +/* + * Start listening + * @return true if it succeeded, false otherwise + */ +bool TcpAcceptingSocket::Listen() { + struct sockaddr_in server_address; + int reuse_flag = 1; + + if (m_sd != INVALID_SOCKET) + return false; + + // setup + memset(&server_address, 0x00, sizeof(server_address)); + server_address.sin_family = AF_INET; + server_address.sin_port = HostToNetwork(m_port); + + if (!StringToAddress(m_address, server_address.sin_addr)) + return false; + + int sd = socket(AF_INET, SOCK_STREAM, 0); + if (sd < 0) { + OLA_WARN << "socket() failed: " << strerror(errno); + return false; + } + + if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &reuse_flag, + sizeof(reuse_flag))) { + OLA_WARN << "can't set reuse for " << sd << ", " << strerror(errno); + close(sd); + return false; + } + + if (bind(sd, (struct sockaddr *) &server_address, + sizeof(server_address)) == -1) { + OLA_WARN << "bind to " << m_address << ":" << m_port << " failed, " + << strerror(errno); + close(sd); + return false; + } + + if (listen(sd, m_backlog)) { + OLA_WARN << "listen on " << m_address << ":" << m_port << " failed, " + << strerror(errno); + return false; + } + m_sd = sd; + return true; +} + + +/* + * Stop listening & close this socket + * @return true if close succeeded, false otherwise + */ +bool TcpAcceptingSocket::Close() { + bool ret = true; + if (m_sd != INVALID_SOCKET) + if (close(m_sd)) { + OLA_WARN << "close() failed " << strerror(errno); + ret = false; + } + m_sd = INVALID_SOCKET; + return ret; +} + + +/* + * Accept new connections + * @return a new connected socket + */ +ConnectedSocket *TcpAcceptingSocket::Accept() { + struct sockaddr_in cli_address; + socklen_t length = sizeof(cli_address); + + if (m_sd == INVALID_SOCKET) + return NULL; + + int sd = accept(m_sd, (struct sockaddr*) &cli_address, &length); + if (sd < 0) { + OLA_WARN << "accept() failed, " << strerror(errno); + return NULL; + } + + TcpSocket *socket = new TcpSocket(sd); + socket->SetReadNonBlocking(); + return socket; +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/SocketTest.cpp b/open-lighting-architecture/ola-0.8.4/common/network/SocketTest.cpp new file mode 100644 index 0000000..3f927b7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/SocketTest.cpp @@ -0,0 +1,432 @@ +/* + * 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 Library 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. + * + * SocketTest.cpp + * Test fixture for the Socket classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "ola/Closure.h" +#include "ola/network/NetworkUtils.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" + +using std::string; +using ola::network::AcceptingSocket; +using ola::network::ConnectedSocket; +using ola::network::LoopbackSocket; +using ola::network::PipeSocket; +using ola::network::SelectServer; +using ola::network::TcpAcceptingSocket; +using ola::network::TcpSocket; +using ola::network::StringToAddress; +using ola::network::UdpSocket; + +static const char test_cstring[] = "Foo"; +// used to set a timeout which aborts the tests +static const int ABORT_TIMEOUT_IN_MS = 1000; + +class SocketTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(SocketTest); + CPPUNIT_TEST(testLoopbackSocket); + CPPUNIT_TEST(testPipeSocketClientClose); + CPPUNIT_TEST(testPipeSocketServerClose); + CPPUNIT_TEST(testTcpSocketClientClose); + CPPUNIT_TEST(testTcpSocketServerClose); + CPPUNIT_TEST(testUdpSocket); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testLoopbackSocket(); + void testPipeSocketClientClose(); + void testPipeSocketServerClose(); + void testTcpSocketClientClose(); + void testTcpSocketServerClose(); + void testUdpSocket(); + + // timing out indicates something went wrong + void Timeout() { + CPPUNIT_ASSERT(false); + m_timeout_closure = NULL; + } + + // Socket data actions + void ReceiveAndClose(ConnectedSocket *socket); + void ReceiveAndTerminate(ConnectedSocket *socket); + void Receive(ConnectedSocket *socket); + void ReceiveAndSend(ConnectedSocket *socket); + void ReceiveSendAndClose(ConnectedSocket *socket); + void AcceptAndSend(TcpAcceptingSocket *socket); + void AcceptSendAndClose(TcpAcceptingSocket *socket); + void UdpReceiveAndTerminate(UdpSocket *socket); + void UdpReceiveAndSend(UdpSocket *socket); + + // Socket close actions + void TerminateOnClose() { + m_ss->Terminate(); + } + + private: + SelectServer *m_ss; + AcceptingSocket *m_accepting_socket; + ola::SingleUseClosure *m_timeout_closure; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(SocketTest); + + +/* + * Setup the select server + */ +void SocketTest::setUp() { + m_ss = new SelectServer(); + m_timeout_closure = ola::NewSingleClosure(this, &SocketTest::Timeout); + CPPUNIT_ASSERT(m_ss->RegisterSingleTimeout(ABORT_TIMEOUT_IN_MS, + m_timeout_closure)); +} + + +/* + * Cleanup the select server + */ +void SocketTest::tearDown() { + delete m_ss; +} + + +/* + * Test a loopback socket works correctly + */ +void SocketTest::testLoopbackSocket() { + LoopbackSocket socket; + CPPUNIT_ASSERT(socket.Init()); + CPPUNIT_ASSERT(!socket.Init()); + socket.SetOnData(ola::NewClosure(this, &SocketTest::ReceiveAndTerminate, + static_cast(&socket))); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + ssize_t bytes_sent = socket.Send( + reinterpret_cast(test_cstring), + sizeof(test_cstring)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + m_ss->Run(); + m_ss->RemoveSocket(&socket); +} + + +/* + * Test a pipe socket works correctly. + * The client sends some data and expects the same data to be returned. The + * client then closes the connection. + */ +void SocketTest::testPipeSocketClientClose() { + PipeSocket socket; + CPPUNIT_ASSERT(socket.Init()); + CPPUNIT_ASSERT(!socket.Init()); + + socket.SetOnData( + ola::NewClosure(this, &SocketTest::ReceiveAndClose, + static_cast(&socket))); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + PipeSocket *other_end = socket.OppositeEnd(); + CPPUNIT_ASSERT(other_end); + other_end->SetOnData( + ola::NewClosure(this, &SocketTest::ReceiveAndSend, + static_cast(other_end))); + other_end->SetOnClose(ola::NewSingleClosure(this, + &SocketTest::TerminateOnClose)); + CPPUNIT_ASSERT(m_ss->AddSocket(other_end)); + + ssize_t bytes_sent = socket.Send( + reinterpret_cast(test_cstring), + sizeof(test_cstring)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + m_ss->Run(); + m_ss->RemoveSocket(&socket); + m_ss->RemoveSocket(other_end); + delete other_end; +} + + +/* + * Test a pipe socket works correctly. + * The client sends some data. The server echos the data and closes the + * connection. + */ +void SocketTest::testPipeSocketServerClose() { + PipeSocket socket; + CPPUNIT_ASSERT(socket.Init()); + CPPUNIT_ASSERT(!socket.Init()); + + socket.SetOnData(ola::NewClosure( + this, &SocketTest::Receive, + static_cast(&socket))); + socket.SetOnClose(ola::NewSingleClosure(this, &SocketTest::TerminateOnClose)); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + PipeSocket *other_end = socket.OppositeEnd(); + CPPUNIT_ASSERT(other_end); + other_end->SetOnData(ola::NewClosure( + this, &SocketTest::ReceiveSendAndClose, + static_cast(other_end))); + CPPUNIT_ASSERT(m_ss->AddSocket(other_end)); + + ssize_t bytes_sent = socket.Send( + reinterpret_cast(test_cstring), + sizeof(test_cstring)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + m_ss->Run(); + m_ss->RemoveSocket(&socket); + m_ss->RemoveSocket(other_end); + delete other_end; +} + + +/* + * Test TCP sockets work correctly. + * The client connects and the server sends some data. The client checks the + * data matches and then closes the connection. + */ +void SocketTest::testTcpSocketClientClose() { + string ip_address = "127.0.0.1"; + uint16_t server_port = 9010; + TcpAcceptingSocket socket(ip_address, server_port); + CPPUNIT_ASSERT(socket.Listen()); + CPPUNIT_ASSERT(!socket.Listen()); + + socket.SetOnData(ola::NewClosure(this, &SocketTest::AcceptAndSend, &socket)); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + TcpSocket *client_socket = TcpSocket::Connect(ip_address, server_port); + CPPUNIT_ASSERT(client_socket); + client_socket->SetOnData(ola::NewClosure( + this, &SocketTest::ReceiveAndClose, + static_cast(client_socket))); + CPPUNIT_ASSERT(m_ss->AddSocket(client_socket)); + m_ss->Run(); + m_ss->RemoveSocket(&socket); + m_ss->RemoveSocket(client_socket); + delete client_socket; +} + + +/* + * Test TCP sockets work correctly. + * The client connects and the server then sends some data and closes the + * connection. + */ +void SocketTest::testTcpSocketServerClose() { + string ip_address = "127.0.0.1"; + uint16_t server_port = 9010; + TcpAcceptingSocket socket(ip_address, server_port); + CPPUNIT_ASSERT(socket.Listen()); + CPPUNIT_ASSERT(!socket.Listen()); + + socket.SetOnData( + ola::NewClosure(this, &SocketTest::AcceptSendAndClose, &socket)); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + // The client socket checks the response and terminates on close + TcpSocket *client_socket = TcpSocket::Connect(ip_address, server_port); + CPPUNIT_ASSERT(client_socket); + + client_socket->SetOnData(ola::NewClosure( + this, &SocketTest::Receive, + static_cast(client_socket))); + client_socket->SetOnClose( + ola::NewSingleClosure(this, &SocketTest::TerminateOnClose)); + CPPUNIT_ASSERT(m_ss->AddSocket(client_socket)); + + m_ss->Run(); + m_ss->RemoveSocket(&socket); + m_ss->RemoveSocket(client_socket); + delete client_socket; +} + + +/* + * Test UDP sockets work correctly. + * The client connects and the server sends some data. The client checks the + * data matches and then closes the connection. + */ +void SocketTest::testUdpSocket() { + string ip_address = "127.0.0.1"; + uint16_t server_port = 9010; + UdpSocket socket; + CPPUNIT_ASSERT(socket.Init()); + CPPUNIT_ASSERT(!socket.Init()); + CPPUNIT_ASSERT(socket.Bind(server_port)); + CPPUNIT_ASSERT(!socket.Bind(server_port)); + + socket.SetOnData( + ola::NewClosure(this, &SocketTest::UdpReceiveAndSend, &socket)); + CPPUNIT_ASSERT(m_ss->AddSocket(&socket)); + + UdpSocket client_socket; + CPPUNIT_ASSERT(client_socket.Init()); + CPPUNIT_ASSERT(!client_socket.Init()); + + client_socket.SetOnData( + ola::NewClosure( + this, &SocketTest::UdpReceiveAndTerminate, + static_cast(&client_socket))); + CPPUNIT_ASSERT(m_ss->AddSocket(&client_socket)); + + ssize_t bytes_sent = client_socket.SendTo( + reinterpret_cast(test_cstring), + sizeof(test_cstring), + ip_address, + server_port); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + m_ss->Run(); + m_ss->RemoveSocket(&socket); + m_ss->RemoveSocket(&client_socket); +} + + + +/* + * Receive some data and close the socket + */ +void SocketTest::ReceiveAndClose(ConnectedSocket *socket) { + Receive(socket); + m_ss->RemoveSocket(socket); + socket->Close(); +} + + +/* + * Receive some data and terminate + */ +void SocketTest::ReceiveAndTerminate(ConnectedSocket *socket) { + Receive(socket); + m_ss->Terminate(); +} + + +/* + * Receive some data and check it's what we expected. + */ +void SocketTest::Receive(ConnectedSocket *socket) { + // try to read more than what we sent to test non-blocking + uint8_t buffer[sizeof(test_cstring) + 10]; + unsigned int data_read; + + CPPUNIT_ASSERT(!socket->Receive(buffer, sizeof(buffer), data_read)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), + data_read); + CPPUNIT_ASSERT(!memcmp(test_cstring, buffer, data_read)); +} + + +/* + * Receive some data and send it back + */ +void SocketTest::ReceiveAndSend(ConnectedSocket *socket) { + uint8_t buffer[sizeof(test_cstring) + 10]; + unsigned int data_read; + socket->Receive(buffer, sizeof(buffer), data_read); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), + data_read); + ssize_t bytes_sent = socket->Send(buffer, data_read); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); +} + + +/* + * Receive some data, send the same data and close + */ +void SocketTest::ReceiveSendAndClose(ConnectedSocket *socket) { + ReceiveAndSend(socket); + m_ss->RemoveSocket(socket); + socket->Close(); +} + + +/* + * Accept a new connection and send some test data + */ +void SocketTest::AcceptAndSend(TcpAcceptingSocket *socket) { + ConnectedSocket *new_socket = socket->Accept(); + CPPUNIT_ASSERT(new_socket); + ssize_t bytes_sent = new_socket->Send( + reinterpret_cast(test_cstring), + sizeof(test_cstring)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + new_socket->SetOnClose(ola::NewSingleClosure(this, + &SocketTest::TerminateOnClose)); + m_ss->AddSocket(new_socket, true); +} + + +/* + * Accept a new connect, send some data and close + */ +void SocketTest::AcceptSendAndClose(TcpAcceptingSocket *socket) { + ConnectedSocket *new_socket = socket->Accept(); + CPPUNIT_ASSERT(new_socket); + ssize_t bytes_sent = new_socket->Send( + reinterpret_cast(test_cstring), + sizeof(test_cstring)); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), bytes_sent); + new_socket->Close(); + delete new_socket; +} + + +/* + * Receive some data and check it. + */ +void SocketTest::UdpReceiveAndTerminate(UdpSocket *socket) { + struct in_addr expected_address; + CPPUNIT_ASSERT(StringToAddress("127.0.0.1", expected_address)); + + struct sockaddr_in src; + socklen_t src_size = sizeof(src); + uint8_t buffer[sizeof(test_cstring) + 10]; + ssize_t data_read = sizeof(buffer); + socket->RecvFrom(buffer, &data_read, src, src_size); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), data_read); + CPPUNIT_ASSERT(expected_address.s_addr == src.sin_addr.s_addr); + m_ss->Terminate(); +} + + +/* + * Receive some data and echo it back. + */ +void SocketTest::UdpReceiveAndSend(UdpSocket *socket) { + struct in_addr expected_address; + CPPUNIT_ASSERT(StringToAddress("127.0.0.1", expected_address)); + + struct sockaddr_in src; + socklen_t src_size = sizeof(src); + uint8_t buffer[sizeof(test_cstring) + 10]; + ssize_t data_read = sizeof(buffer); + socket->RecvFrom(buffer, &data_read, src, src_size); + CPPUNIT_ASSERT_EQUAL(static_cast(sizeof(test_cstring)), data_read); + CPPUNIT_ASSERT(expected_address.s_addr == src.sin_addr.s_addr); + + ssize_t data_sent = socket->SendTo(buffer, data_read, src); + CPPUNIT_ASSERT_EQUAL(data_read, data_sent); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.cpp b/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.cpp new file mode 100644 index 0000000..445bb09 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.cpp @@ -0,0 +1,99 @@ +/* + * 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 Library 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. + * + * WindowsInterfacePicker.cpp + * Chooses an interface to listen on + * Copyright (C) 2005-2010 Simon Newton + */ + +typedef int socklen_t; +#include +#include +#include +#include +#include + +#include "common/network/WindowsInterfacePicker.h" +#include "ola/Logging.h" + +namespace ola { +namespace network { + +using std::vector; + +/* + * Return a vector of interfaces on the system. + */ +vector WindowsInterfacePicker::GetInterfaces() const { + vector interfaces; + + PIP_ADAPTER_INFO pAdapter = NULL; + PIP_ADAPTER_INFO pAdapterInfo; + IP_ADDR_STRING *ipAddress; + ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO); + unsigned long net, mask; + + while (1) { + pAdapterInfo = reinterpret_cast(malloc(ulOutBufLen)); + if (!pAdapterInfo) { + OLA_WARN << "Error allocating memory needed for GetAdaptersinfo"; + return interfaces; + } + + // if ulOutBufLen isn't long enough it'll be set to the size of the buffer + // required + DWORD status = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen); + if (status == NO_ERROR) + break; + + free(pAdapterInfo); + if (status != ERROR_BUFFER_OVERFLOW) { + OLA_WARN << "GetAdaptersInfo failed with error: " << + static_cast(status); + return interfaces; + } + } + + for (pAdapter = pAdapterInfo; + pAdapter && pAdapter < pAdapterInfo + ulOutBufLen; + pAdapter = pAdapter->Next) { + if (pAdapter->Type != MIB_IF_TYPE_ETHERNET) + continue; + + for (ipAddress = &pAdapter->IpAddressList; ipAddress; + ipAddress = ipAddress->Next) { + net = inet_addr(ipAddress->IpAddress.String); + // Windows doesn't seem to have the notion of an interface being 'up' + // so we check if this interface has an address assigned. + if (net) { + Interface interface; + interface.name = pAdapter->AdapterName; // IFNAME_SIZE + memcpy(interface.hw_address, pAdapter->Address, MAC_LENGTH); + struct sockaddr_in *sin = (struct sockaddr_in *) &iface->ifr_addr; + interface.ip_address = sin->sin_addr; + + mask = inet_addr(ipAddress->IpMask.String); + interface.bcast_addr = ((interface.ip_address & mask) | + (0xFFFFFFFF ^ mask)); + + interfaces.push_back(interface); + } + } + } + free(pAdapterInfo); + return interfaces; +} +} // network +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.h b/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.h new file mode 100644 index 0000000..9732062 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/network/WindowsInterfacePicker.h @@ -0,0 +1,40 @@ +/* + * 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 Library 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. + * + * WindowsInterfacePicker.h + * Choose an interface to listen on + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_ +#define COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_ + +#include +#include "ola/network/InterfacePicker.h" + +namespace ola { +namespace network { + +/* + * The InterfacePicker for windows + */ +class WindowsInterfacePicker: public InterfacePicker { + public: + std::vector GetInterfaces() const; +}; +} // network +} // ola +#endif // COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.am new file mode 100644 index 0000000..649ebc1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.am @@ -0,0 +1,13 @@ + + +noinst_LTLIBRARIES = libolaproto.la +nodist_libolaproto_la_SOURCES = Ola.pb.cc +EXTRA_DIST = Ola.proto + +BUILT_SOURCES = Ola.pb.cc Ola.pb.h + +Ola.pb.cc Ola.pb.h: Ola.proto + protoc --cpp_out ./ Ola.proto + +clean-local: + rm -f *.pb.{h,cc} diff --git a/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.in new file mode 100644 index 0000000..0bae10f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/protocol/Makefile.in @@ -0,0 +1,472 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = common/protocol +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolaproto_la_LIBADD = +nodist_libolaproto_la_OBJECTS = Ola.pb.lo +libolaproto_la_OBJECTS = $(nodist_libolaproto_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nodist_libolaproto_la_SOURCES) +DIST_SOURCES = +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +noinst_LTLIBRARIES = libolaproto.la +nodist_libolaproto_la_SOURCES = Ola.pb.cc +EXTRA_DIST = Ola.proto +BUILT_SOURCES = Ola.pb.cc Ola.pb.h +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/protocol/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/protocol/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaproto.la: $(libolaproto_la_OBJECTS) $(libolaproto_la_DEPENDENCIES) + $(CXXLINK) $(libolaproto_la_OBJECTS) $(libolaproto_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Ola.pb.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-local clean-noinstLTLIBRARIES ctags \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +Ola.pb.cc Ola.pb.h: Ola.proto + protoc --cpp_out ./ Ola.proto + +clean-local: + rm -f *.pb.{h,cc} +# 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/open-lighting-architecture/ola-0.8.4/common/protocol/Ola.proto b/open-lighting-architecture/ola-0.8.4/common/protocol/Ola.proto new file mode 100644 index 0000000..089d7e9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/protocol/Ola.proto @@ -0,0 +1,242 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Ola.proto + * Defines the protocol buffers used to talk to olad + * Copyright (C) 2005 - 2008 Simon Newton + */ + +package ola.proto; + +enum RegisterAction { + REGISTER = 1; + UNREGISTER = 2; +} + +enum PatchAction { + PATCH = 1; + UNPATCH = 2; +} + +enum MergeMode { + HTP = 1; + LTP = 2; +} + +enum PluginIds { + OLA_PLUGIN_ALL = 0; + OLA_PLUGIN_DUMMY = 1; + OLA_PLUGIN_ARTNET = 2; + OLA_PLUGIN_SHOWNET = 3; + OLA_PLUGIN_ESPNET = 4; + OLA_PLUGIN_USBPRO = 5; + OLA_PLUGIN_OPENDMX = 6; + OLA_PLUGIN_SANDNET = 7; + OLA_PLUGIN_STAGEPROFI = 8; + OLA_PLUGIN_PATHPORT = 9; + OLA_PLUGIN_DMX4LINUX = 10; + OLA_PLUGIN_E131 = 11; + OLA_PLUGIN_USBDMX = 12; +} + + + +// This is a special string which indicates that no response will be received +// for an RPC. +message STREAMING_NO_RESPONSE {} + +// Generic Ack Message +message Ack {} + +// request the list of available plugins +message PluginListRequest {} + +message PluginInfo { + required int32 plugin_id = 1; + required string name = 2; +} + +message PluginListReply { + repeated PluginInfo plugin = 1; +} + +// request the description for a plugin +message PluginDescriptionRequest { + required int32 plugin_id = 1; +} + +message PluginDescriptionReply { + required string name = 1; + required string description = 2; +} + + +// request info on a device +message DeviceInfoRequest { + optional int32 plugin_id = 1; +} + +message PortInfo { + required int32 port_id = 1; + required int32 priority_capability = 2; + required string description = 5; + optional int32 universe = 3; + optional bool active = 4; + optional int32 priority_mode = 6; + optional int32 priority = 7; +} + +message DeviceInfo { + required int32 device_alias = 1; + required int32 plugin_id = 2; + required string device_name = 3; + repeated PortInfo input_port = 4; + repeated PortInfo output_port = 5; + required string device_id = 6; +} + +message DeviceInfoReply { + repeated DeviceInfo device = 1; +} + +message DmxData { + required int32 universe = 1; + required bytes data = 2; + optional int32 priority = 3; +} + +message RegisterDmxRequest { + required int32 universe = 1; + required RegisterAction action = 2; +} + +message PatchPortRequest { + required int32 universe = 1; + required int32 device_alias = 2; + required int32 port_id = 3; + required PatchAction action = 4; + required bool is_output = 5; +} + +message UniverseNameRequest { + required int32 universe = 1; + required string name = 2; +} + +message MergeModeRequest { + required int32 universe = 1; + required MergeMode merge_mode = 2; +} + +// request info about a universe +message OptionalUniverseRequest { + optional int32 universe = 1; +} + +message UniverseInfo { + required int32 universe = 1; + required string name = 2; + required MergeMode merge_mode = 3; + required int32 input_port_count = 4; + required int32 output_port_count = 5; + required int32 rdm_devices = 6; +} + +message UniverseInfoReply { + repeated UniverseInfo universe = 1; +} + +message PortPriorityRequest { + required int32 device_alias = 1; + required bool is_output = 2; + required int32 port_id = 3; + required int32 priority_mode = 4; + optional int32 priority = 5; +} + + + +// a device config request +message DeviceConfigRequest { + required int32 device_alias = 1; + required bytes data = 2; +} + +message DeviceConfigReply { + required bytes data = 1; +} + +// RDM Messages +// This represents a UID +message UID { + required int32 esta_id = 1; // only lower 2 bytes are used + required fixed32 device_id = 2; +} + +// Request the UID list for a universe +message UniverseRequest { + required int32 universe = 1; +} + +message UIDListReply { + required int32 universe = 1; + repeated UID uid = 2; +} + +message RDMRequest { + required int32 universe = 1; + required UID uid = 2; + required int32 sub_device = 3; + required int32 param_id = 4; + required bytes data = 5; // 0 - 231 bytes + required bool is_set = 6; +} + +message RDMResponse { + required bool was_broadcast = 1; + required uint32 response_code = 2; + required uint32 message_count = 3; + required bytes data = 4; // 0 - 231 bytes +} + +// Services + +// RPCs handled by the OLA Server +service OlaServerService { + rpc GetPlugins (PluginListRequest) returns (PluginListReply); + rpc GetPluginDescription (PluginDescriptionRequest) returns + (PluginDescriptionReply); + rpc GetDeviceInfo (DeviceInfoRequest) returns (DeviceInfoReply); + rpc GetCandidatePorts (OptionalUniverseRequest) returns (DeviceInfoReply); + rpc ConfigureDevice (DeviceConfigRequest) returns (DeviceConfigReply); + rpc SetPortPriority (PortPriorityRequest) returns (Ack); + rpc GetUniverseInfo (OptionalUniverseRequest) returns (UniverseInfoReply); + rpc SetUniverseName (UniverseNameRequest) returns (Ack); + rpc SetMergeMode (MergeModeRequest) returns (Ack); + rpc PatchPort (PatchPortRequest) returns (Ack); + rpc RegisterForDmx (RegisterDmxRequest) returns (Ack); + rpc UpdateDmxData (DmxData) returns (Ack); + rpc GetDmx (UniverseRequest) returns (DmxData); + rpc GetUIDs (UniverseRequest) returns (UIDListReply); + rpc ForceDiscovery (UniverseRequest) returns (Ack); + rpc SetSourceUID (UID) returns (Ack); + rpc RDMCommand (RDMRequest) returns (RDMResponse); + rpc StreamDmxData (DmxData) returns (STREAMING_NO_RESPONSE); +} + +// RPCs handled by the OLA Client +service OlaClientService { + rpc UpdateDmxData (DmxData) returns (Ack); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.am new file mode 100644 index 0000000..29aa7ac --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.am @@ -0,0 +1,13 @@ +include $(top_srcdir)/common.mk + + +noinst_LTLIBRARIES = libolardm.la +libolardm_la_SOURCES = RDMAPI.cpp RDMCommand.cpp RDMHelper.cpp + +TESTS = RDMTester +check_PROGRAMS = $(TESTS) +RDMTester_SOURCES = RDMAPITest.cpp RDMCommandTest.cpp RDMTester.cpp UIDTest.cpp +RDMTester_CPPFLAGS = $(CPPUNIT_CFLAGS) $(AM_CPPFLAGS) +RDMTester_LDFLAGS = $(CPPUNIT_LIBS) +RDMTester_LDADD = libolardm.la ../logging/liblogging.la \ + ../network/libolanetwork.la ../utils/libolautils.la diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.in new file mode 100644 index 0000000..52f7bef --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/Makefile.in @@ -0,0 +1,627 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = RDMTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/rdm +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolardm_la_LIBADD = +am_libolardm_la_OBJECTS = RDMAPI.lo RDMCommand.lo RDMHelper.lo +libolardm_la_OBJECTS = $(am_libolardm_la_OBJECTS) +am__EXEEXT_1 = RDMTester$(EXEEXT) +am_RDMTester_OBJECTS = RDMTester-RDMAPITest.$(OBJEXT) \ + RDMTester-RDMCommandTest.$(OBJEXT) \ + RDMTester-RDMTester.$(OBJEXT) RDMTester-UIDTest.$(OBJEXT) +RDMTester_OBJECTS = $(am_RDMTester_OBJECTS) +RDMTester_DEPENDENCIES = libolardm.la ../logging/liblogging.la \ + ../network/libolanetwork.la ../utils/libolautils.la +RDMTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(RDMTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolardm_la_SOURCES) $(RDMTester_SOURCES) +DIST_SOURCES = $(libolardm_la_SOURCES) $(RDMTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libolardm.la +libolardm_la_SOURCES = RDMAPI.cpp RDMCommand.cpp RDMHelper.cpp +RDMTester_SOURCES = RDMAPITest.cpp RDMCommandTest.cpp RDMTester.cpp UIDTest.cpp +RDMTester_CPPFLAGS = $(CPPUNIT_CFLAGS) $(AM_CPPFLAGS) +RDMTester_LDFLAGS = $(CPPUNIT_LIBS) +RDMTester_LDADD = libolardm.la ../logging/liblogging.la \ + ../network/libolanetwork.la ../utils/libolautils.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/rdm/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/rdm/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolardm.la: $(libolardm_la_OBJECTS) $(libolardm_la_DEPENDENCIES) + $(CXXLINK) $(libolardm_la_OBJECTS) $(libolardm_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +RDMTester$(EXEEXT): $(RDMTester_OBJECTS) $(RDMTester_DEPENDENCIES) + @rm -f RDMTester$(EXEEXT) + $(RDMTester_LINK) $(RDMTester_OBJECTS) $(RDMTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMAPI.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMCommand.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMHelper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMTester-RDMAPITest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMTester-RDMCommandTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMTester-RDMTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMTester-UIDTest.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +RDMTester-RDMAPITest.o: RDMAPITest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMAPITest.o -MD -MP -MF $(DEPDIR)/RDMTester-RDMAPITest.Tpo -c -o RDMTester-RDMAPITest.o `test -f 'RDMAPITest.cpp' || echo '$(srcdir)/'`RDMAPITest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMAPITest.Tpo $(DEPDIR)/RDMTester-RDMAPITest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMAPITest.cpp' object='RDMTester-RDMAPITest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMAPITest.o `test -f 'RDMAPITest.cpp' || echo '$(srcdir)/'`RDMAPITest.cpp + +RDMTester-RDMAPITest.obj: RDMAPITest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMAPITest.obj -MD -MP -MF $(DEPDIR)/RDMTester-RDMAPITest.Tpo -c -o RDMTester-RDMAPITest.obj `if test -f 'RDMAPITest.cpp'; then $(CYGPATH_W) 'RDMAPITest.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMAPITest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMAPITest.Tpo $(DEPDIR)/RDMTester-RDMAPITest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMAPITest.cpp' object='RDMTester-RDMAPITest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMAPITest.obj `if test -f 'RDMAPITest.cpp'; then $(CYGPATH_W) 'RDMAPITest.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMAPITest.cpp'; fi` + +RDMTester-RDMCommandTest.o: RDMCommandTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMCommandTest.o -MD -MP -MF $(DEPDIR)/RDMTester-RDMCommandTest.Tpo -c -o RDMTester-RDMCommandTest.o `test -f 'RDMCommandTest.cpp' || echo '$(srcdir)/'`RDMCommandTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMCommandTest.Tpo $(DEPDIR)/RDMTester-RDMCommandTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMCommandTest.cpp' object='RDMTester-RDMCommandTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMCommandTest.o `test -f 'RDMCommandTest.cpp' || echo '$(srcdir)/'`RDMCommandTest.cpp + +RDMTester-RDMCommandTest.obj: RDMCommandTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMCommandTest.obj -MD -MP -MF $(DEPDIR)/RDMTester-RDMCommandTest.Tpo -c -o RDMTester-RDMCommandTest.obj `if test -f 'RDMCommandTest.cpp'; then $(CYGPATH_W) 'RDMCommandTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMCommandTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMCommandTest.Tpo $(DEPDIR)/RDMTester-RDMCommandTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMCommandTest.cpp' object='RDMTester-RDMCommandTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMCommandTest.obj `if test -f 'RDMCommandTest.cpp'; then $(CYGPATH_W) 'RDMCommandTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMCommandTest.cpp'; fi` + +RDMTester-RDMTester.o: RDMTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMTester.o -MD -MP -MF $(DEPDIR)/RDMTester-RDMTester.Tpo -c -o RDMTester-RDMTester.o `test -f 'RDMTester.cpp' || echo '$(srcdir)/'`RDMTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMTester.Tpo $(DEPDIR)/RDMTester-RDMTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMTester.cpp' object='RDMTester-RDMTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMTester.o `test -f 'RDMTester.cpp' || echo '$(srcdir)/'`RDMTester.cpp + +RDMTester-RDMTester.obj: RDMTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-RDMTester.obj -MD -MP -MF $(DEPDIR)/RDMTester-RDMTester.Tpo -c -o RDMTester-RDMTester.obj `if test -f 'RDMTester.cpp'; then $(CYGPATH_W) 'RDMTester.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-RDMTester.Tpo $(DEPDIR)/RDMTester-RDMTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMTester.cpp' object='RDMTester-RDMTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-RDMTester.obj `if test -f 'RDMTester.cpp'; then $(CYGPATH_W) 'RDMTester.cpp'; else $(CYGPATH_W) '$(srcdir)/RDMTester.cpp'; fi` + +RDMTester-UIDTest.o: UIDTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-UIDTest.o -MD -MP -MF $(DEPDIR)/RDMTester-UIDTest.Tpo -c -o RDMTester-UIDTest.o `test -f 'UIDTest.cpp' || echo '$(srcdir)/'`UIDTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-UIDTest.Tpo $(DEPDIR)/RDMTester-UIDTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UIDTest.cpp' object='RDMTester-UIDTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-UIDTest.o `test -f 'UIDTest.cpp' || echo '$(srcdir)/'`UIDTest.cpp + +RDMTester-UIDTest.obj: UIDTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT RDMTester-UIDTest.obj -MD -MP -MF $(DEPDIR)/RDMTester-UIDTest.Tpo -c -o RDMTester-UIDTest.obj `if test -f 'UIDTest.cpp'; then $(CYGPATH_W) 'UIDTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UIDTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RDMTester-UIDTest.Tpo $(DEPDIR)/RDMTester-UIDTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UIDTest.cpp' object='RDMTester-UIDTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(RDMTester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o RDMTester-UIDTest.obj `if test -f 'UIDTest.cpp'; then $(CYGPATH_W) 'UIDTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UIDTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPI.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPI.cpp new file mode 100644 index 0000000..8d20e2d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPI.cpp @@ -0,0 +1,3642 @@ +/* + * 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 Library 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. + * + * RDMAPI.cpp + * Provides a generic RDM API that can use different implementations. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include "ola/Callback.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/RDMAPIImplInterface.h" +#include "ola/rdm/RDMEnums.h" +#include "ola/rdm/UID.h" + +namespace ola { +namespace rdm { + +using std::map; +using std::string; +using std::vector; +using ola::SingleUseCallback1; +using ola::SingleUseCallback2; +using ola::SingleUseCallback4; +using ola::network::HostToNetwork; +using ola::network::NetworkToHost; + + +ResponseStatus::ResponseStatus(const RDMAPIImplResponseStatus &status, + const string &data): + m_response_type(VALID_RESPONSE), + m_nack_reason(0), + m_error(status.error) { + if (!m_error.empty()) { + m_response_type = TRANSPORT_ERROR; + } else { + if (status.was_broadcast) { + m_response_type = BROADCAST_REQUEST; + } else if (status.response_type == ola::rdm::NACK_REASON) { + if (data.size() < sizeof(m_nack_reason)) { + m_response_type = MALFORMED_RESPONSE; + m_error = "NACK_REASON data too small"; + } else { + m_response_type = REQUEST_NACKED; + const uint8_t *ptr = reinterpret_cast( + data.c_str()); + m_nack_reason = (ptr[0] << 8) + ptr[1]; + } + } + } +} + + +/* + * Return the number of queues messages for a UID. Note that this is cached on + * the client side so this number may not be correct. + * @param uid the UID to fetch the outstanding message count for + * @return the number of outstanding messages + */ +uint8_t RDMAPI::OutstandingMessagesCount(const UID &uid) { + map::const_iterator iter = m_outstanding_messages.find(uid); + + if (iter == m_outstanding_messages.end()) + return 0; + return iter->second; +} + + +/* + * Fetch a count of the proxied devices + * @param uid the UID of the device to address this message to + * @param callback the Callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return false if an error occurred, true otherwise + */ +bool RDMAPI::GetProxiedDeviceCount( + unsigned int universe, + const UID &uid, + SingleUseCallback3 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetProxiedDeviceCount, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_PROXIED_DEVICE_COUNT), + error); +} + + +/* + * Fetch a list of the proxied devices + * @param uid the UID of the device to address this message to + * @param callback the Callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return false if an error occurred, true otherwise + */ +bool RDMAPI::GetProxiedDevices( + unsigned int universe, + const UID &uid, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetProxiedDevices, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_PROXIED_DEVICES), + error); +} + + +/* + * Get the communication status report + * @param uid the UID of the device to address this message to + * @param callback the Callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return false if an error occurred, true otherwise + */ +bool RDMAPI::GetCommStatus( + unsigned int universe, + const UID &uid, + SingleUseCallback4 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetCommStatus, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_COMMS_STATUS), + error); +} + + +/* + * Clear the Communication status + * @param uid the UID of the device to address this message to + * @param callback the Callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return false if an error occurred, true otherwise + */ +bool RDMAPI::ClearCommStatus( + unsigned int universe, + const UID &uid, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_COMMS_STATUS), + error); +} + + +/* + * Get the status information from a device + * @param uid the UID of the device to address this message to + * @param status_type the Status Type requested + * @param callback the Callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return false if an error occurred, true otherwise + */ +bool RDMAPI::GetStatusMessage( + unsigned int universe, + const UID &uid, + rdm_status_type status_type, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetStatusMessage, + callback); + uint8_t type = static_cast(status_type); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_STATUS_MESSAGES, + &type, + sizeof(type)), + error); +} + + +/* + * Fetch the description for a status id + * @param uid the UID of the device to address this message to + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetStatusIdDescription( + unsigned int universe, + const UID &uid, + uint16_t status_id, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + status_id = HostToNetwork(status_id); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_STATUS_ID_DESCRIPTION, + reinterpret_cast(&status_id), + sizeof(status_id)), + error); +} + + +/* + * Clear the status message queue + * @param uid the UID of the device to address this message to + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::ClearStatusId( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_CLEAR_STATUS_ID), + error); +} + + +/* + * Get the reporting threshold for a device + * @param uid the UID of the device to address this message to + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSubDeviceReporting( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSubDeviceReporting, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD), + error); +} + + +/* + * Set the reporting threshold for a device + * @param uid the UID of the device to address this message to + * @param sub_device the sub device to use + * @param status_type the Status Type to set the threshold as + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetSubDeviceReporting( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + rdm_status_type status_type, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + uint8_t type = static_cast(status_type); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD, + &type, + sizeof(type)), + error); +} + + +/* + * Fetch the supported parameters list + * @param uid the UID of the device to address this message to + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSupportedParameters( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSupportedParameters, + callback); + return m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SUPPORTED_PARAMETERS); +} + + +/* + * Fetch the description of a param ID + * @param uid the UID of the device to address this message to + * @param pid the parameter id to fetch the description for + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetParameterDescription( + unsigned int universe, + const UID &uid, + uint16_t pid, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetParameterDescriptor, + callback); + pid = HostToNetwork(pid); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + ROOT_RDM_DEVICE, + PID_PARAMETER_DESCRIPTION, + reinterpret_cast(&pid), + sizeof(pid)), + error); +} + + +/* + * Fetch the device information + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDeviceInfo( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetDeviceDescriptor, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DEVICE_INFO), + error); +} + + +/* + * Fetch the product detail IDs. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetProductDetailIdList( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetProductDetailIdList, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_PRODUCT_DETAIL_ID_LIST), + error); +} + + +/* + * Fetch the description for a device model. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDeviceModelDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DEVICE_MODEL_DESCRIPTION), + error); +} + + +/* + * Fetch the manufacturer label for a device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetManufacturerLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_MANUFACTURER_LABEL), + error); +} + + +/* + * Fetch the device label + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDeviceLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DEVICE_LABEL), + error); +} + + +/* + * Set the device label + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetDeviceLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const string &label, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + // It doesn't really make sense to broadcast this but allow it anyway + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_DEVICE_LABEL, + reinterpret_cast(label.data()), + label.size()), + error); +} + + +/* + * Check if a device is using the factory defaults + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetFactoryDefaults( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleBoolResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_FACTORY_DEFAULTS), + error); +} + + +/* + * Reset a device to factory defaults + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::ResetToFactoryDefaults( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_FACTORY_DEFAULTS), + error); +} + + +/* + * Get the list of languages this device supports + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetLanguageCapabilities( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetLanguageCapabilities, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_LANGUAGE_CAPABILITIES), + error); +} + + +/* + * Get the language for this device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetLanguage( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetLanguage, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_LANGUAGE), + error); +} + + +/* + * Set the language for this device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param language the language code, only the first two characters are used + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetLanguage( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const string &language, + SingleUseCallback1 *callback, + string *error) { + static const unsigned int DATA_SIZE = 2; + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + if (language.size() != DATA_SIZE) { + if (error) + *error = "Language must be a two letter code"; + delete callback; + return false; + } + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_LANGUAGE, + reinterpret_cast(language.data()), + DATA_SIZE), + error); +} + + +/* + * Get the software version label + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSoftwareVersionLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SOFTWARE_VERSION_LABEL), + error); +} + + +/* + * Get the boot software version. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetBootSoftwareVersion( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetBootSoftwareVersion, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_BOOT_SOFTWARE_VERSION_ID), + error); +} + + +/* + * Get the boot software version label + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetBootSoftwareVersionLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleLabelResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_BOOT_SOFTWARE_VERSION_LABEL), + error); +} + + +/* + * Get the current DMX personality + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDMXPersonality( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback3 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetDMXPersonality, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DMX_PERSONALITY), + error); +} + + +/* + * Set the DMX personality + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param personality the value of the personality to choose + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetDMXPersonality( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t personality, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_DMX_PERSONALITY, + &personality, + sizeof(personality)), + error); +} + + +/* + * Get the description for a DMX personality + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param personality the value of the personality to get the description of + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDMXPersonalityDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t personality, + SingleUseCallback4 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetDMXPersonalityDescription, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DMX_PERSONALITY_DESCRIPTION, + &personality, + sizeof(personality)), + error); +} + + +/* + * Get the DMX start address + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetDMXAddress( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetDMXAddress, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DMX_START_ADDRESS), + error); +} + + +/* + * Set the DMX start address + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param start_address the new start address + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetDMXAddress( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t start_address, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + start_address = HostToNetwork(start_address); + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_DMX_START_ADDRESS, + reinterpret_cast(&start_address), + sizeof(start_address)), + error); +} + + +/* + * Fetch the DMX slot info + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSlotInfo( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSlotInfo, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SLOT_INFO), + error); +} + + +/* + * Fetch a DMX slot description + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param slot_offset the offset of the slot to get the description of + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSlotDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t slot_offset, + SingleUseCallback3 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + slot_offset = HostToNetwork(slot_offset); + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSlotDescription, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SLOT_DESCRIPTION, + reinterpret_cast(&slot_offset), + sizeof(slot_offset)), + error); +} + + +/* + * Get the default value for a slot + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSlotDefaultValues( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSlotDefaultValues, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_DEFAULT_SLOT_VALUE), + error); +} + + +/* + * Get the definition for a sensor + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param sensor_number the sensor index to get the descriptor for + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSensorDefinition( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleGetSensorDefinition, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SENSOR_DEFINITION, + &sensor_number, + sizeof(sensor_number)), + error); +} + + +/* + * Get the value of a sensor + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param sensor_number the sensor index to get the value of + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetSensorValue( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleSensorValue, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SENSOR_VALUE, + &sensor_number, + sizeof(sensor_number)), + error); +} + + +/* + * Reset a sensor + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param sensor_number the sensor index to reset + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::SetSensorValue( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleSensorValue, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_SENSOR_VALUE, + &sensor_number, + sizeof(sensor_number)), + error); +} + + +/* + * Put a sensor into record mode + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param sensor_number the sensor index to record + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::RecordSensors( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_RECORD_SENSORS, + &sensor_number, + sizeof(sensor_number)), + error); +} + + +/* + * Get the device hours + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetDeviceHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU32( + universe, + uid, + sub_device, + callback, + PID_DEVICE_HOURS, + error); +} + + +/* + * Set the device hours + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param device_hours the number of device hours + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetDeviceHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t device_hours, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU32( + universe, + uid, + sub_device, + device_hours, + callback, + PID_DEVICE_HOURS, + error); +} + + +/* +* Get the lamp hours +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetLampHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU32( + universe, + uid, + sub_device, + callback, + PID_LAMP_HOURS, + error); +} + + +/* + * Set the lamp hours + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param lamp_hours the number of lamp hours + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetLampHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t lamp_hours, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU32( + universe, + uid, + sub_device, + lamp_hours, + callback, + PID_LAMP_STRIKES, + error); +} + + +/* +* Get the number of lamp strikes +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetLampStrikes( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU32( + universe, + uid, + sub_device, + callback, + PID_LAMP_STRIKES, + error); +} + + +/* + * Set the lamp strikes + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param lamp_strikes the number of lamp strikes + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetLampStrikes( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t lamp_strikes, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU32( + universe, + uid, + sub_device, + lamp_strikes, + callback, + PID_LAMP_STRIKES, + error); +} + + +/* +* Get the state of the lamp +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetLampState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_LAMP_STATE, + error); +} + + +/* + * Set the lamp state + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param lamp_state the new lamp state + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetLampState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t lamp_state, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + lamp_state, + callback, + PID_LAMP_STATE, + error); +} + + +/* +* Get the mode of the lamp +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetLampMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_LAMP_ON_MODE, + error); +} + + +/* + * Set the lamp mode + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param lamp_mode the new lamp mode + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetLampMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t lamp_mode, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + lamp_mode, + callback, + PID_LAMP_ON_MODE, + error); +} + + +/* +* Get the number of device power cycles +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetDevicePowerCycles( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU32( + universe, + uid, + sub_device, + callback, + PID_DEVICE_POWER_CYCLES, + error); +} + + +/* + * Set the number of power cycles + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param power_cycles the number of power cycles + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetDevicePowerCycles( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t power_cycles, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU32( + universe, + uid, + sub_device, + power_cycles, + callback, + PID_DEVICE_POWER_CYCLES, + error); +} + + +/* +* Get the display invert setting +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetDisplayInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_DISPLAY_INVERT, + error); +} + + +/* + * Set the display invert setting + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param display_invert the new invert setting + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetDisplayInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t display_invert, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + display_invert, + callback, + PID_DISPLAY_INVERT, + error); +} + + +/* +* Get the display level +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetDisplayLevel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_DISPLAY_LEVEL, + error); +} + + +/* + * Set the display level + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param display_level the new setting + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetDisplayLevel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t display_level, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + display_level, + callback, + PID_DISPLAY_LEVEL, + error); +} + + +/* +* Get the pan invert parameter +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetPanInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_PAN_INVERT, + error); +} + + +/* + * Invert the pan parameter + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param invert set to true to invert + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetPanInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t invert, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + invert, + callback, + PID_PAN_INVERT, + error); +} + + +/* +* Get the tilt invert parameter +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetTiltInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_TILT_INVERT, + error); +} + + +/* + * Invert the tilt parameter + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param invert set to true to invert + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetTiltInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t invert, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + invert, + callback, + PID_TILT_INVERT, + error); +} + + +/* +* Get the pan/tilt swap parameter +* @param uid the UID to fetch the outstanding message count for +* @param sub_device the sub device to use +* @param callback the callback to invoke when this request completes +* @param error a pointer to a string which it set if an error occurs +* @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetPanTiltSwap( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericGetU8( + universe, + uid, + sub_device, + callback, + PID_PAN_TILT_SWAP, + error); +} + + +/* + * Swap the pan and tilt actions + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param swap, true to swap, false otherwise + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetPanTiltSwap( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t swap, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + return GenericSetU8( + universe, + uid, + sub_device, + swap, + callback, + PID_PAN_TILT_SWAP, + error); +} + + +/* + * Get the clock value + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetClock( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleClock, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_REAL_TIME_CLOCK), + error); +} + + +/* + * Set the clock value + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param clock, the new clock settings + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetClock( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const ClockValue &clock, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + ClockValue clock_data; + memcpy(&clock_data, &clock, sizeof(clock_data)); + clock_data.year = HostToNetwork(clock_data.year); + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_REAL_TIME_CLOCK, + reinterpret_cast(&clock_data), + sizeof(struct clock_value_s)), + error); +} + + +/* + * Check the identify mode for a device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise + */ +bool RDMAPI::GetIdentifyMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleBoolResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_IDENTIFY_DEVICE), + error); +} + + +/* + * Change the identify mode for a device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param mode the identify mode to set + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::IdentifyDevice( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + bool mode, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + uint8_t option = mode; + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_IDENTIFY_DEVICE, + &option, + sizeof(option)), + error); +} + + +/* + * Reset a device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param warm_reset true for a warm reset, false for a cold reset + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::ResetDevice( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + bool warm_reset, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + uint8_t option = warm_reset ? 0x01 : 0xff; + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_IDENTIFY_DEVICE, + &option, + sizeof(option)), + error); +} + + +/* + * Get the power state for a device + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::GetPowerState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleU8Response, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_POWER_STATE), + error); +} + + +/* + * Set the power state for a device. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param power_state the new power state + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetPowerState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + rdm_power_state power_state, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + uint8_t option = static_cast(power_state); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_POWER_STATE, + &option, + sizeof(option)), + error); +} + + +/* + * Check if a device is in self test mode. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SelfTestEnabled( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleBoolResponse, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_PERFORM_SELFTEST), + error); +} + + +/* + * Perform a self test on a device. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param self_test_number the number of the self test to perform. + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::PerformSelfTest( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t self_test_number, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_PERFORM_SELFTEST, + &self_test_number, + sizeof(self_test_number)), + error); +} + + +/* + * Fetch the description of a self test. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param self_test_number the number of the self test to fetch the description + * of. + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SelfTestDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t self_test_number, + SingleUseCallback3 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleSelfTestDescription, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_SELF_TEST_DESCRIPTION, + &self_test_number, + sizeof(self_test_number)), + error); +} + + +/* + * Capture the current state into a preset. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param scene the number of the preset scene to store + * @param fade_up_time the time in 10s of a second to fade up this scene. + * @param fade_down_time the time in 10s of a second to fade down the previous + * scene. + * @param wait_time the time in 10s of a second to hold this scene when the + * playback mode is PRESET_PLAYBACK_ALL + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::CapturePreset( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t scene, + uint16_t fade_up_time, + uint16_t fade_down_time, + uint16_t wait_time, + SingleUseCallback1 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + struct preset_config { + uint16_t scene; + uint16_t fade_up_time; + uint16_t fade_down_time; + uint16_t wait_time; + } __attribute__((packed)); + struct preset_config raw_config; + + raw_config.scene = HostToNetwork(scene); + raw_config.fade_up_time = HostToNetwork(fade_up_time); + raw_config.fade_down_time = HostToNetwork(fade_down_time); + raw_config.wait_time = HostToNetwork(wait_time); + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_CAPTURE_PRESET, + reinterpret_cast(&raw_config), + sizeof(raw_config)), + error); +} + + +/* + * Fetch the current playback mode. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::PresetPlaybackMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback3 *callback, + string *error) { + if (CheckCallback(error, callback)) + return false; + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandlePlaybackMode, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + PID_PRESET_PLAYBACK, + NULL, + 0), + error); +} + + +/* + * Set the current playback mode. + * @param uid the UID to fetch the outstanding message count for + * @param sub_device the sub device to use + * @param playback_mode the playback scene to use, PRESET_PLAYBACK_OFF or + * PRESET_PLAYBACK_ALL. + * @param level the level to use for the scene. + * @param callback the callback to invoke when this request completes + * @param error a pointer to a string which it set if an error occurs + * @return true if the request is sent correctly, false otherwise +*/ +bool RDMAPI::SetPresetPlaybackMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t playback_mode, + uint8_t level, + SingleUseCallback1 *callback, + string *error) { + + if (CheckCallback(error, callback)) + return false; + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + struct preset_config { + uint16_t mode; + uint8_t level; + } __attribute__((packed)); + struct preset_config raw_config; + + raw_config.mode = HostToNetwork(playback_mode); + raw_config.level = level; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + PID_PRESET_PLAYBACK, + reinterpret_cast(&raw_config), + sizeof(raw_config)), + error); +} + + +// Handlers follow. These are invoked by the RDMAPIImpl when responses arrive +// ---------------------------------------------------------------------------- + +/* + * Handle a response that contains a 32 byte ascii string + */ +void RDMAPI::_HandleLabelResponse( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE && + data.size() > LABEL_SIZE) { + std::stringstream str; + str << "PDL needs to be <= " << LABEL_SIZE << ", was " << data.size(); + response_status.MalformedResponse(str.str()); + } + + string label = data; + ShortenString(&label); + callback->Run(response_status, label); +} + + +/* + * Handle a response that contains a bool + */ +void RDMAPI::_HandleBoolResponse( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + static const unsigned int DATA_SIZE = 1; + ResponseStatus response_status(status, data); + bool option = false; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() == DATA_SIZE) { + option = data.data()[0]; + } else { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } + } + callback->Run(response_status, option); +} + + +/* + * Handle a response that contains a uint8_t + */ +void RDMAPI::_HandleU8Response( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + uint8_t value = 0; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() == sizeof(value)) { + value = data.data()[0]; + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(value)); + } + } + callback->Run(response_status, value); +} + + +/* + * Handle a response that contains a uint32_t + */ +void RDMAPI::_HandleU32Response( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + uint32_t value = 0; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() == sizeof(value)) { + const uint32_t *ptr = reinterpret_cast(data.data()); + value = NetworkToHost(*ptr); + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(value)); + } + } + callback->Run(response_status, value); +} + + +/* + * Handle a response that doesn't contain any data + */ +void RDMAPI::_HandleEmptyResponse( + SingleUseCallback1 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE && + data.size()) + SetIncorrectPDL(&response_status, data.size(), 0); + callback->Run(response_status); +} + + +/* + * Handle a PROXIED_DEVICE_COUNT get response + */ +void RDMAPI::_HandleGetProxiedDeviceCount( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + static const unsigned int DATA_SIZE = 3; + ResponseStatus response_status(status, data); + + uint16_t device_count = 0; + bool list_change = false; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() >= DATA_SIZE) { + struct { + uint16_t device_count; + uint8_t list_change; + } unpacked_data; + memcpy(&unpacked_data, data.data(), DATA_SIZE); + device_count = NetworkToHost(unpacked_data.device_count); + list_change = unpacked_data.list_change; + } else { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } + } + callback->Run(response_status, device_count, list_change); +} + + +/* + * Handle a PROXIED_DEVICES get response + */ +void RDMAPI::_HandleGetProxiedDevices( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + vector uids; + + unsigned int data_size = data.size(); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data_size % UID::UID_SIZE == 0) { + const uint8_t *start = reinterpret_cast(data.data()); + for (const uint8_t *ptr = start; ptr < start + data_size; + ptr += UID::UID_SIZE) { + UID uid(ptr); + uids.push_back(uid); + } + } else { + response_status.MalformedResponse("PDL size not a multiple of " + + IntToString(static_cast(UID::UID_SIZE)) + " : " + + IntToString(static_cast(data_size))); + } + } + callback->Run(response_status, uids); +} + + +/* + * Handle a get COMMS_STATUS response + */ +void RDMAPI::_HandleGetCommStatus( + SingleUseCallback4 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + static const unsigned int DATA_SIZE = 6; + ResponseStatus response_status(status, data); + + uint16_t short_message = 0, length_mismatch = 0, checksum_fail = 0; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() >= DATA_SIZE) { + struct { + uint16_t short_message; + uint16_t length_mismatch; + uint16_t checksum_fail; + } unpacked_data; + memcpy(&unpacked_data, data.data(), DATA_SIZE); + short_message = NetworkToHost(unpacked_data.short_message); + length_mismatch = NetworkToHost(unpacked_data.length_mismatch); + checksum_fail = NetworkToHost(unpacked_data.checksum_fail); + } else { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } + } + callback->Run(response_status, short_message, length_mismatch, + checksum_fail); +} + + +/* + * Handle a STATUS_MESSAGES response + */ +void RDMAPI::_HandleGetStatusMessage( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + + // Seriously WTF, learn how to align data structures + struct status_message { + uint8_t sub_device_hi; + uint8_t sub_device_lo; + uint8_t status_type; + uint8_t message_id_hi; + uint8_t message_id_lo; + uint8_t value_1_hi; + uint8_t value_1_lo; + uint8_t value_2_hi; + uint8_t value_2_lo; + } message; + + ResponseStatus response_status(status, data); + vector messages; + unsigned int data_size = data.size(); + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data_size % sizeof(message) == 0) { + const uint8_t *start = reinterpret_cast(data.data()); + for (const uint8_t *ptr = start; ptr < start + data_size; + ptr += sizeof(message)) { + memcpy(&message, ptr, sizeof(message)); + StatusMessage msg_object; + msg_object.sub_device = (message.sub_device_hi << 8) + + message.sub_device_lo; + msg_object.status_message_id = (message.message_id_hi << 8) + + message.message_id_lo; + msg_object.value1 = (message.value_1_hi << 8) + message.value_1_lo; + msg_object.value2 = (message.value_2_hi << 8) + message.value_2_lo; + msg_object.status_type = message.status_type; + messages.push_back(msg_object); + } + } else { + response_status.MalformedResponse("PDL size not a multiple of " + + IntToString(static_cast(sizeof(message))) + " : " + + IntToString(static_cast(data_size))); + } + } + callback->Run(response_status, messages); +} + + +/* + * Handle a get SUB_DEVICE_STATUS_REPORT_THRESHOLD message + */ +void RDMAPI::_HandleGetSubDeviceReporting( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + uint8_t status_type = 0; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() == sizeof(status_type)) { + status_type = data.data()[0]; + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(status_type)); + } + } + callback->Run(response_status, status_type); +} + + +/* + * Handle a SUPPORTED_PARAMETERS Get command + */ +void RDMAPI::_HandleGetSupportedParameters( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + vector pids; + + unsigned int data_size = data.size(); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data_size % 2 == 0) { + const uint16_t *start = reinterpret_cast(data.data()); + const uint16_t *end = start + (data_size / sizeof(*start)); + for (const uint16_t *ptr = start; ptr < end; ptr++) { + pids.push_back(NetworkToHost(*ptr)); + } + } else { + response_status.MalformedResponse("PDL size not a multiple of 2 : " + + IntToString(static_cast(data_size))); + } + sort(pids.begin(), pids.end()); + } + callback->Run(response_status, pids); +} + + +/* + * Handle a PARAMETER_DESCRIPTION message + */ +void RDMAPI::_HandleGetParameterDescriptor( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + ParameterDescriptor description; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct param_description { + uint16_t pid; + uint8_t pdl_size; + uint8_t data_type; + uint8_t command_class; + uint8_t type; + uint8_t unit; + uint8_t prefix; + uint32_t min_value; + uint32_t max_value; + uint32_t default_value; + // +1 for a null since it's not clear in the spec if this is null + // terminated + char description[LABEL_SIZE + 1]; + } __attribute__((packed)); + struct param_description raw_description; + + unsigned int max = sizeof(raw_description) - 1; + unsigned int min = max - LABEL_SIZE; + unsigned int data_size = data.size(); + if (data_size >= min && data_size <= max) { + memcpy(&raw_description, data.data(), + std::min(static_cast(data.size()), max)); + description.description[LABEL_SIZE] = 0; + description.pid = NetworkToHost(raw_description.pid); + description.pdl_size = raw_description.pdl_size; + description.data_type = raw_description.data_type; + description.command_class = raw_description.command_class; + description.unit = raw_description.unit; + description.prefix = raw_description.prefix; + description.min_value = NetworkToHost(raw_description.min_value); + description.default_value = NetworkToHost(raw_description.default_value); + description.max_value = NetworkToHost(raw_description.max_value); + unsigned int label_size = data_size - ( + sizeof(raw_description) - LABEL_SIZE - 1); + description.description = std::string(raw_description.description, + label_size); + ShortenString(&description.description); + } else { + std::stringstream str; + str << data_size << " needs to be between " << min << " and " << max; + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, description); +} + + +/* + * Handle a DEVICE_INFO Get command + */ +void RDMAPI::_HandleGetDeviceDescriptor( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + DeviceDescriptor device_info; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + unsigned int data_size = data.size(); + if (data_size == sizeof(device_info)) { + memcpy(&device_info, data.data(), sizeof(device_info)); + device_info.device_model = NetworkToHost(device_info.device_model); + device_info.product_category = + NetworkToHost(device_info.product_category); + device_info.software_version = + NetworkToHost(device_info.software_version); + device_info.dmx_footprint = + NetworkToHost(device_info.dmx_footprint); + device_info.dmx_start_address = + NetworkToHost(device_info.dmx_start_address); + device_info.sub_device_count = + NetworkToHost(device_info.sub_device_count); + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(device_info)); + } + } + callback->Run(response_status, device_info); +} + + +/* + * Handle a PRODUCT_DETAIL_ID_LIST response + */ +void RDMAPI::_HandleGetProductDetailIdList( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + static const unsigned int MAX_DETAIL_IDS = 6; + ResponseStatus response_status(status, data); + vector product_detail_ids; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + unsigned int data_size = data.size(); + if (data_size > MAX_DETAIL_IDS * sizeof(uint16_t)) { + std::stringstream str; + str << "PDL needs to be <= " << (MAX_DETAIL_IDS * sizeof(uint16_t)) << + ", was " << data_size; + response_status.MalformedResponse(str.str()); + } else if (data_size % 2) { + std::stringstream str; + str << "PDL needs to be a multiple of 2, was " << data_size; + response_status.MalformedResponse(str.str()); + } else { + const uint16_t *start = reinterpret_cast(data.data()); + const uint16_t *end = start + (data_size / sizeof(*start)); + for (const uint16_t *ptr = start; ptr < end; ptr++) { + product_detail_ids.push_back(NetworkToHost(*ptr)); + } + } + } + callback->Run(response_status, product_detail_ids); +} + + +/* + * Handle a LANGUAGE_CAPABILITIES response + */ +void RDMAPI::_HandleGetLanguageCapabilities( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + vector languages; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + unsigned int data_size = data.size(); + if (data_size % 2) { + std::stringstream str; + str << "PDL needs to be a multiple of 2, was " << data_size; + response_status.MalformedResponse(str.str()); + } else { + const char *ptr = data.data(); + const char *end = data.data() + data.size(); + while (ptr < end) { + languages.push_back(string(ptr, 2)); + ptr+=2; + } + } + } + callback->Run(response_status, languages); +} + + +/* + * Handle a LANGUAGE response + */ +void RDMAPI::_HandleGetLanguage( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + static const unsigned int DATA_SIZE = 2; + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() != DATA_SIZE) { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } + } + callback->Run(response_status, data); +} + + +/* + * Handle a BOOT_SOFTWARE_VERSION_ID response + */ +void RDMAPI::_HandleGetBootSoftwareVersion( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + static const unsigned int DATA_SIZE = 4; + uint32_t boot_version = 0; + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() != DATA_SIZE) { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } else { + boot_version = *(reinterpret_cast(data.data())); + boot_version = NetworkToHost(boot_version); + } + } + callback->Run(response_status, boot_version); +} + + +/* + * Handle a get DMX_PERSONALITY response + */ +void RDMAPI::_HandleGetDMXPersonality( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + static const unsigned int DATA_SIZE = 2; + uint8_t current_personality = 0; + uint8_t personality_count = 0; + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() != DATA_SIZE) { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } else { + current_personality = data[0]; + personality_count = data[1]; + } + } + callback->Run(response_status, current_personality, personality_count); +} + + +/* + * Handle a get DMX_PERSONALITY_DESCRIPTION response + */ +void RDMAPI::_HandleGetDMXPersonalityDescription( + SingleUseCallback4 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + + uint8_t personality = 0; + uint16_t dmx_slots = 0; + string description; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct personality_description { + uint8_t personality; + uint16_t dmx_slots; + // +1 for a null since it's not clear in the spec if this is null + // terminated + char description[LABEL_SIZE + 1]; + } __attribute__((packed)); + struct personality_description raw_description; + + unsigned int max = sizeof(personality_description) - 1; + unsigned int min = max - LABEL_SIZE; + unsigned int data_size = data.size(); + if (data_size >= min && data_size <= max) { + memcpy(&raw_description, data.data(), + std::min(static_cast(data.size()), max)); + personality = raw_description.personality; + dmx_slots = NetworkToHost(raw_description.dmx_slots); + description = std::string(raw_description.description, data_size - min); + ShortenString(&description); + } else { + std::stringstream str; + str << data_size << " needs to be between " << min << " and " << max; + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, personality, dmx_slots, description); +} + + +/* + * Handle a get DMX_START_ADDRESS response + */ +void RDMAPI::_HandleGetDMXAddress( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + static const unsigned int DATA_SIZE = 2; + uint16_t start_address = 0; + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data.size() != DATA_SIZE) { + SetIncorrectPDL(&response_status, data.size(), DATA_SIZE); + } else { + start_address = *(reinterpret_cast(data.data())); + start_address = NetworkToHost(start_address); + } + } + callback->Run(response_status, start_address); +} + + +/* + * Handle a get SLOT_INFO response + */ +void RDMAPI::_HandleGetSlotInfo( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + vector slots; + SlotDescriptor slot_info; + unsigned int slot_info_size = sizeof(slot_info); + + unsigned int data_size = data.size(); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data_size % slot_info_size) { + response_status.MalformedResponse("PDL size not a multiple of " + + IntToString(slot_info_size) + ", was " + + IntToString(static_cast(data_size))); + } else { + const uint8_t *ptr = reinterpret_cast(data.data()); + const uint8_t *end = ptr + data.size(); + while (ptr < end) { + memcpy(&slot_info, ptr, slot_info_size); + slot_info.slot_offset = NetworkToHost(slot_info.slot_offset); + slot_info.slot_label = NetworkToHost(slot_info.slot_label); + slots.push_back(slot_info); + } + } + } + callback->Run(response_status, slots); +} + + +/* + * Handle a get SLOT_DESCRIPTION response + */ +void RDMAPI::_HandleGetSlotDescription( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + + uint16_t slot_index = 0; + string description; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct slot_description { + uint16_t slot_index; + // +1 for a null since it's not clear in the spec if this is null + // terminated + char description[LABEL_SIZE + 1]; + } __attribute__((packed)); + struct slot_description raw_description; + + unsigned int max = sizeof(raw_description) - 1; + unsigned int min = max - LABEL_SIZE; + unsigned int data_size = data.size(); + if (data_size >= min && data_size <= max) { + raw_description.description[LABEL_SIZE] = 0; + memcpy(&raw_description, data.data(), data.size()); + slot_index = NetworkToHost(raw_description.slot_index); + description = std::string(raw_description.description, + data.size() - min); + ShortenString(&description); + } else { + std::stringstream str; + str << data_size << " needs to be between " << min << " and " << max; + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, slot_index, description); +} + + +/* + * Handle a get DEFAULT_SLOT_VALUE response + */ +void RDMAPI::_HandleGetSlotDefaultValues( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + vector slots; + SlotDefault slot_default; + unsigned int slot_default_size = sizeof(slot_default); + + unsigned int data_size = data.size(); + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + if (data_size % slot_default_size) { + response_status.MalformedResponse("PDL size not a multiple of " + + IntToString(slot_default_size) + ", was " + + IntToString(static_cast(data_size))); + } else { + const uint8_t *ptr = reinterpret_cast(data.data()); + const uint8_t *end = ptr + data.size(); + while (ptr < end) { + memcpy(&slot_default, ptr, slot_default_size); + slot_default.slot_offset = NetworkToHost(slot_default.slot_offset); + slots.push_back(slot_default); + } + } + } + callback->Run(response_status, slots); +} + + +/* + * Handle a SENSOR_DEFINITION response + */ +void RDMAPI::_HandleGetSensorDefinition( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + SensorDescriptor sensor; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct sensor_definition_s { + uint8_t sensor_number; + uint8_t type; + uint8_t unit; + uint8_t prefix; + int16_t range_min; + int16_t range_max; + int16_t normal_min; + int16_t normal_max; + uint8_t recorded_value_support; + char description[LABEL_SIZE + 1]; + } __attribute__((packed)); + struct sensor_definition_s raw_description; + + unsigned int max = sizeof(raw_description) - 1; + unsigned int min = max - LABEL_SIZE; + unsigned int data_size = data.size(); + if (data_size >= min && data_size <= max) { + memcpy(&raw_description, data.data(), + std::min(static_cast(data.size()), max)); + + sensor.sensor_number = raw_description.sensor_number; + sensor.type = raw_description.type; + sensor.unit = raw_description.unit; + sensor.prefix = raw_description.prefix; + sensor.range_min = NetworkToHost(raw_description.range_min); + sensor.range_max = NetworkToHost(raw_description.range_max); + sensor.normal_min = NetworkToHost(raw_description.normal_min); + sensor.normal_max = NetworkToHost(raw_description.normal_max); + sensor.recorded_value_support = raw_description.recorded_value_support; + sensor.description = std::string(raw_description.description, + data_size - min); + ShortenString(&sensor.description); + } else { + std::stringstream str; + str << data_size << " needs to be between " << min << " and " << max; + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, sensor); +} + + +/* + * Handle a SENSOR_VALUE response + */ +void RDMAPI::_HandleSensorValue( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + SensorValueDescriptor sensor; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + unsigned int data_size = data.size(); + if (data_size == sizeof(sensor)) { + memcpy(&sensor, data.data(), sizeof(sensor)); + sensor.present_value = NetworkToHost(sensor.present_value); + sensor.lowest = NetworkToHost(sensor.lowest); + sensor.highest = NetworkToHost(sensor.highest); + sensor.recorded = NetworkToHost(sensor.recorded); + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(sensor)); + } + } + callback->Run(response_status, sensor); +} + + +/* + * Handle a REAL_TIME_CLOCK response + */ +void RDMAPI::_HandleClock( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + ClockValue clock; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + unsigned int data_size = data.size(); + if (data_size == sizeof(clock)) { + memcpy(&clock, data.data(), sizeof(clock)); + clock.year = NetworkToHost(clock.year); + } else { + SetIncorrectPDL(&response_status, data.size(), sizeof(clock)); + } + } + callback->Run(response_status, clock); +} + + +/** + * Handle a PID_SELF_TEST_DESCRIPTION response. + */ +void RDMAPI::_HandleSelfTestDescription( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + + uint8_t self_test_number = 0; + string description; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct self_test_description { + uint8_t self_test_number; + // +1 for a null since it's not clear in the spec if this is null + // terminated + char description[LABEL_SIZE + 1]; + } __attribute__((packed)); + struct self_test_description raw_description; + + unsigned int max = sizeof(raw_description) - 1; + unsigned int min = max - LABEL_SIZE; + unsigned int data_size = data.size(); + if (data_size >= min && data_size <= max) { + raw_description.description[LABEL_SIZE] = 0; + memcpy(&raw_description, data.data(), data.size()); + self_test_number = raw_description.self_test_number; + description = std::string(raw_description.description, + data.size() - min); + ShortenString(&description); + } else { + std::stringstream str; + str << data_size << " needs to be between " << min << " and " << max; + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, self_test_number, description); +} + + +/** + * Handle a PID_PRESET_PLAYBACK response + */ +void RDMAPI::_HandlePlaybackMode( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data) { + ResponseStatus response_status(status, data); + + uint16_t mode = 0; + uint8_t level = 0; + + if (response_status.ResponseType() == ResponseStatus::VALID_RESPONSE) { + struct preset_mode { + uint16_t mode; + uint8_t level; + } __attribute__((packed)); + struct preset_mode raw_config; + + if (data.size() >= sizeof(raw_config)) { + memcpy(&raw_config, data.data(), data.size()); + mode = NetworkToHost(raw_config.mode); + level = raw_config.level; + } else { + std::stringstream str; + str << data.size() << " needs to be more than " << sizeof(raw_config); + response_status.MalformedResponse(str.str()); + } + } + callback->Run(response_status, mode, level); +} + + +//----------------------------------------------------------------------------- +// Private methods follow + +// get a 8 bit value +bool RDMAPI::GenericGetU8( + unsigned int universe, + const UID &uid, + uint8_t sub_device, + SingleUseCallback2 *callback, + uint16_t pid, + string *error) { + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleU8Response, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + pid), + error); +} + + +// set an 8 bit value +bool RDMAPI::GenericSetU8( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t value, + SingleUseCallback1 *callback, + uint16_t pid, + string *error) { + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + pid, + &value, + sizeof(value)), + error); +} + + +// get a 32 bit value +bool RDMAPI::GenericGetU32( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + uint16_t pid, + string *error) { + if (CheckNotBroadcast(uid, error, callback)) + return false; + if (CheckValidSubDevice(sub_device, false, error, callback)) + return false; + + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleU32Response, + callback); + return CheckReturnStatus( + m_impl->RDMGet(cb, + universe, + uid, + sub_device, + pid), + error); +} + + +// set a 32 bit value +bool RDMAPI::GenericSetU32( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t value, + SingleUseCallback1 *callback, + uint16_t pid, + string *error) { + if (CheckValidSubDevice(sub_device, true, error, callback)) + return false; + + value = HostToNetwork(value); + RDMAPIImplInterface::rdm_callback *cb = NewSingleCallback( + this, + &RDMAPI::_HandleEmptyResponse, + callback); + return CheckReturnStatus( + m_impl->RDMSet(cb, + universe, + uid, + sub_device, + pid, + reinterpret_cast(&value), + sizeof(value)), + error); +} + + +// Checks the status of a rdm command and sets error appropriately +bool RDMAPI::CheckReturnStatus(bool status, string *error) { + if (!status && error) + *error = "Unable to send RDM command"; + return status; +} + +// Mark a ResponseStatus as malformed due to a length mismatch +void RDMAPI::SetIncorrectPDL(ResponseStatus *status, + unsigned int actual, + unsigned int expected) { + status->MalformedResponse("PDL mismatch, " + + IntToString(actual) + " != " + + IntToString(expected) + " (expected)"); +} +} // rdm +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPITest.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPITest.cpp new file mode 100644 index 0000000..adadb2b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMAPITest.cpp @@ -0,0 +1,1070 @@ +/* + * 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 Library 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. + * + * RDMAPITest.cpp + * Test fixture for the RDM API class + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/RDMAPIImplInterface.h" + + +using ola::NewSingleCallback; +using ola::network::HostToNetwork; +using ola::rdm::RDMAPI; +using ola::rdm::RDMAPIImplResponseStatus; +using ola::rdm::ResponseStatus; +using ola::rdm::UID; +using std::deque; +using std::string; +using std::vector; + + +class ExpectedResult { + public: + unsigned int universe; + const UID uid; + uint16_t sub_device; + uint16_t pid; + const string return_data; + const uint8_t *data; + unsigned int data_length; + + ExpectedResult(unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const string &return_data, + const uint8_t *data_arg = NULL, + unsigned int data_length = 0): + universe(universe), + uid(uid), + sub_device(sub_device), + pid(pid), + return_data(return_data), + data(NULL), + data_length(data_length) { + if (data_arg) { + uint8_t *d = new uint8_t[data_length]; + memcpy(d, data_arg, data_length); + data = d; + } + } + + ~ExpectedResult() { + if (data) + delete[] data; + } +}; + +class MockRDMAPIImpl: public ola::rdm::RDMAPIImplInterface { + public: + bool RDMGet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) { + CPPUNIT_ASSERT(m_get_expected.size()); + const ExpectedResult *result = m_get_expected.front(); + CPPUNIT_ASSERT_EQUAL(result->universe, universe); + CPPUNIT_ASSERT_EQUAL(result->uid, uid); + CPPUNIT_ASSERT_EQUAL(result->sub_device, sub_device); + CPPUNIT_ASSERT_EQUAL(result->pid, pid); + + (void) data; + (void) data_length; + + RDMAPIImplResponseStatus status; + status.was_broadcast = uid.IsBroadcast(); + status.response_type = ola::rdm::ACK; + status.message_count = 0; + callback->Run(status, result->return_data); + + delete result; + m_get_expected.pop_front(); + return true; + } + + bool RDMSet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) { + CPPUNIT_ASSERT(m_set_expected.size()); + const ExpectedResult *result = m_set_expected.front(); + CPPUNIT_ASSERT_EQUAL(result->universe, universe); + CPPUNIT_ASSERT_EQUAL(result->uid, uid); + CPPUNIT_ASSERT_EQUAL(result->sub_device, sub_device); + CPPUNIT_ASSERT_EQUAL(result->pid, pid); + + if (result->data) { + CPPUNIT_ASSERT_EQUAL(result->data_length, data_length); + CPPUNIT_ASSERT(0 == memcmp(result->data, data, data_length)); + } + + RDMAPIImplResponseStatus status; + status.was_broadcast = uid.IsBroadcast(); + status.response_type = ola::rdm::ACK; + status.message_count = 0; + callback->Run(status, result->return_data); + + delete result; + m_set_expected.pop_front(); + return true; + } + + void AddExpectedGet( + // const RDMAPIImplResponseStatus &status, + const string &return_data, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) { + ExpectedResult *expected_result = new ExpectedResult(universe, + uid, + sub_device, + pid, + return_data, + data, + data_length); + m_get_expected.push_back(expected_result); + } + + void AddExpectedSet(unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) { + string s; + ExpectedResult *expected_result = new ExpectedResult(universe, + uid, + sub_device, + pid, + s, + data, + data_length); + m_set_expected.push_back(expected_result); + } + + void Verify() { + CPPUNIT_ASSERT(!m_get_expected.size()); + CPPUNIT_ASSERT(!m_set_expected.size()); + } + + private: + deque m_get_expected; + deque m_set_expected; +}; + + +class RDMAPITest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RDMAPITest); + CPPUNIT_TEST(testProxyCommands); + CPPUNIT_TEST(testNetworkCommands); + CPPUNIT_TEST(testRDMInformation); + CPPUNIT_TEST(testProductInformation); + CPPUNIT_TEST(testDmxSetup); + CPPUNIT_TEST_SUITE_END(); + + public: + RDMAPITest(): + m_api(&m_impl), + m_uid(1, 2), + m_bcast_uid(UID::AllDevices()), + m_group_uid(UID::AllManufactureDevices(52)), + m_test_uid1(4, 5), + m_test_uid2(7, 9) { + } + void testProxyCommands(); + void testNetworkCommands(); + void testRDMInformation(); + void testProductInformation(); + void testDmxSetup(); + void setUp() {} + void tearDown(); + + private: + static const unsigned int UNIVERSE = 1; + static const char BROADCAST_ERROR[]; + static const char DEVICE_RANGE_ERROR[]; + static const char DEVICE_RANGE_BCAST_ERROR[]; + static const char TEST_DESCRIPTION[]; + MockRDMAPIImpl m_impl; + RDMAPI m_api; + UID m_uid; + UID m_bcast_uid; + UID m_group_uid; + UID m_test_uid1; + UID m_test_uid2; + + // check that a RDM call failed because we tried to send to the bcast UID + void CheckForBroadcastError(string *error) { + CPPUNIT_ASSERT_EQUAL(string(BROADCAST_ERROR), *error); + error->clear(); + } + + // check that a RDM call failed because we tried to send to all devices + void CheckForDeviceRangeError(string *error) { + CPPUNIT_ASSERT_EQUAL(string(DEVICE_RANGE_ERROR), *error); + error->clear(); + } + + void CheckForDeviceRangeBcastError(string *error) { + CPPUNIT_ASSERT_EQUAL(string(DEVICE_RANGE_BCAST_ERROR), *error); + error->clear(); + } + + // check that a RDM command was successful + void CheckResponseStatus(const ResponseStatus &status) { + CPPUNIT_ASSERT_EQUAL(ola::rdm::ResponseStatus::VALID_RESPONSE, + status.ResponseType()); + } + + // check that a RDM command was successful and broadcast + void CheckWasBroadcast(const ResponseStatus &status) { + CPPUNIT_ASSERT_EQUAL(ola::rdm::ResponseStatus::BROADCAST_REQUEST, + status.ResponseType()); + } + + void CheckProxiedDeviceCount(const ResponseStatus &status, + uint16_t count, + bool changed) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(2), count); + CPPUNIT_ASSERT_EQUAL(false, changed); + } + + void CheckProxiedDevices(const ResponseStatus &status, + const vector &devices) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(2), devices.size()); + CPPUNIT_ASSERT_EQUAL(m_test_uid1, devices[0]); + CPPUNIT_ASSERT_EQUAL(m_test_uid2, devices[1]); + } + + void CheckCommsStatus(const ResponseStatus &status, + uint16_t short_message, + uint16_t length_mismatch, + uint16_t checksum_fail) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(14), short_message); + CPPUNIT_ASSERT_EQUAL(static_cast(187), length_mismatch); + CPPUNIT_ASSERT_EQUAL(static_cast(92), checksum_fail); + } + + void CheckLabel(const ResponseStatus &status, + const string &description) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(string(TEST_DESCRIPTION), description); + } + + void CheckSupportedParams(const ResponseStatus &status, + const vector ¶ms) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(3), params.size()); + // params are sorted + CPPUNIT_ASSERT_EQUAL(static_cast(0x00aa), params[0]); + CPPUNIT_ASSERT_EQUAL(static_cast(0x1234), params[1]); + CPPUNIT_ASSERT_EQUAL(static_cast(0xabcd), params[2]); + } + + void CheckParameterDescription( + const ResponseStatus &status, + const ola::rdm::ParameterDescriptor &description) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(0x1234), description.pid); + CPPUNIT_ASSERT_EQUAL(static_cast(10), description.pdl_size); + CPPUNIT_ASSERT_EQUAL(static_cast(ola::rdm::DS_UNSIGNED_DWORD), + description.data_type); + CPPUNIT_ASSERT_EQUAL(static_cast(ola::rdm::CC_GET), + description.command_class); + CPPUNIT_ASSERT_EQUAL(static_cast(ola::rdm::UNITS_METERS), + description.unit); + CPPUNIT_ASSERT_EQUAL(static_cast(ola::rdm::PREFIX_KILO), + description.prefix); + CPPUNIT_ASSERT_EQUAL(static_cast(0), description.min_value); + CPPUNIT_ASSERT_EQUAL(static_cast(200000), + description.max_value); + CPPUNIT_ASSERT_EQUAL(static_cast(1000), + description.default_value); + CPPUNIT_ASSERT_EQUAL(string(TEST_DESCRIPTION).size(), + description.description.size()); + CPPUNIT_ASSERT_EQUAL(string(TEST_DESCRIPTION), description.description); + } + + void CheckMalformedParameterDescription( + const ResponseStatus &status, + const ola::rdm::ParameterDescriptor &description) { + CPPUNIT_ASSERT_EQUAL(ola::rdm::ResponseStatus::MALFORMED_RESPONSE, + status.ResponseType()); + (void) description; + } + + void CheckDeviceInfo(const ResponseStatus &status, + const ola::rdm::DeviceDescriptor &descriptor) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(1), + descriptor.protocol_version_high); + CPPUNIT_ASSERT_EQUAL(static_cast(0), + descriptor.protocol_version_low); + CPPUNIT_ASSERT_EQUAL(static_cast(2), + descriptor.device_model); + CPPUNIT_ASSERT_EQUAL(static_cast(3), + descriptor.product_category); + CPPUNIT_ASSERT_EQUAL(static_cast(0x12345678), + descriptor.software_version); + CPPUNIT_ASSERT_EQUAL(static_cast(400), + descriptor.dmx_footprint); + CPPUNIT_ASSERT_EQUAL(static_cast(1), + descriptor.current_personality); + CPPUNIT_ASSERT_EQUAL(static_cast(2), + descriptor.personaility_count); + CPPUNIT_ASSERT_EQUAL(static_cast(12), + descriptor.dmx_start_address); + CPPUNIT_ASSERT_EQUAL(static_cast(10), + descriptor.sub_device_count); + CPPUNIT_ASSERT_EQUAL(static_cast(4), + descriptor.sensor_count); + } + + void CheckProductDetailList(const ResponseStatus &status, + const vector ¶ms) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(3), params.size()); + CPPUNIT_ASSERT_EQUAL(static_cast(0x5678), params[0]); + CPPUNIT_ASSERT_EQUAL(static_cast(0xfedc), params[1]); + CPPUNIT_ASSERT_EQUAL(static_cast(0xaa00), params[2]); + } + + void CheckDMXStartAddress(const ResponseStatus &status, + uint16_t start_address) { + CheckResponseStatus(status); + CPPUNIT_ASSERT_EQUAL(static_cast(44), start_address); + } +}; + +const char RDMAPITest::BROADCAST_ERROR[] = "Cannot send to broadcast address"; +const char RDMAPITest::DEVICE_RANGE_ERROR[] = "Sub device must be <= 0x0200"; +const char RDMAPITest::DEVICE_RANGE_BCAST_ERROR[] = + "Sub device must be <= 0x0200 or 0xffff"; +const char RDMAPITest::TEST_DESCRIPTION[] = "This is a description"; + +void RDMAPITest::tearDown() { + m_impl.Verify(); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(RDMAPITest); + + +/* + * Test the proxied commands work. + */ +void RDMAPITest::testProxyCommands() { + string error; + // get proxied device count + CPPUNIT_ASSERT(!m_api.GetProxiedDeviceCount( + UNIVERSE, + m_bcast_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDeviceCount), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetProxiedDeviceCount( + UNIVERSE, + m_group_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDeviceCount), + &error)); + CheckForBroadcastError(&error); + + struct { + uint16_t count; + uint8_t changed; + } count_response; + count_response.count = HostToNetwork(static_cast(2)); + count_response.changed = 0; + string s(reinterpret_cast(&count_response), sizeof(count_response)); + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_PROXIED_DEVICE_COUNT); + CPPUNIT_ASSERT(m_api.GetProxiedDeviceCount( + UNIVERSE, + m_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDeviceCount), + &error)); + + // get proxied devices + CPPUNIT_ASSERT(!m_api.GetProxiedDevices( + UNIVERSE, + m_bcast_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDevices), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetProxiedDevices( + UNIVERSE, + m_bcast_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDevices), + &error)); + CheckForBroadcastError(&error); + + struct { + uint8_t uid1[UID::UID_SIZE]; + uint8_t uid2[UID::UID_SIZE]; + } uids_response; + m_test_uid1.Pack(uids_response.uid1, UID::UID_SIZE); + m_test_uid2.Pack(uids_response.uid2, UID::UID_SIZE); + string s2(reinterpret_cast(&uids_response), sizeof(uids_response)); + m_impl.AddExpectedGet(s2, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_PROXIED_DEVICES); + CPPUNIT_ASSERT(m_api.GetProxiedDevices( + UNIVERSE, + m_uid, + NewSingleCallback(this, &RDMAPITest::CheckProxiedDevices), + &error)); +} + + +/* + * test that network commands work + */ +void RDMAPITest::testNetworkCommands() { + string error; + // get comms status + CPPUNIT_ASSERT(!m_api.GetCommStatus( + UNIVERSE, + m_group_uid, + NewSingleCallback(this, &RDMAPITest::CheckCommsStatus), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetCommStatus( + UNIVERSE, + m_group_uid, + NewSingleCallback(this, &RDMAPITest::CheckCommsStatus), + &error)); + CheckForBroadcastError(&error); + + struct { + uint16_t short_message; + uint16_t length_mismatch; + uint16_t checksum_fail; + } comms_response; + comms_response.short_message = HostToNetwork(static_cast(14)); + comms_response.length_mismatch = HostToNetwork(static_cast(187)); + comms_response.checksum_fail = HostToNetwork(static_cast(92)); + string s(reinterpret_cast(&comms_response), sizeof(comms_response)); + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_COMMS_STATUS); + CPPUNIT_ASSERT(m_api.GetCommStatus( + UNIVERSE, + m_uid, + NewSingleCallback(this, &RDMAPITest::CheckCommsStatus), + &error)); + + // clear comms status + m_impl.AddExpectedSet(UNIVERSE, + m_bcast_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_COMMS_STATUS); + CPPUNIT_ASSERT(m_api.ClearCommStatus( + UNIVERSE, + m_bcast_uid, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + + m_impl.AddExpectedSet(UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_COMMS_STATUS); + CPPUNIT_ASSERT(m_api.ClearCommStatus( + UNIVERSE, + m_uid, + NewSingleCallback(this, &RDMAPITest::CheckResponseStatus), + &error)); + + // TODO(simon): test status message here + + // status id description + uint16_t status_id = 12; + CPPUNIT_ASSERT(!m_api.GetStatusIdDescription( + UNIVERSE, + m_bcast_uid, + status_id, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetStatusIdDescription( + UNIVERSE, + m_bcast_uid, + status_id, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_STATUS_ID_DESCRIPTION); + CPPUNIT_ASSERT(m_api.GetStatusIdDescription( + UNIVERSE, + m_uid, + status_id, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + + // clear status id + uint16_t sub_device = 3; + m_impl.AddExpectedSet(UNIVERSE, + m_bcast_uid, + sub_device, + ola::rdm::PID_CLEAR_STATUS_ID); + CPPUNIT_ASSERT(m_api.ClearStatusId( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + m_impl.AddExpectedSet(UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_CLEAR_STATUS_ID); + CPPUNIT_ASSERT(m_api.ClearStatusId( + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, &RDMAPITest::CheckResponseStatus), + &error)); + + // TODO(simon): add sub device reporting threshold here +} + + +/* + * Test RDM Information commands work correctly + */ +void RDMAPITest::testRDMInformation() { + string error; + // supported params + struct { + uint16_t param1; + uint16_t param2; + uint16_t param3; + } pid_list; + pid_list.param1 = HostToNetwork(static_cast(0x1234)); + pid_list.param2 = HostToNetwork(static_cast(0xabcd)); + pid_list.param3 = HostToNetwork(static_cast(0x00aa)); + uint16_t sub_device = 1; + CPPUNIT_ASSERT(!m_api.GetSupportedParameters( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckSupportedParams), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetSupportedParameters( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckSupportedParams), + &error)); + CheckForBroadcastError(&error); + string s(reinterpret_cast(&pid_list), sizeof(pid_list)); + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_SUPPORTED_PARAMETERS); + CPPUNIT_ASSERT(m_api.GetSupportedParameters( + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, &RDMAPITest::CheckSupportedParams), + &error)); + + // parameter description + uint16_t pid = 16; + CPPUNIT_ASSERT(!m_api.GetParameterDescription( + UNIVERSE, + m_bcast_uid, + pid, + NewSingleCallback(this, &RDMAPITest::CheckMalformedParameterDescription), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetParameterDescription( + UNIVERSE, + m_bcast_uid, + pid, + NewSingleCallback(this, &RDMAPITest::CheckMalformedParameterDescription), + &error)); + CheckForBroadcastError(&error); + + s = ""; + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_PARAMETER_DESCRIPTION); + CPPUNIT_ASSERT(m_api.GetParameterDescription( + UNIVERSE, + m_uid, + pid, + NewSingleCallback(this, &RDMAPITest::CheckMalformedParameterDescription), + &error)); + + struct param_info_s { + uint16_t pid; + uint8_t pdl_size; + uint8_t data_type; + uint8_t command_class; + uint8_t type; + uint8_t unit; + uint8_t prefix; + uint32_t min_value; + uint32_t max_value; + uint32_t default_value; + char label[32]; + } __attribute__((packed)); + struct param_info_s param_info; + param_info.pid = HostToNetwork(static_cast(0x1234)); + param_info.pdl_size = 10; + param_info.data_type = ola::rdm::DS_UNSIGNED_DWORD; + param_info.command_class = ola::rdm::CC_GET; + param_info.type = 0; + param_info.unit = ola::rdm::UNITS_METERS; + param_info.prefix = ola::rdm::PREFIX_KILO; + param_info.min_value = HostToNetwork(static_cast(0)); + param_info.max_value = HostToNetwork(static_cast(200000)); + param_info.default_value = HostToNetwork(static_cast(1000)); + strncpy(param_info.label, TEST_DESCRIPTION, sizeof(param_info.label)); + + string s2(reinterpret_cast(¶m_info), + sizeof(param_info) - sizeof(param_info.label) + + strlen(TEST_DESCRIPTION)); + m_impl.AddExpectedGet(s2, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_PARAMETER_DESCRIPTION); + CPPUNIT_ASSERT(m_api.GetParameterDescription( + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, &RDMAPITest::CheckParameterDescription), + &error)); +} + + +/* + * Check that the product information commands work correctly + */ +void RDMAPITest::testProductInformation() { + string error; + uint16_t sub_device = 1; + + // device info + struct device_info_s { + uint8_t version_high; + uint8_t version_low; + uint16_t model; + uint16_t product_category; + uint32_t software_version; + uint16_t dmx_footprint; + uint8_t current_personality; + uint8_t personaility_count; + uint16_t dmx_start_address; + uint16_t sub_device_count; + uint8_t sensor_count; + } __attribute__((packed)); + struct device_info_s device_info; + device_info.version_high = 1; + device_info.version_low = 0; + device_info.model = HostToNetwork(static_cast(2)); + device_info.product_category = HostToNetwork(static_cast(3)); + device_info.software_version = HostToNetwork( + static_cast(0x12345678)); + device_info.dmx_footprint = HostToNetwork(static_cast(400)); + device_info.current_personality = 1; + device_info.personaility_count = 2; + device_info.dmx_start_address = HostToNetwork(static_cast(12)); + device_info.sub_device_count = HostToNetwork(static_cast(10)); + device_info.sensor_count = 4; + + CPPUNIT_ASSERT(!m_api.GetDeviceInfo( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckDeviceInfo), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetDeviceInfo( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckDeviceInfo), + &error)); + CheckForBroadcastError(&error); + string s(reinterpret_cast(&device_info), sizeof(device_info)); + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_DEVICE_INFO); + CPPUNIT_ASSERT(m_api.GetDeviceInfo( + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, &RDMAPITest::CheckDeviceInfo), + &error)); + + // product detail id list + struct { + uint16_t detail1; + uint16_t detail2; + uint16_t detail3; + } detail_list; + detail_list.detail1 = HostToNetwork(static_cast(0x5678)); + detail_list.detail2 = HostToNetwork(static_cast(0xfedc)); + detail_list.detail3 = HostToNetwork(static_cast(0xaa00)); + CPPUNIT_ASSERT(!m_api.GetProductDetailIdList( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckProductDetailList), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetProductDetailIdList( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckProductDetailList), + &error)); + CheckForBroadcastError(&error); + string s2(reinterpret_cast(&detail_list), sizeof(detail_list)); + m_impl.AddExpectedGet(s2, + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + ola::rdm::PID_PRODUCT_DETAIL_ID_LIST); + CPPUNIT_ASSERT(m_api.GetProductDetailIdList( + UNIVERSE, + m_uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, &RDMAPITest::CheckProductDetailList), + &error)); + + // device model description + CPPUNIT_ASSERT(!m_api.GetDeviceModelDescription( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetDeviceModelDescription( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_DEVICE_MODEL_DESCRIPTION); + CPPUNIT_ASSERT(m_api.GetDeviceModelDescription( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + + // manufacturer label + CPPUNIT_ASSERT(!m_api.GetManufacturerLabel( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetManufacturerLabel( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_MANUFACTURER_LABEL); + CPPUNIT_ASSERT(m_api.GetManufacturerLabel( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + + // get device label + CPPUNIT_ASSERT(!m_api.GetDeviceLabel( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetDeviceLabel( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_DEVICE_LABEL); + CPPUNIT_ASSERT(m_api.GetDeviceLabel( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + + // set device label + s = TEST_DESCRIPTION; + m_impl.AddExpectedSet(UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_DEVICE_LABEL, + reinterpret_cast(s.data()), + s.size()); + CPPUNIT_ASSERT(m_api.SetDeviceLabel( + UNIVERSE, + m_uid, + sub_device, + s, + NewSingleCallback(this, &RDMAPITest::CheckResponseStatus), + &error)); + // check we can bcast + m_impl.AddExpectedSet(UNIVERSE, + m_bcast_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + ola::rdm::PID_DEVICE_LABEL, + reinterpret_cast(s.data()), + s.size()); + CPPUNIT_ASSERT(m_api.SetDeviceLabel( + UNIVERSE, + m_bcast_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + s, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + m_impl.AddExpectedSet(UNIVERSE, + m_group_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + ola::rdm::PID_DEVICE_LABEL, + reinterpret_cast(s.data()), + s.size()); + CPPUNIT_ASSERT(m_api.SetDeviceLabel( + UNIVERSE, + m_group_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + s, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + // check out of range sub devices fail + CPPUNIT_ASSERT(!m_api.SetDeviceLabel( + UNIVERSE, + m_group_uid, + 0x0201, + s, + NewSingleCallback(this, &RDMAPITest::CheckResponseStatus), + &error)); + CheckForDeviceRangeBcastError(&error); + + // software version label + CPPUNIT_ASSERT(!m_api.GetSoftwareVersionLabel( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetSoftwareVersionLabel( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_SOFTWARE_VERSION_LABEL); + CPPUNIT_ASSERT(m_api.GetSoftwareVersionLabel( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + + // Boot software label + CPPUNIT_ASSERT(!m_api.GetBootSoftwareVersionLabel( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetBootSoftwareVersionLabel( + UNIVERSE, + m_group_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); + CheckForBroadcastError(&error); + + m_impl.AddExpectedGet(string(TEST_DESCRIPTION), + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_BOOT_SOFTWARE_VERSION_LABEL); + CPPUNIT_ASSERT(m_api.GetBootSoftwareVersionLabel( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckLabel), + &error)); +} + +/* + * Check that DMX commands work + */ +void RDMAPITest::testDmxSetup() { + string error; + uint16_t sub_device = 1; + + // Check get start address + CPPUNIT_ASSERT(!m_api.GetDMXAddress( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckDMXStartAddress), + &error)); + CheckForBroadcastError(&error); + CPPUNIT_ASSERT(!m_api.GetDMXAddress( + UNIVERSE, + m_bcast_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckDMXStartAddress), + &error)); + CheckForBroadcastError(&error); + + uint16_t start_address = HostToNetwork(static_cast(44)); + string s(reinterpret_cast(&start_address), sizeof(start_address)); + m_impl.AddExpectedGet(s, + UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_DMX_START_ADDRESS); + CPPUNIT_ASSERT(m_api.GetDMXAddress( + UNIVERSE, + m_uid, + sub_device, + NewSingleCallback(this, &RDMAPITest::CheckDMXStartAddress), + &error)); + + // Check set start address + start_address = 64; + uint16_t address_data = HostToNetwork(start_address); + m_impl.AddExpectedSet(UNIVERSE, + m_uid, + sub_device, + ola::rdm::PID_DMX_START_ADDRESS, + reinterpret_cast(&address_data), + sizeof(address_data)); + CPPUNIT_ASSERT(m_api.SetDMXAddress( + UNIVERSE, + m_uid, + sub_device, + start_address, + NewSingleCallback(this, &RDMAPITest::CheckResponseStatus), + &error)); + // check bcasts work + m_impl.AddExpectedSet(UNIVERSE, + m_bcast_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + ola::rdm::PID_DMX_START_ADDRESS, + reinterpret_cast(&address_data), + sizeof(address_data)); + CPPUNIT_ASSERT(m_api.SetDMXAddress( + UNIVERSE, + m_bcast_uid, + ola::rdm::ALL_RDM_SUBDEVICES, + start_address, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + m_impl.AddExpectedSet(UNIVERSE, + m_group_uid, + 0x0200, + ola::rdm::PID_DMX_START_ADDRESS, + reinterpret_cast(&address_data), + sizeof(address_data)); + CPPUNIT_ASSERT(m_api.SetDMXAddress( + UNIVERSE, + m_group_uid, + 0x0200, + start_address, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + CPPUNIT_ASSERT(!m_api.SetDMXAddress( + UNIVERSE, + m_group_uid, + 0x0201, + start_address, + NewSingleCallback(this, &RDMAPITest::CheckWasBroadcast), + &error)); + CheckForDeviceRangeBcastError(&error); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommand.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommand.cpp new file mode 100644 index 0000000..0c92494 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommand.cpp @@ -0,0 +1,456 @@ +/* + * 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 Library 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. + * + * RDMCommand.cpp + * The RDMCommand class + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/RDMCommand.h" + +namespace ola { +namespace rdm { + +/* + * Constructor + */ +RDMCommand::RDMCommand(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t port_id, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length): + m_port_id(port_id), + m_source(source), + m_destination(destination), + m_transaction_number(transaction_number), + m_message_count(message_count), + m_sub_device(sub_device), + m_param_id(param_id), + m_data(NULL), + m_data_length(length) { + if (length > MAX_PARAM_DATA_LENGTH) { + OLA_WARN << "Attempt to create RDM message with a length > " << + MAX_PARAM_DATA_LENGTH << ", was; " << length; + m_data_length = MAX_PARAM_DATA_LENGTH; + } + + if (m_data_length > 0 && data != NULL) { + m_data = new uint8_t[m_data_length]; + memcpy(m_data, data, m_data_length); + } +} + + +/* + * Destructor + */ +RDMCommand::~RDMCommand() { + if (m_data) + delete[] m_data; +} + + +/* + * Equality test + */ +bool RDMCommand::operator==(const RDMCommand &other) const { + if (m_source == other.m_source && + m_destination == other.m_destination && + m_transaction_number == other.m_transaction_number && + m_message_count == other.m_message_count && + m_sub_device == other.m_sub_device && + CommandClass() == other.CommandClass() && + m_param_id == other.m_param_id && + m_data_length == other.m_data_length) { + return 0 == memcmp(m_data, other.m_data, m_data_length); + } + return false; +} + + +std::string RDMCommand::ToString() const { + std::stringstream str; + str << m_source << " -> " << m_destination << ", Trans # " << + static_cast(m_transaction_number) << ", Port ID " << + static_cast(m_port_id) << ", Msg Cnt " << + static_cast(m_message_count) << ", SubDevice " << m_sub_device + << ", Cmd Class " << CommandClass() << ", Param ID " << m_param_id + << ", Data Len " << m_data_length; + str << ", Data "; + for (unsigned int i = 0 ; i < m_data_length; i++) + str << std::hex << std::setw(2) << static_cast(m_data[i]) << " "; + return str.str(); +} + + +/* + * Get the size of the raw data required to pack this RDM command + */ +unsigned int RDMCommand::Size() const { + return sizeof(rdm_command_message) + m_data_length + CHECKSUM_LENGTH; +} + + +/* + * Pack this command into an RDM message structure. + * The packed data structure does not include the RDM start code (0xCC) because + * sometimes devices / protocols keep this separate. + */ +bool RDMCommand::Pack(uint8_t *buffer, unsigned int *size) const { + if (*size < Size()) + return false; + + unsigned int packet_length = (sizeof(rdm_command_message) + + m_data_length); // size of packet excluding start code + checksum + rdm_command_message message; + message.sub_start_code = SUB_START_CODE; + message.message_length = packet_length + 1; // add in start code as well + m_destination.Pack(message.destination_uid, UID::UID_SIZE); + m_source.Pack(message.source_uid, UID::UID_SIZE); + message.transaction_number = m_transaction_number; + message.port_id = m_port_id; + message.message_count = m_message_count; + message.sub_device[0] = m_sub_device >> 8; + message.sub_device[1] = m_sub_device & 0xff; + message.command_class = CommandClass(); + message.param_id[0] = m_param_id >> 8; + message.param_id[1] = m_param_id & 0xff; + message.param_data_length = m_data_length; + memcpy(buffer, &message, sizeof(message)); + memcpy(buffer + sizeof(rdm_command_message), m_data, m_data_length); + + uint16_t checksum = CalculateChecksum(buffer, packet_length); + buffer[packet_length] = checksum >> 8; + buffer[packet_length+1] = checksum & 0xff; + + *size = packet_length + CHECKSUM_LENGTH; + return true; +} + + +/* + * Convert a block of RDM data to an RDMCommand object. + * The data must not include the RDM start code. + * @param data the raw RDM data, starting from the sub-start-code + * @param length the length of the data + */ +const RDMCommand::rdm_command_message* RDMCommand::VerifyData( + const uint8_t *data, + unsigned int length) { + if (!data) { + OLA_WARN << "RDM data was null"; + return NULL; + } + + if (length < sizeof(rdm_command_message)) { + OLA_WARN << "RDM message is too small, needs to be at least " << + sizeof(rdm_command_message) << ", was " << length; + return NULL; + } + + const rdm_command_message *command_message = ( + reinterpret_cast(data)); + + unsigned int message_length = command_message->message_length; + + if (length < message_length + 1) { + OLA_WARN << "RDM message is too small, needs to be " << + message_length + 1 << ", was " << length; + return NULL; + } + + uint16_t checksum = CalculateChecksum(data, message_length - 1); + uint16_t actual_checksum = (data[message_length - 1] << 8) + + data[message_length]; + + if (actual_checksum != checksum) { + OLA_WARN << "RDM checmsum mismatch, was " << actual_checksum << + " but was supposed to be " << checksum; + return NULL; + } + + // check param length is valid here + unsigned int block_size = length - sizeof(rdm_command_message) - 2; + if (command_message->param_data_length > block_size) { + OLA_WARN << "Param length " << + static_cast(command_message->param_data_length) << + " exceeds remaining RDM message size of " << block_size; + return NULL; + } + return command_message; +} + + +/* + * Calculate the checksum of this packet + */ +uint16_t RDMCommand::CalculateChecksum(const uint8_t *data, + unsigned int packet_length) { + unsigned int checksum_value = START_CODE; + for (unsigned int i = 0; i < packet_length; i++) + checksum_value += data[i]; + return static_cast(checksum_value); +} + + +/* + * Convert the Command Class int to an enum + */ +RDMCommand::RDMCommandClass RDMCommand::ConvertCommandClass( + uint8_t command_class) { + switch (command_class) { + case DISCOVER_COMMAND: + return DISCOVER_COMMAND; + case DISCOVER_COMMAND_RESPONSE: + return DISCOVER_COMMAND_RESPONSE; + case GET_COMMAND: + return GET_COMMAND; + case GET_COMMAND_RESPONSE: + return GET_COMMAND_RESPONSE; + case SET_COMMAND: + return SET_COMMAND; + case SET_COMMAND_RESPONSE: + return SET_COMMAND_RESPONSE; + default: + return INVALID_COMMAND; + } +} + + +/* + * Inflate a request from some data + */ +RDMRequest* RDMRequest::InflateFromData(const uint8_t *data, + unsigned int length) { + const rdm_command_message *command_message = VerifyData(data, length); + if (!command_message) + return NULL; + + uint16_t sub_device = ((command_message->sub_device[0] << 8) + + command_message->sub_device[1]); + uint16_t param_id = ((command_message->param_id[0] << 8) + + command_message->param_id[1]); + + RDMCommandClass command_class = ConvertCommandClass( + command_message->command_class); + + switch (command_class) { + case GET_COMMAND: + return new RDMGetRequest( + UID(command_message->source_uid), + UID(command_message->destination_uid), + command_message->transaction_number, // transaction # + command_message->port_id, // port id + command_message->message_count, // message count + sub_device, + param_id, + data + sizeof(rdm_command_message), + command_message->param_data_length); // data length + case SET_COMMAND: + return new RDMSetRequest( + UID(command_message->source_uid), + UID(command_message->destination_uid), + command_message->transaction_number, // transaction # + command_message->port_id, // port id + command_message->message_count, // message count + sub_device, + param_id, + data + sizeof(rdm_command_message), + command_message->param_data_length); // data length + default: + OLA_WARN << "Expected a RDM request command but got " << command_class; + return NULL; + } +} + + +/** + * Inflate a request from some data + */ +RDMResponse* RDMResponse::InflateFromData(const uint8_t *data, + unsigned int length) { + const rdm_command_message *command_message = VerifyData(data, length); + if (!command_message) + return NULL; + + uint16_t sub_device = ((command_message->sub_device[0] << 8) + + command_message->sub_device[1]); + uint16_t param_id = ((command_message->param_id[0] << 8) + + command_message->param_id[1]); + + RDMCommandClass command_class = ConvertCommandClass( + command_message->command_class); + + switch (command_class) { + case GET_COMMAND_RESPONSE: + return new RDMGetResponse( + UID(command_message->source_uid), + UID(command_message->destination_uid), + command_message->transaction_number, // transaction # + command_message->port_id, // port id + command_message->message_count, // message count + sub_device, + param_id, + data + sizeof(rdm_command_message), + command_message->param_data_length); // data length + case SET_COMMAND_RESPONSE: + return new RDMSetResponse( + UID(command_message->source_uid), + UID(command_message->destination_uid), + command_message->transaction_number, // transaction # + command_message->port_id, // port id + command_message->message_count, // message count + sub_device, + param_id, + data + sizeof(rdm_command_message), + command_message->param_data_length); // data length + default: + OLA_WARN << "Expected a RDM response command but got " << command_class; + return NULL; + } +} + + + +/** + * This combines two RDMResponses into one. It's used to combine the data from + * two responses in an ACK_OVERFLOW session together. + * @param response1 the first response. + * @param response1 the second response. + * @return A new response with the data from the first and second combined or + * NULL if the size limit is reached. + */ +RDMResponse* RDMResponse::CombineResponses(const RDMResponse *response1, + const RDMResponse *response2) { + unsigned int combined_length = response1->ParamDataSize() + + response2->ParamDataSize(); + // do some sort of checking + if (combined_length > MAX_OVERFLOW_SIZE) { + OLA_WARN << "ACK_OVERFLOW buffer size hit! Limit is " << MAX_OVERFLOW_SIZE + << ", request size is " << combined_length; + return NULL; + } + uint8_t *combined_data = new uint8_t[combined_length]; + memcpy(combined_data, response1->ParamData(), response1->ParamDataSize()); + memcpy(combined_data + response1->ParamDataSize(), + response2->ParamData(), + response2->ParamDataSize()); + + RDMResponse *response = NULL; + if (response1->CommandClass() == GET_COMMAND_RESPONSE && + response2->CommandClass() == GET_COMMAND_RESPONSE) { + response = new RDMGetResponse( + response1->SourceUID(), + response1->DestinationUID(), + response1->TransactionNumber(), + ola::rdm::ACK, + response2->MessageCount(), + response1->SubDevice(), + response1->ParamId(), + combined_data, + combined_length); + } else if (response1->CommandClass() == SET_COMMAND_RESPONSE && + response2->CommandClass() == SET_COMMAND_RESPONSE) { + response = new RDMSetResponse( + response1->SourceUID(), + response1->DestinationUID(), + response1->TransactionNumber(), + ola::rdm::ACK, + response2->MessageCount(), + response1->SubDevice(), + response1->ParamId(), + combined_data, + combined_length); + } else { + OLA_WARN << "Expected a RDM request command but got " << + std::hex << response1->CommandClass(); + } + delete[] combined_data; + return response; +} + +// Helper functions follow +/* + * Generate a NACK response with a reason code + */ +RDMResponse *NackWithReason(const RDMRequest *request, + rdm_nack_reason reason_enum) { + uint16_t reason = ola::network::HostToNetwork(static_cast( + reason_enum)); + if (request->CommandClass() == ola::rdm::RDMCommand::GET_COMMAND) { + return new ola::rdm::RDMGetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + NACK_REASON, + 0, + request->SubDevice(), + request->ParamId(), + reinterpret_cast(&reason), + sizeof(reason)); + } else { + return new ola::rdm::RDMSetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + NACK_REASON, + 0, + request->SubDevice(), + request->ParamId(), + reinterpret_cast(&reason), + sizeof(reason)); + } +} + +/* + * Generate a ACK Response with some data + */ +RDMResponse *GetResponseWithData(const RDMRequest *request, + const uint8_t *data, + unsigned int length) { + if (request->CommandClass() == ola::rdm::RDMCommand::GET_COMMAND) { + return new RDMGetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + ACK, + 0, + request->SubDevice(), + request->ParamId(), + data, + length); + } else { + return new RDMSetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + ACK, + 0, + request->SubDevice(), + request->ParamId(), + data, + length); + } +} +} // rdm +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommandTest.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommandTest.cpp new file mode 100644 index 0000000..74fdf03 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMCommandTest.cpp @@ -0,0 +1,662 @@ +/* + * 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 Library 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. + * + * RDMCommandTest.cpp + * Test fixture for the RDMCommand classes + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/RDMCommand.h" +#include "ola/rdm/RDMEnums.h" +#include "ola/rdm/UID.h" + +using ola::network::HostToNetwork; +using ola::rdm::RDMCommand; +using ola::rdm::RDMGetRequest; +using ola::rdm::RDMGetResponse; +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; +using ola::rdm::RDMSetRequest; +using ola::rdm::RDMSetResponse; +using ola::rdm::UID; +using std::string; + +class RDMCommandTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RDMCommandTest); + CPPUNIT_TEST(testRDMCommand); + CPPUNIT_TEST(testRequestInflation); + CPPUNIT_TEST(testResponseInflation); + CPPUNIT_TEST(testNackWithReason); + CPPUNIT_TEST(testGetResponseWithData); + CPPUNIT_TEST(testCombineResponses); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + + void testRDMCommand(); + void testRequestInflation(); + void testResponseInflation(); + void testNackWithReason(); + void testGetResponseWithData(); + void testCombineResponses(); + + private: + void PackAndVerify(const RDMCommand &command, + const uint8_t *expected, + unsigned int expected_length); + void UpdateChecksum(uint8_t *expected, + unsigned int expected_length); + + static uint8_t EXPECTED_GET_BUFFER[]; + static uint8_t EXPECTED_SET_BUFFER[]; + static uint8_t EXPECTED_GET_RESPONSE_BUFFER[]; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(RDMCommandTest); + + +uint8_t RDMCommandTest::EXPECTED_GET_BUFFER[] = { + 1, 24, // sub code & length + 0, 3, 0, 0, 0, 4, // dst uid + 0, 1, 0, 0, 0, 2, // src uid + 0, 1, 0, 0, 10, // transaction, port id, msg count & sub device + 0x20, 1, 40, 0, // command, param id, param data length + 0, 0 // checksum, filled in below +}; + +uint8_t RDMCommandTest::EXPECTED_SET_BUFFER[] = { + 1, 28, // sub code & length + 0, 3, 0, 0, 0, 4, // dst uid + 0, 1, 0, 0, 0, 2, // src uid + 0, 1, 0, 0, 10, // transaction, port id, msg count & sub device + 0x30, 1, 40, 4, // command, param id, param data length + 0xa5, 0xa5, 0xa5, 0xa5, // param data + 0, 0 // checksum, filled in below +}; + + +uint8_t RDMCommandTest::EXPECTED_GET_RESPONSE_BUFFER[] = { + 1, 28, // sub code & length + 0, 3, 0, 0, 0, 4, // dst uid + 0, 1, 0, 0, 0, 2, // src uid + 0, 1, 0, 0, 10, // transaction, port id, msg count & sub device + 0x21, 1, 40, 4, // command, param id, param data length + 0x5a, 0x5a, 0x5a, 0x5a, // param data + 0, 0 // checksum, filled in below +}; + + +/* + * Fill in the checksums + */ +void RDMCommandTest::setUp() { + ola::InitLogging(ola::OLA_LOG_INFO, ola::OLA_LOG_STDERR); + UpdateChecksum(EXPECTED_GET_BUFFER, sizeof(EXPECTED_GET_BUFFER)); + UpdateChecksum(EXPECTED_SET_BUFFER, sizeof(EXPECTED_SET_BUFFER)); + UpdateChecksum(EXPECTED_GET_RESPONSE_BUFFER, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); +} + + +/* + * Test the RDMCommands work. + */ +void RDMCommandTest::testRDMCommand() { + UID source(1, 2); + UID destination(3, 4); + + RDMGetRequest command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + + CPPUNIT_ASSERT_EQUAL(source, command.SourceUID()); + CPPUNIT_ASSERT_EQUAL(destination, command.DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, command.TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, command.PortId()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, command.MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, command.SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND, command.CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, command.ParamId()); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command.ParamData()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, command.ParamDataSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 25, command.Size()); + + // try one with extra long data + uint8_t *data = new uint8_t[232]; + RDMGetRequest long_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 123, // param id + data, // data + 232); // data length + + CPPUNIT_ASSERT_EQUAL((unsigned int) 231, long_command.ParamDataSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 256, long_command.Size()); + PackAndVerify(command, EXPECTED_GET_BUFFER, sizeof(EXPECTED_GET_BUFFER)); + + uint32_t data_value = 0xa5a5a5a5; + RDMSetRequest command3(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + reinterpret_cast(&data_value), // data + sizeof(data_value)); // data length + + CPPUNIT_ASSERT_EQUAL((unsigned int) 29, command3.Size()); + PackAndVerify(command3, EXPECTED_SET_BUFFER, sizeof(EXPECTED_SET_BUFFER)); + + delete[] data; +} + + +/* + * Test that we can inflate RDM request messages correctly + */ +void RDMCommandTest::testRequestInflation() { + UID source(1, 2); + UID destination(3, 4); + RDMRequest *command = RDMRequest::InflateFromData(NULL, 10); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); + + command = RDMRequest::InflateFromData(EXPECTED_GET_BUFFER, 0); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); + + command = RDMRequest::InflateFromData( + EXPECTED_GET_BUFFER, + sizeof(EXPECTED_GET_BUFFER)); + CPPUNIT_ASSERT(NULL != command); + + RDMGetRequest expected_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + CPPUNIT_ASSERT(expected_command == *command); + delete command; + + command = RDMRequest::InflateFromData( + EXPECTED_SET_BUFFER, + sizeof(EXPECTED_SET_BUFFER)); + CPPUNIT_ASSERT(NULL != command); + uint8_t expected_data[] = {0xa5, 0xa5, 0xa5, 0xa5}; + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, command->ParamDataSize()); + CPPUNIT_ASSERT(0 == memcmp(expected_data, command->ParamData(), + command->ParamDataSize())); + delete command; + + // change the param length and make sure the checksum fails + uint8_t *bad_packet = new uint8_t[sizeof(EXPECTED_GET_BUFFER)]; + memcpy(bad_packet, EXPECTED_GET_BUFFER, sizeof(EXPECTED_GET_BUFFER)); + bad_packet[22] = 255; + + command = RDMRequest::InflateFromData( + bad_packet, + sizeof(EXPECTED_GET_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + + // now make sure we can't pass a bad param length larger than the buffer + UpdateChecksum(bad_packet, sizeof(EXPECTED_GET_BUFFER)); + command = RDMRequest::InflateFromData( + bad_packet, + sizeof(EXPECTED_GET_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + delete[] bad_packet; + + // change the param length of another packet and make sure the checksum fails + bad_packet = new uint8_t[sizeof(EXPECTED_SET_BUFFER)]; + memcpy(bad_packet, EXPECTED_SET_BUFFER, sizeof(EXPECTED_SET_BUFFER)); + bad_packet[22] = 5; + UpdateChecksum(bad_packet, sizeof(EXPECTED_SET_BUFFER)); + command = RDMRequest::InflateFromData( + bad_packet, + sizeof(EXPECTED_SET_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + delete[] bad_packet; + + // now try to inflate a response + command = RDMRequest::InflateFromData( + EXPECTED_GET_RESPONSE_BUFFER, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); +} + + +/* + * Calculate the checksum for a packet, and verify + */ +void RDMCommandTest::PackAndVerify(const RDMCommand &command, + const uint8_t *expected, + unsigned int expected_length) { + // now check packing + unsigned int buffer_size = command.Size(); + uint8_t *buffer = new uint8_t[buffer_size]; + CPPUNIT_ASSERT(command.Pack(buffer, &buffer_size)); + + for (unsigned int i = 0 ; i < expected_length; i++) { + std::stringstream str; + str << "Offset " << i << ", expected " << static_cast(expected[i]) << + ", got " << static_cast(buffer[i]); + CPPUNIT_ASSERT_MESSAGE(str.str(), buffer[i] == expected[i]); + } + delete[] buffer; +} + + +/* + * Test that we can inflate RDM response correctly + */ +void RDMCommandTest::testResponseInflation() { + UID source(1, 2); + UID destination(3, 4); + RDMResponse *command = RDMResponse::InflateFromData(NULL, 10); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); + + command = RDMResponse::InflateFromData(EXPECTED_GET_RESPONSE_BUFFER, 0); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); + + command = RDMResponse::InflateFromData( + EXPECTED_GET_RESPONSE_BUFFER, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + CPPUNIT_ASSERT(NULL != command); + uint8_t expected_data[] = {0x5a, 0x5a, 0x5a, 0x5a}; + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, command->ParamDataSize()); + CPPUNIT_ASSERT(0 == memcmp(expected_data, command->ParamData(), + command->ParamDataSize())); + + uint32_t data_value = 0x5a5a5a5a; + RDMGetResponse expected_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + reinterpret_cast(&data_value), + sizeof(data_value)); // data length + CPPUNIT_ASSERT(expected_command == *command); + + delete command; + + // change the param length and make sure the checksum fails + uint8_t *bad_packet = new uint8_t[sizeof(EXPECTED_GET_RESPONSE_BUFFER)]; + memcpy(bad_packet, EXPECTED_GET_RESPONSE_BUFFER, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + bad_packet[22] = 255; + + command = RDMResponse::InflateFromData( + bad_packet, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + + // now make sure we can't pass a bad param length larger than the buffer + UpdateChecksum(bad_packet, sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + command = RDMResponse::InflateFromData( + bad_packet, + sizeof(EXPECTED_GET_RESPONSE_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + delete[] bad_packet; + + // change the param length of another packet and make sure the checksum fails + bad_packet = new uint8_t[sizeof(EXPECTED_SET_BUFFER)]; + memcpy(bad_packet, EXPECTED_SET_BUFFER, sizeof(EXPECTED_SET_BUFFER)); + bad_packet[22] = 5; + UpdateChecksum(bad_packet, sizeof(EXPECTED_SET_BUFFER)); + command = RDMResponse::InflateFromData( + bad_packet, + sizeof(EXPECTED_SET_BUFFER)); + CPPUNIT_ASSERT(NULL == command); + delete[] bad_packet; + + // now try to inflate a response + command = RDMResponse::InflateFromData( + EXPECTED_GET_BUFFER, + sizeof(EXPECTED_GET_BUFFER)); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), command); +} + +/* + * Calculate a checksum for a packet and update it + */ +void RDMCommandTest::UpdateChecksum(uint8_t *expected, + unsigned int expected_length) { + unsigned int checksum = RDMCommand::START_CODE; + for (unsigned int i = 0 ; i < expected_length - 2; i++) + checksum += expected[i]; + + expected[expected_length - 2] = checksum >> 8; + expected[expected_length - 1] = checksum & 0xff; +} + + +void RDMCommandTest::testNackWithReason() { + UID source(1, 2); + UID destination(3, 4); + + RDMGetRequest get_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + + RDMResponse *response = NackWithReason(&get_command, + ola::rdm::NR_UNKNOWN_PID); + uint16_t reason = ola::rdm::NR_UNKNOWN_PID; + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::NACK_REASON, + response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(HostToNetwork(reason), + *(reinterpret_cast(response->ParamData()))); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(reason), + response->ParamDataSize()); + delete response; + + response = NackWithReason(&get_command, + ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + reason = ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE; + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::NACK_REASON, + response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(HostToNetwork(reason), + *(reinterpret_cast(response->ParamData()))); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(reason), + response->ParamDataSize()); + delete response; + + RDMSetRequest set_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + + response = NackWithReason(&set_command, + ola::rdm::NR_WRITE_PROTECT); + reason = ola::rdm::NR_WRITE_PROTECT; + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::NACK_REASON, + response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::SET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(HostToNetwork(reason), + *(reinterpret_cast(response->ParamData()))); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(reason), + response->ParamDataSize()); + delete response; +} + + +void RDMCommandTest::testGetResponseWithData() { + UID source(1, 2); + UID destination(3, 4); + + RDMGetRequest get_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + + RDMResponse *response = GetResponseWithData(&get_command, NULL, 0); + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::ACK, response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), + response->ParamData()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, + response->ParamDataSize()); + delete response; + + RDMSetRequest set_command(source, + destination, + 0, // transaction # + 1, // port id + 0, // message count + 10, // sub device + 296, // param id + NULL, // data + 0); // data length + + response = GetResponseWithData(&set_command, NULL, 0); + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::ACK, response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::SET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), + response->ParamData()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, + response->ParamDataSize()); + delete response; + + uint32_t data_value = 0xa5a5a5a5; + response = GetResponseWithData( + &get_command, + reinterpret_cast(&data_value), + sizeof(data_value)); + CPPUNIT_ASSERT(response); + CPPUNIT_ASSERT_EQUAL(destination, response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(source, response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) ola::rdm::ACK, response->ResponseType()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + response->CommandClass()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 296, response->ParamId()); + CPPUNIT_ASSERT_EQUAL(data_value, + *(reinterpret_cast(response->ParamData()))); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(data_value), + response->ParamDataSize()); + delete response; +} + + +/** + * Check that CombineResponses() works. + */ +void RDMCommandTest::testCombineResponses() { + UID source(1, 2); + UID destination(3, 4); + uint16_t param_id = 296; + + uint32_t data_value = 0x5a5a5a5a; + RDMGetResponse response1(source, + destination, + 0, // transaction # + ola::rdm::ACK, // response type + 0, // message count + 10, // sub device + param_id, // param id + reinterpret_cast(&data_value), + sizeof(data_value)); // data length + + uint32_t data_value2 = 0xa5a5a5a5; + RDMGetResponse response2(source, + destination, + 1, // transaction # + ola::rdm::ACK, // response type + 0, // message count + 10, // sub device + param_id, // param id + reinterpret_cast(&data_value2), + sizeof(data_value2)); // data length + + const RDMResponse *combined_response = RDMResponse::CombineResponses( + &response1, + &response2); + CPPUNIT_ASSERT(combined_response); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + combined_response->CommandClass()); + CPPUNIT_ASSERT_EQUAL(source, combined_response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(destination, combined_response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, combined_response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(param_id, combined_response->ParamId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 8, combined_response->ParamDataSize()); + const uint8_t *combined_data = combined_response->ParamData(); + const uint32_t expected_data[] = {0x5a5a5a5a, 0xa5a5a5a5}; + CPPUNIT_ASSERT(0 == memcmp(expected_data, + combined_data, + sizeof(expected_data))); + delete combined_response; + + + // try to combine with a response with no data + RDMGetResponse response3(source, + destination, + 1, // transaction # + ola::rdm::ACK, // response type + 0, // message count + 10, // sub device + param_id, // param id + NULL, + 0); + + combined_response = RDMResponse::CombineResponses( + &response1, + &response3); + CPPUNIT_ASSERT(combined_response); + CPPUNIT_ASSERT_EQUAL(RDMCommand::GET_COMMAND_RESPONSE, + combined_response->CommandClass()); + CPPUNIT_ASSERT_EQUAL(source, combined_response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(destination, combined_response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, combined_response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(param_id, combined_response->ParamId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, combined_response->ParamDataSize()); + combined_data = combined_response->ParamData(); + CPPUNIT_ASSERT_EQUAL(data_value, + *(reinterpret_cast(combined_data))); + delete combined_response; + + // combining a GetResponse with a SetResponse is invalid + RDMSetResponse response4(source, + destination, + 1, // transaction # + ola::rdm::ACK, // response type + 0, // message count + 10, // sub device + param_id, // param id + NULL, + 0); + combined_response = RDMResponse::CombineResponses( + &response1, + &response4); + CPPUNIT_ASSERT(!combined_response); + combined_response = RDMResponse::CombineResponses( + &response4, + &response1); + CPPUNIT_ASSERT(!combined_response); + + // combine two set responses + RDMSetResponse response5(source, + destination, + 0, // transaction # + ola::rdm::ACK, // response type + 0, // message count + 10, // sub device + param_id, // param id + reinterpret_cast(&data_value), + sizeof(data_value)); // data length + + + combined_response = RDMResponse::CombineResponses( + &response5, + &response4); + CPPUNIT_ASSERT(combined_response); + CPPUNIT_ASSERT_EQUAL(RDMCommand::SET_COMMAND_RESPONSE, + combined_response->CommandClass()); + CPPUNIT_ASSERT_EQUAL(source, combined_response->SourceUID()); + CPPUNIT_ASSERT_EQUAL(destination, combined_response->DestinationUID()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->TransactionNumber()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, combined_response->MessageCount()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, combined_response->SubDevice()); + CPPUNIT_ASSERT_EQUAL(param_id, combined_response->ParamId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, combined_response->ParamDataSize()); + combined_data = combined_response->ParamData(); + CPPUNIT_ASSERT_EQUAL(data_value, + *(reinterpret_cast(combined_data))); + delete combined_response; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMHelper.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMHelper.cpp new file mode 100644 index 0000000..edf6148 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMHelper.cpp @@ -0,0 +1,919 @@ +/* + * 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 Library 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. + * + * RDMHelper.cpp + * Various misc RDM functions. + * Copyright (C) 2010 Simon Newton + * + * At some point we may want to localize this file. + */ + +#include +#include +#include "ola/rdm/RDMHelper.h" + +namespace ola { +namespace rdm { + + +using std::string; +using std::stringstream; + + +/** + * Convert a uint8_t representing a lamp mode to a human-readable string. + * @param type the lamp mode value + */ +string DataTypeToString(uint8_t type) { + switch (type) { + case DS_NOT_DEFINED: + return "Not defined"; + case DS_BIT_FIELD: + return "Bit field"; + case DS_ASCII: + return "ASCII"; + case DS_UNSIGNED_BYTE: + return "uint8"; + case DS_SIGNED_BYTE: + return "int8"; + case DS_UNSIGNED_WORD: + return "uint16"; + case DS_SIGNED_WORD: + return "int16"; + case DS_UNSIGNED_DWORD: + return "uint32 "; + case DS_SIGNED_DWORD: + return "int32 "; + default: + stringstream str; + str << "Unknown, was " << static_cast(type); + return str.str(); + } +} + + +/** + * Convert a uint8_t representing a lamp mode to a human-readable string. + * @param lamp_mode the lamp mode value + */ +string LampModeToString(uint8_t lamp_mode) { + switch (lamp_mode) { + case LAMP_ON_MODE_OFF: + return "Off"; + case LAMP_ON_MODE_DMX: + return "DMX"; + case LAMP_ON_MODE_ON: + return "On"; + case LAMP_ON_MODE_AFTER_CAL: + return "On after calibration"; + default: + stringstream str; + str << "Unknown, was " << static_cast(lamp_mode); + return str.str(); + } +} + + +/** + * Convert a uint8_t representing a lamp mode to a human-readable string. + * @param lamp_state the lamp mode value + */ +string LampStateToString(uint8_t lamp_state) { + switch (lamp_state) { + case LAMP_OFF: + return "Off"; + case LAMP_ON: + return "On"; + case LAMP_STRIKE: + return "Strike"; + case LAMP_STANDBY: + return "Standby"; + case LAMP_NOT_PRESENT: + return "Lamp not present"; + case LAMP_ERROR: + return "Error"; + default: + stringstream str; + str << "Unknown, was " << static_cast(lamp_state); + return str.str(); + } +} + + +/** + * Convert a uint16_t representing a nack reason to a human-readable string. + * @param reason the nack reason value + */ +string NackReasonToString(uint16_t reason) { + switch (reason) { + case NR_UNKNOWN_PID: + return "Unknown PID"; + case NR_FORMAT_ERROR: + return "Format error"; + case NR_HARDWARE_FAULT: + return "Hardware fault"; + case NR_PROXY_REJECT: + return "Proxy reject"; + case NR_WRITE_PROTECT: + return "Write protect"; + case NR_UNSUPPORTED_COMMAND_CLASS: + return "Unsupported command class"; + case NR_DATA_OUT_OF_RANGE: + return "Data out of range"; + case NR_BUFFER_FULL: + return "Buffer full"; + case NR_PACKET_SIZE_UNSUPPORTED: + return "Packet size unsupported"; + case NR_SUB_DEVICE_OUT_OF_RANGE: + return "Sub device out of range"; + default: + stringstream str; + str << "Unknown, was " << reason; + return str.str(); + } +} + + +/** + * Convert a uint8_t representing a power state to a human-readable string. + * @param power_state the power state value + */ +string PowerStateToString(uint8_t power_state) { + switch (power_state) { + case POWER_STATE_FULL_OFF: + return "Full Off"; + case POWER_STATE_SHUTDOWN: + return "Shutdown"; + case POWER_STATE_STANDBY: + return "Standby"; + case POWER_STATE_NORMAL: + return "Normal"; + default: + stringstream str; + str << "Unknown, was " << static_cast(power_state); + return str.str(); + } +} + + +/** + * Safely convert a uint8_t to a rdm_power_state + */ +bool UIntToPowerState(uint8_t state, rdm_power_state *power_state) { + switch (state) { + case POWER_STATE_FULL_OFF: + *power_state = POWER_STATE_FULL_OFF; + return true; + case POWER_STATE_SHUTDOWN: + *power_state = POWER_STATE_SHUTDOWN; + return true; + case POWER_STATE_STANDBY: + *power_state = POWER_STATE_STANDBY; + return true; + case POWER_STATE_NORMAL: + *power_state = POWER_STATE_NORMAL; + return true; + default: + return false; + } +} + + +/** + * Convert a uint8 representing a prefix to a human-readable string. + * @param prefix the prefix value + */ +string PrefixToString(uint8_t prefix) { + switch (prefix) { + case PREFIX_NONE: + return ""; + case PREFIX_DECI: + return "Deci"; + case PREFIX_CENTI: + return "Centi"; + case PREFIX_MILLI: + return "Milli"; + case PREFIX_MICRO: + return "Micro"; + case PREFIX_NANO: + return "Nano"; + case PREFIX_PICO: + return "Pico"; + case PREFIX_FEMPTO: + return "Fempto"; + case PREFIX_ATTO: + return "Atto"; + case PREFIX_ZEPTO: + return "Zepto"; + case PREFIX_YOCTO: + return "Yocto"; + case PREFIX_DECA: + return "Deca"; + case PREFIX_HECTO: + return "Hecto"; + case PREFIX_KILO: + return "Kilo"; + case PREFIX_MEGA: + return "Mega"; + case PREFIX_GIGA: + return "Giga"; + case PREFIX_TERRA: + return "Terra"; + case PREFIX_PETA: + return "Peta"; + case PREFIX_EXA: + return "Exa"; + case PREFIX_ZETTA: + return "Zetta"; + case PREFIX_YOTTA: + return "Yotta"; + default: + stringstream str; + str << "Unknown, was " << static_cast(prefix); + return str.str(); + } +} + + +/** + * Convert a uint16_t representing a product category to a human-readable + * string. + * @param category the product category value + */ +string ProductCategoryToString(uint16_t category) { + switch (category) { + case PRODUCT_CATEGORY_NOT_DECLARED: + return "Not declared"; + case PRODUCT_CATEGORY_FIXTURE: + return "Fixture"; + case PRODUCT_CATEGORY_FIXTURE_FIXED: + return "Fixed fixture"; + case PRODUCT_CATEGORY_FIXTURE_MOVING_YOKE: + return "Moving yoke fixture"; + case PRODUCT_CATEGORY_FIXTURE_MOVING_MIRROR: + return "Moving mirror fixture"; + case PRODUCT_CATEGORY_FIXTURE_OTHER: + return "Fixture other"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY: + return "Fixture accessory"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_COLOR: + return "Fixture accessory color"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_YOKE: + return "Fixture accessory yoke"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_MIRROR: + return "Fixture accessory mirror"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_EFFECT: + return "Fixture accessory effect"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_BEAM: + return "Fixture accessory beam"; + case PRODUCT_CATEGORY_FIXTURE_ACCESSORY_OTHER: + return "Fixture accessory other"; + case PRODUCT_CATEGORY_PROJECTOR: + return "Projector"; + case PRODUCT_CATEGORY_PROJECTOR_FIXED: + return "Projector fixed"; + case PRODUCT_CATEGORY_PROJECTOR_MOVING_YOKE: + return "Projector moving yoke"; + case PRODUCT_CATEGORY_PROJECTOR_MOVING_MIRROR: + return "Projector moving mirror"; + case PRODUCT_CATEGORY_PROJECTOR_OTHER: + return "Projector other"; + case PRODUCT_CATEGORY_ATMOSPHERIC: + return "Atmospheric"; + case PRODUCT_CATEGORY_ATMOSPHERIC_EFFECT: + return "Atmospheric effect"; + case PRODUCT_CATEGORY_ATMOSPHERIC_PYRO: + return "Atmospheric pyro"; + case PRODUCT_CATEGORY_ATMOSPHERIC_OTHER: + return "Atmospheric other"; + case PRODUCT_CATEGORY_DIMMER: + return "Dimmer"; + case PRODUCT_CATEGORY_DIMMER_AC_INCANDESCENT: + return "Dimmer AC incandescent"; + case PRODUCT_CATEGORY_DIMMER_AC_FLUORESCENT: + return "Dimmer AC fluorescent"; + case PRODUCT_CATEGORY_DIMMER_AC_COLDCATHODE: + return "Dimmer AC cold cathode"; + case PRODUCT_CATEGORY_DIMMER_AC_NONDIM: + return "Dimmer AC no dim"; + case PRODUCT_CATEGORY_DIMMER_AC_ELV: + return "Dimmer AC ELV"; + case PRODUCT_CATEGORY_DIMMER_AC_OTHER: + return "Dimmer AC other"; + case PRODUCT_CATEGORY_DIMMER_DC_LEVEL: + return "Dimmer DC level"; + case PRODUCT_CATEGORY_DIMMER_DC_PWM: + return "Dimmer DC PWM"; + case PRODUCT_CATEGORY_DIMMER_CS_LED: + return "Dimmer DC led"; + case PRODUCT_CATEGORY_DIMMER_OTHER: + return "Dimmer other"; + case PRODUCT_CATEGORY_POWER: + return "Power"; + case PRODUCT_CATEGORY_POWER_CONTROL: + return "Power control"; + case PRODUCT_CATEGORY_POWER_SOURCE: + return "Power source"; + case PRODUCT_CATEGORY_POWER_OTHER: + return "Power other"; + case PRODUCT_CATEGORY_SCENIC: + return "Scenic"; + case PRODUCT_CATEGORY_SCENIC_DRIVE: + return "Scenic drive"; + case PRODUCT_CATEGORY_SCENIC_OTHER: + return "Scenic other"; + case PRODUCT_CATEGORY_DATA: + return "Data"; + case PRODUCT_CATEGORY_DATA_DISTRIBUTION: + return "Data distribution"; + case PRODUCT_CATEGORY_DATA_CONVERSION: + return "Data conversion"; + case PRODUCT_CATEGORY_DATA_OTHER: + return "Data other"; + case PRODUCT_CATEGORY_AV: + return "A/V"; + case PRODUCT_CATEGORY_AV_AUDIO: + return "A/V audio"; + case PRODUCT_CATEGORY_AV_VIDEO: + return "A/V video"; + case PRODUCT_CATEGORY_AV_OTHER: + return "AV other"; + case PRODUCT_CATEGORY_MONITOR: + return "monitor"; + case PRODUCT_CATEGORY_MONITOR_ACLINEPOWER: + return "AC line power monitor"; + case PRODUCT_CATEGORY_MONITOR_DCPOWER: + return "DC power monitor"; + case PRODUCT_CATEGORY_MONITOR_ENVIRONMENTAL: + return "Environmental monitor"; + case PRODUCT_CATEGORY_MONITOR_OTHER: + return "Other monitor"; + case PRODUCT_CATEGORY_CONTROL: + return "Control"; + case PRODUCT_CATEGORY_CONTROL_CONTROLLER: + return "Controller"; + case PRODUCT_CATEGORY_CONTROL_BACKUPDEVICE: + return "Backup device"; + case PRODUCT_CATEGORY_CONTROL_OTHER: + return "Other control"; + case PRODUCT_CATEGORY_TEST: + return "Test"; + case PRODUCT_CATEGORY_TEST_EQUIPMENT: + return "Test equipment"; + case PRODUCT_CATEGORY_TEST_EQUIPMENT_OTHER: + return "Test equipment other"; + case PRODUCT_CATEGORY_OTHER: + return "Other"; + default: + stringstream str; + str << "Unknown, was " << static_cast(category); + return str.str(); + } +} + + +/** + * Convert a uint16_t representing a product detail to a human-readable string. + * @param detail the product detail value. + */ +string ProductDetailToString(uint16_t detail) { + switch (detail) { + case PRODUCT_DETAIL_NOT_DECLARED: + return "Not declared"; + case PRODUCT_DETAIL_ARC: + return "Arc Lamp"; + case PRODUCT_DETAIL_METAL_HALIDE: + return "Metal Halide Lamp"; + case PRODUCT_DETAIL_INCANDESCENT: + return "Incandescent Lamp"; + case PRODUCT_DETAIL_LED: + return "LED"; + case PRODUCT_DETAIL_FLUROESCENT: + return "Fluroescent"; + case PRODUCT_DETAIL_COLDCATHODE: + return "Cold Cathode"; + case PRODUCT_DETAIL_ELECTROLUMINESCENT: + return "Electro-luminescent"; + case PRODUCT_DETAIL_LASER: + return "Lase"; + case PRODUCT_DETAIL_FLASHTUBE: + return "Flash Tube"; + case PRODUCT_DETAIL_COLORSCROLLER: + return "Color Scroller"; + case PRODUCT_DETAIL_COLORWHEEL: + return "Color Wheel"; + case PRODUCT_DETAIL_COLORCHANGE: + return "Color Changer (Semaphore or other type)"; + case PRODUCT_DETAIL_IRIS_DOUSER: + return "Iris"; + case PRODUCT_DETAIL_DIMMING_SHUTTER: + return "Dimming Shuttle"; + case PRODUCT_DETAIL_PROFILE_SHUTTER: + return "Profile Shuttle"; + case PRODUCT_DETAIL_BARNDOOR_SHUTTER: + return "Barndoor Shuttle"; + case PRODUCT_DETAIL_EFFECTS_DISC: + return "Effects Disc"; + case PRODUCT_DETAIL_GOBO_ROTATOR: + return "Gobo Rotator"; + case PRODUCT_DETAIL_VIDEO: + return "Video"; + case PRODUCT_DETAIL_SLIDE: + return "Slide"; + case PRODUCT_DETAIL_FILM: + return "Film"; + case PRODUCT_DETAIL_OILWHEEL: + return "Oil Wheel"; + case PRODUCT_DETAIL_LCDGATE: + return "LCD Gate"; + case PRODUCT_DETAIL_FOGGER_GLYCOL: + return "Fogger, Glycol"; + case PRODUCT_DETAIL_FOGGER_MINERALOIL: + return "Fogger, Mineral Oil"; + case PRODUCT_DETAIL_FOGGER_WATER: + return "Fogger, Water"; + case PRODUCT_DETAIL_CO2: + return "Dry Ice/ Carbon Dioxide Device"; + case PRODUCT_DETAIL_LN2: + return "Nitrogen based"; + case PRODUCT_DETAIL_BUBBLE: + return "Bubble or Foam Machine"; + case PRODUCT_DETAIL_FLAME_PROPANE: + return "Propane Flame"; + case PRODUCT_DETAIL_FLAME_OTHER: + return "Other Flame"; + case PRODUCT_DETAIL_OLEFACTORY_STIMULATOR: + return "Scents"; + case PRODUCT_DETAIL_SNOW: + return "Snow Machine"; + case PRODUCT_DETAIL_WATER_JET: + return "Water Jet"; + case PRODUCT_DETAIL_WIND: + return "Wind Machine"; + case PRODUCT_DETAIL_CONFETTI: + return "Confetti Machine"; + case PRODUCT_DETAIL_HAZARD: + return "Hazard (Any form of pyrotechnic control or device.)"; + case PRODUCT_DETAIL_PHASE_CONTROL: + return "Phase Control"; + case PRODUCT_DETAIL_REVERSE_PHASE_CONTROL: + return "Phase Angle"; + case PRODUCT_DETAIL_SINE: + return "Sine"; + case PRODUCT_DETAIL_PWM: + return "PWM"; + case PRODUCT_DETAIL_DC: + return "DC"; + case PRODUCT_DETAIL_HFBALLAST: + return "HF Ballast"; + case PRODUCT_DETAIL_HFHV_NEONBALLAST: + return "HFHV Neon/Argon"; + case PRODUCT_DETAIL_HFHV_EL: + return "HFHV Electroluminscent"; + case PRODUCT_DETAIL_MHR_BALLAST: + return "Metal Halide Ballast"; + case PRODUCT_DETAIL_BITANGLE_MODULATION: + return "Bit Angle Modulation"; + case PRODUCT_DETAIL_FREQUENCY_MODULATION: + return "Frequency Modulation"; + case PRODUCT_DETAIL_HIGHFREQUENCY_12V: + return "High Frequency 12V"; + case PRODUCT_DETAIL_RELAY_MECHANICAL: + return "Mechanical Relay"; + case PRODUCT_DETAIL_RELAY_ELECTRONIC: + return "Electronic Relay"; + case PRODUCT_DETAIL_SWITCH_ELECTRONIC: + return "Electronic Switch"; + case PRODUCT_DETAIL_CONTACTOR: + return "Contactor"; + case PRODUCT_DETAIL_MIRRORBALL_ROTATOR: + return "Mirror Ball Rotator"; + case PRODUCT_DETAIL_OTHER_ROTATOR: + return "Other Rotator"; + case PRODUCT_DETAIL_KABUKI_DROP: + return "Kabuki Drop"; + case PRODUCT_DETAIL_CURTAIN: + return "Curtain"; + case PRODUCT_DETAIL_LINESET: + return "Line Set"; + case PRODUCT_DETAIL_MOTOR_CONTROL: + return "Motor Control"; + case PRODUCT_DETAIL_DAMPER_CONTROL: + return "Damper Control"; + case PRODUCT_DETAIL_SPLITTER: + return "Splitter"; + case PRODUCT_DETAIL_ETHERNET_NODE: + return "Ethernet Node"; + case PRODUCT_DETAIL_MERGE: + return "DMX512 Merger"; + case PRODUCT_DETAIL_DATAPATCH: + return "Data Patch"; + case PRODUCT_DETAIL_WIRELESS_LINK: + return "Wireless link"; + case PRODUCT_DETAIL_PROTOCOL_CONVERTOR: + return "Protocol Convertor"; + case PRODUCT_DETAIL_ANALOG_DEMULTIPLEX: + return "DMX512 to DC Voltage"; + case PRODUCT_DETAIL_ANALOG_MULTIPLEX: + return "DC Voltage to DMX512"; + case PRODUCT_DETAIL_SWITCH_PANEL: + return "Switch Panel"; + case PRODUCT_DETAIL_ROUTER: + return "Router"; + case PRODUCT_DETAIL_FADER: + return "Fader, Single Channel"; + case PRODUCT_DETAIL_MIXER: + return "Mixer, Multi Channel"; + case PRODUCT_DETAIL_CHANGEOVER_MANUAL: + return "Manual Changeover"; + case PRODUCT_DETAIL_CHANGEOVER_AUTO: + return "Auto Changeover"; + case PRODUCT_DETAIL_TEST: + return "Test Device"; + case PRODUCT_DETAIL_GFI_RCD: + return "GFI / RCD Device"; + case PRODUCT_DETAIL_BATTERY: + return "Battery"; + case PRODUCT_DETAIL_CONTROLLABLE_BREAKER: + return "Controllable Breaker"; + case PRODUCT_DETAIL_OTHER: + return "Other Device"; + default: + stringstream str; + str << "Unknown, was " << detail; + return str.str(); + } +} + + +/** + * Convert a uint8_t representing a sensor type to a human-readable string. + * @param type the sensor type value + */ +string SensorTypeToString(uint8_t type) { + switch (type) { + case SENSOR_TEMPERATURE: + return "Temperature"; + case SENSOR_VOLTAGE: + return "Voltage"; + case SENSOR_CURRENT: + return "Current"; + case SENSOR_FREQUENCY: + return "Frequency"; + case SENSOR_RESISTANCE: + return "Resistance"; + case SENSOR_POWER: + return "Power"; + case SENSOR_MASS: + return "Mass"; + case SENSOR_LENGTH: + return "Length"; + case SENSOR_AREA: + return "Area"; + case SENSOR_VOLUME: + return "Volume"; + case SENSOR_DENSITY: + return "Density"; + case SENSOR_VELOCITY: + return "Velocity"; + case SENSOR_ACCELERATION: + return "Acceleration"; + case SENSOR_FORCE: + return "Force"; + case SENSOR_ENERGY: + return "Energy"; + case SENSOR_PRESSURE: + return "Pressure"; + case SENSOR_TIME: + return "Time"; + case SENSOR_ANGLE: + return "Angle"; + case SENSOR_POSITION_X: + return "Position X"; + case SENSOR_POSITION_Y: + return "Position Y"; + case SENSOR_POSITION_Z: + return "Position Z"; + case SENSOR_ANGULAR_VELOCITY: + return "Angular velocity"; + case SENSOR_LUMINOUS_INTENSITY: + return "Luminous intensity"; + case SENSOR_LUMINOUS_FLUX: + return "Luminous flux"; + case SENSOR_ILLUMINANCE: + return "Illuminance"; + case SENSOR_CHROMINANCE_RED: + return "Chrominance red"; + case SENSOR_CHROMINANCE_GREEN: + return "Chrominance green"; + case SENSOR_CHROMINANCE_BLUE: + return "Chrominance blue"; + case SENSOR_CONTACTS: + return "Contacts"; + case SENSOR_MEMORY: + return "Memory"; + case SENSOR_ITEMS: + return "Items"; + case SENSOR_HUMIDITY: + return "Humidity"; + case SENSOR_COUNTER_16BIT: + return "16 bith counter"; + case SENSOR_OTHER: + return "Other"; + default: + stringstream str; + str << "Unknown, was " << static_cast(type); + return str.str(); + } +} + + +/** + * Convert a uint16_t representing a slot type to a human-readable string. + * @param slot_type the type of the slot. + * @param slot_label the label for the slot. + */ +string SlotInfoToString(uint8_t slot_type, uint16_t slot_label) { + if (slot_type == ST_PRIMARY) { + switch (slot_label) { + case SD_INTENSITY: + return "Primary, intensity"; + case SD_INTENSITY_MASTER: + return "Primary, intensity master"; + case SD_PAN: + return "Primary, pan"; + case SD_TILT: + return "Primary, tilt"; + case SD_COLOR_WHEEL: + return "Primary, color wheel"; + case SD_COLOR_SUB_CYAN: + return "Primary, subtractive cyan"; + case SD_COLOR_SUB_YELLOW: + return "Primary, subtractive yellow"; + case SD_COLOR_SUB_MAGENTA: + return "Primary, subtractive magenta"; + case SD_COLOR_ADD_RED: + return "Primary, additive red"; + case SD_COLOR_ADD_GREEN: + return "Primary, additive green"; + case SD_COLOR_ADD_BLUE: + return "Primary, additive blue"; + case SD_COLOR_CORRECTION: + return "Primary, color correction"; + case SD_COLOR_SCROLL: + return "Primary, scroll"; + case SD_COLOR_SEMAPHORE: + return "Primary, color semaphone"; + case SD_STATIC_GOBO_WHEEL: + return "Primary, static gobo wheel"; + case SD_ROTO_GOBO_WHEEL: + return "Primary, gobo wheel"; + case SD_PRISM_WHEEL: + return "Primary, prism wheel"; + case SD_EFFECTS_WHEEL: + return "Primary, effects wheel"; + case SD_BEAM_SIZE_IRIS: + return "Primary, iris size"; + case SD_EDGE: + return "Primary, edge"; + case SD_FROST: + return "Primary, frost"; + case SD_STROBE: + return "Primary, strobe"; + case SD_ZOOM: + return "Primary, zoom"; + case SD_FRAMING_SHUTTER: + return "Primary, framing shutter"; + case SD_SHUTTER_ROTATE: + return "Primary, shuttle rotate"; + case SD_DOUSER: + return "Primary, douser"; + case SD_BARN_DOOR: + return "Primary, barn door"; + case SD_LAMP_CONTROL: + return "Primary, lamp control"; + case SD_FIXTURE_CONTROL: + return "Primary, fixture control"; + case SD_FIXTURE_SPEED: + return "Primary, fixture speed"; + case SD_MACRO: + return "Primary, macro"; + case SD_UNDEFINED: + return "Primary, undefined"; + default: + stringstream str; + str << "Primary unknown, was " << slot_label; + return str.str(); + } + } else { + stringstream str; + switch (slot_type) { + case ST_SEC_FINE: + str << "fine control for slot " << slot_label; + break; + case ST_SEC_TIMING: + str << "timing control for slot " << slot_label; + break; + case ST_SEC_SPEED: + str << "speed control for slot " << slot_label; + break; + case ST_SEC_CONTROL: + str << "mode control for slot " << slot_label; + break; + case ST_SEC_INDEX: + str << "index control for slot " << slot_label; + break; + case ST_SEC_ROTATION: + str << "rotation speed control for slot " << slot_label; + break; + case ST_SEC_INDEX_ROTATE: + str << "rotation index control for slot " << slot_label; + break; + case ST_SEC_UNDEFINED: + str << "undefined for slot " << slot_label; + break; + default: + str << "unknown for slot " << slot_label; + } + return str.str(); + } +} + + +/** + * Convert a uint16_t representing a status message to a human-readable string. + * @param message_id the status message value + */ +string StatusMessageIdToString(uint16_t message_id) { + switch (message_id) { + case STS_CAL_FAIL: + return "Failed calibration"; + case STS_SENS_NOT_FOUND: + return "sensor not found"; + case STS_SENS_ALWAYS_ON: + return "sensor always on"; + case STS_LAMP_DOUSED: + return "sensor lamp doused"; + case STS_LAMP_STRIKE: + return "sensor lamp failed to strike"; + case STS_OVERTEMP: + return "over temp"; + case STS_UNDERTEMP: + return "under temp"; + case STS_SENS_OUT_RANGE: + return "sensor out of range"; + case STS_OVERVOLTAGE_PHASE: + return "phase over voltage"; + case STS_UNDERVOLTAGE_PHASE: + return "phase under voltage"; + case STS_OVERCURRENT: + return "over current"; + case STS_UNDERCURRENT: + return "under current"; + case STS_PHASE: + return "out of phase"; + case STS_PHASE_ERROR: + return "phase error"; + case STS_AMPS: + return "amps"; + case STS_VOLTS: + return "volts"; + case STS_DIMSLOT_OCCUPIED: + return "no dimmer"; + case STS_BREAKER_TRIP: + return "breaker tripped"; + case STS_WATTS: + return "watts"; + case STS_DIM_FAILURE: + return "dimmer failure"; + case STS_DIM_PANIC: + return "dimmer panic mode"; + case STS_READY: + return "ready"; + case STS_NOT_READY: + return "not ready"; + case STS_LOW_FLUID: + return "low fluid"; + default: + stringstream str; + str << "Unknown, was " << message_id; + return str.str(); + } +} + + +/** + * Convert a uint8_t representing a status type to a human-readable string. + * @param status_type the status type value + */ +string StatusTypeToString(uint8_t status_type) { + switch (status_type) { + case STATUS_NONE: + return "None"; + case STATUS_GET_LAST_MESSAGE: + return "Get last messages"; + case STATUS_ADVISORY: + return "Advisory"; + case STATUS_WARNING: + return "Warning"; + case STATUS_ERROR: + return "Error"; + case STATUS_ADVISORY_CLEARED: + return "Advisory cleared"; + case STATUS_WARNING_CLEARED: + return "Warning cleared"; + case STATUS_ERROR_CLEARED: + return "Error cleared"; + default: + stringstream str; + str << "Unknown, was " << static_cast(status_type); + return str.str(); + } +} + + + +/** + * Convert a uint8_t representing a unit to a human-readable string. + * @param unit the unit value + */ +string UnitToString(uint8_t unit) { + switch (unit) { + case UNITS_NONE: + return "none"; + case UNITS_CENTIGRADE: + return "degrees C"; + case UNITS_VOLTS_DC: + return "Volts (DC)"; + case UNITS_VOLTS_AC_PEAK: + return "Volts (AC Peak)"; + case UNITS_VOLTS_AC_RMS: + return "Volts (AC RMS)"; + case UNITS_AMPERE_DC: + return "Amps (DC)"; + case UNITS_AMPERE_AC_PEAK: + return "Amps (AC Peak)"; + case UNITS_AMPERE_AC_RMS: + return "Amps (AC RMS)"; + case UNITS_HERTZ: + return "Hz"; + case UNITS_OHM: + return "ohms"; + case UNITS_WATT: + return "W"; + case UNITS_KILOGRAM: + return "kg"; + case UNITS_METERS: + return "m"; + case UNITS_METERS_SQUARED: + return "m^2"; + case UNITS_METERS_CUBED: + return "m^3"; + case UNITS_KILOGRAMMES_PER_METER_CUBED: + return "kg/m^3"; + case UNITS_METERS_PER_SECOND: + return "m/s"; + case UNITS_METERS_PER_SECOND_SQUARED: + return "m/s^2"; + case UNITS_NEWTON: + return "newton"; + case UNITS_JOULE: + return "joule"; + case UNITS_PASCAL: + return "pascal"; + case UNITS_SECOND: + return "second"; + case UNITS_DEGREE: + return "degree"; + case UNITS_STERADIAN: + return "steradian"; + case UNITS_CANDELA: + return "candela"; + case UNITS_LUMEN: + return "lumen"; + case UNITS_LUX: + return "lux"; + case UNITS_IRE: + return "ire"; + case UNITS_BYTE: + return "bytes"; + default: + stringstream str; + str << "Unknown, was " << static_cast(unit); + return str.str(); + } +} +} // rdm +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/RDMTester.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMTester.cpp new file mode 100644 index 0000000..c59eee0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/RDMTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * RDMTester.h + * Runs all the RDM tests + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rdm/UIDTest.cpp b/open-lighting-architecture/ola-0.8.4/common/rdm/UIDTest.cpp new file mode 100644 index 0000000..4df44a4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rdm/UIDTest.cpp @@ -0,0 +1,179 @@ +/* + * 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 Library 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. + * + * UIDTest.cpp + * Test fixture for the UID classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" + +using std::string; +using ola::rdm::UID; +using ola::rdm::UIDSet; + +class UIDTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(UIDTest); + CPPUNIT_TEST(testUID); + CPPUNIT_TEST(testUIDSet); + CPPUNIT_TEST(testUIDParse); + CPPUNIT_TEST_SUITE_END(); + + public: + void testUID(); + void testUIDSet(); + void testUIDParse(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(UIDTest); + + +/* + * Test the UIDs work. + */ +void UIDTest::testUID() { + UID uid(1, 2); + UID uid2 = uid; + CPPUNIT_ASSERT_EQUAL(uid, uid2); + CPPUNIT_ASSERT(!(uid != uid2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1, uid.ManufacturerId()); + CPPUNIT_ASSERT_EQUAL((uint32_t) 2, uid.DeviceId()); + + UID uid3(2, 10); + CPPUNIT_ASSERT(uid != uid3); + CPPUNIT_ASSERT(uid < uid3); + CPPUNIT_ASSERT_EQUAL((uint16_t) 2, uid3.ManufacturerId()); + CPPUNIT_ASSERT_EQUAL((uint32_t) 10, uid3.DeviceId()); + + // ToString + CPPUNIT_ASSERT_EQUAL(string("0001:00000002"), uid.ToString()); + CPPUNIT_ASSERT_EQUAL(string("0002:0000000a"), uid3.ToString()); + + UID all_devices = UID::AllDevices(); + UID manufacturer_devices = UID::AllManufactureDevices(0x52); + CPPUNIT_ASSERT_EQUAL(string("ffff:ffffffff"), all_devices.ToString()); + CPPUNIT_ASSERT_EQUAL(string("0052:ffffffff"), + manufacturer_devices.ToString()); + CPPUNIT_ASSERT_EQUAL(all_devices.ManufacturerId(), + static_cast(0xffff)); + CPPUNIT_ASSERT_EQUAL(all_devices.DeviceId(), + static_cast(0xffffffff)); + CPPUNIT_ASSERT_EQUAL(manufacturer_devices.ManufacturerId(), + static_cast(0x0052)); + CPPUNIT_ASSERT_EQUAL(manufacturer_devices.DeviceId(), + static_cast(0xffffffff)); + CPPUNIT_ASSERT(all_devices.IsBroadcast()); + CPPUNIT_ASSERT(manufacturer_devices.IsBroadcast()); + + // now test the packing & unpacking + unsigned int buffer_size = UID::UID_SIZE; + uint8_t *buffer = new uint8_t[buffer_size]; + CPPUNIT_ASSERT(uid.Pack(buffer, buffer_size)); + + uint8_t expected[] = {0, 1, 0, 0, 0, 2}; + CPPUNIT_ASSERT(0 == memcmp(expected, buffer, buffer_size)); + UID unpacked_uid1(buffer); + CPPUNIT_ASSERT_EQUAL(uid, unpacked_uid1); + + CPPUNIT_ASSERT(uid3.Pack(buffer, buffer_size)); + uint8_t expected2[] = {0, 2, 0, 0, 0, 0x0a}; + CPPUNIT_ASSERT(0 == memcmp(expected2, buffer, buffer_size)); + UID unpacked_uid2(buffer); + CPPUNIT_ASSERT_EQUAL(uid3, unpacked_uid2); + + delete[] buffer; +} + +/* + * Test the UIDSet + */ +void UIDTest::testUIDSet() { + UIDSet set1; + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, set1.Size()); + + UID uid(1, 2); + UID uid2(2, 10); + set1.AddUID(uid); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, set1.Size()); + CPPUNIT_ASSERT_EQUAL(string("0001:00000002"), set1.ToString()); + CPPUNIT_ASSERT(set1.Contains(uid)); + CPPUNIT_ASSERT(!set1.Contains(uid2)); + set1.AddUID(uid); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, set1.Size()); + + set1.AddUID(uid2); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, set1.Size()); + CPPUNIT_ASSERT_EQUAL(string("0001:00000002,0002:0000000a"), set1.ToString()); + CPPUNIT_ASSERT(set1.Contains(uid)); + CPPUNIT_ASSERT(set1.Contains(uid2)); + + UIDSet set2(set1); + CPPUNIT_ASSERT_EQUAL(set1, set2); + UIDSet set3; + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, set3.Size()); + set3 = set2; + CPPUNIT_ASSERT_EQUAL(set1, set2); + + set3.RemoveUID(uid2); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, set3.Size()); + CPPUNIT_ASSERT_EQUAL(string("0001:00000002"), set3.ToString()); + + UIDSet difference = set1.SetDifference(set3); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, difference.Size()); + CPPUNIT_ASSERT(set1.Contains(uid)); + CPPUNIT_ASSERT(set1.Contains(uid2)); + + difference = set3.SetDifference(set1); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, difference.Size()); +} + + +/* + * Test UID parsing + */ +void UIDTest::testUIDParse() { + UID *uid = UID::FromString("ffff:00000000"); + CPPUNIT_ASSERT(uid); + CPPUNIT_ASSERT_EQUAL(uid->ManufacturerId(), static_cast(0xffff)); + CPPUNIT_ASSERT_EQUAL(uid->DeviceId(), static_cast(0x00)); + CPPUNIT_ASSERT_EQUAL(uid->ToString(), string("ffff:00000000")); + delete uid; + + uid = UID::FromString("1234:567890ab"); + CPPUNIT_ASSERT(uid); + CPPUNIT_ASSERT_EQUAL(uid->ManufacturerId(), static_cast(0x1234)); + CPPUNIT_ASSERT_EQUAL(uid->DeviceId(), static_cast(0x567890ab)); + CPPUNIT_ASSERT_EQUAL(uid->ToString(), string("1234:567890ab")); + delete uid; + + uid = UID::FromString("abcd:ef123456"); + CPPUNIT_ASSERT(uid); + CPPUNIT_ASSERT_EQUAL(uid->ManufacturerId(), static_cast(0xabcd)); + CPPUNIT_ASSERT_EQUAL(uid->DeviceId(), static_cast(0xef123456)); + CPPUNIT_ASSERT_EQUAL(uid->ToString(), string("abcd:ef123456")); + delete uid; + + CPPUNIT_ASSERT(!UID::FromString("")); + CPPUNIT_ASSERT(!UID::FromString(":")); + CPPUNIT_ASSERT(!UID::FromString("0:0")); + CPPUNIT_ASSERT(!UID::FromString(":123456")); + CPPUNIT_ASSERT(!UID::FromString(":123456")); + CPPUNIT_ASSERT(!UID::FromString("abcd:123456")); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.am new file mode 100644 index 0000000..efd3af6 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.am @@ -0,0 +1,36 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = libstreamrpcchannel.la +libstreamrpcchannel_la_SOURCES = StreamRpcChannel.cpp SimpleRpcController.cpp +nodist_libstreamrpcchannel_la_SOURCES = Rpc.pb.cc + +EXTRA_DIST = Rpc.proto TestService.proto SimpleRpcController.h \ + StreamRpcChannel.h + +BUILT_SOURCES = Rpc.pb.cc Rpc.pb.h TestService.pb.cc TestService.pb.h + +Rpc.pb.cc Rpc.pb.h: Rpc.proto + $(PROTOC) --cpp_out ./ Rpc.proto + +TestService.pb.cc TestService.pb.h: TestService.proto + $(PROTOC) --cpp_out ./ TestService.proto + +TESTS = RpcTester +check_PROGRAMS = $(TESTS) +RpcTester_SOURCES = RpcTester.cpp RpcControllerTest.cpp\ + StreamRpcChannelTest.cpp StreamRpcHeaderTest.cpp +nodist_RpcTester_SOURCES = TestService.pb.cc +RpcTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +RpcTester_LDFLAGS = $(CPPUNIT_LIBS) -lprotobuf +RpcTester_LDADD = ./libstreamrpcchannel.la \ + ../export_map/libolaexportmap.la \ + ../logging/liblogging.la \ + ../network/libolanetwork.la \ + ../utils/libolautils.la + +clean-local: + rm -f *.pb.{h,cc} + +# this has the problem that it doesn't get rebuilt if a dependency changes. +../network/libnetwork.la: + cd ../network && $(MAKE) $(AM_MAKEFLAGS) libnetwork.la diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.in new file mode 100644 index 0000000..c2e1265 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/Makefile.in @@ -0,0 +1,700 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = RpcTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/rpc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libstreamrpcchannel_la_LIBADD = +am_libstreamrpcchannel_la_OBJECTS = StreamRpcChannel.lo \ + SimpleRpcController.lo +nodist_libstreamrpcchannel_la_OBJECTS = Rpc.pb.lo +libstreamrpcchannel_la_OBJECTS = $(am_libstreamrpcchannel_la_OBJECTS) \ + $(nodist_libstreamrpcchannel_la_OBJECTS) +am__EXEEXT_1 = RpcTester$(EXEEXT) +am_RpcTester_OBJECTS = RpcTester-RpcTester.$(OBJEXT) \ + RpcTester-RpcControllerTest.$(OBJEXT) \ + RpcTester-StreamRpcChannelTest.$(OBJEXT) \ + RpcTester-StreamRpcHeaderTest.$(OBJEXT) +nodist_RpcTester_OBJECTS = RpcTester-TestService.pb.$(OBJEXT) +RpcTester_OBJECTS = $(am_RpcTester_OBJECTS) \ + $(nodist_RpcTester_OBJECTS) +RpcTester_DEPENDENCIES = ./libstreamrpcchannel.la \ + ../export_map/libolaexportmap.la ../logging/liblogging.la \ + ../network/libolanetwork.la ../utils/libolautils.la +RpcTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(RpcTester_CXXFLAGS) \ + $(CXXFLAGS) $(RpcTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libstreamrpcchannel_la_SOURCES) \ + $(nodist_libstreamrpcchannel_la_SOURCES) $(RpcTester_SOURCES) \ + $(nodist_RpcTester_SOURCES) +DIST_SOURCES = $(libstreamrpcchannel_la_SOURCES) $(RpcTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libstreamrpcchannel.la +libstreamrpcchannel_la_SOURCES = StreamRpcChannel.cpp SimpleRpcController.cpp +nodist_libstreamrpcchannel_la_SOURCES = Rpc.pb.cc +EXTRA_DIST = Rpc.proto TestService.proto SimpleRpcController.h \ + StreamRpcChannel.h + +BUILT_SOURCES = Rpc.pb.cc Rpc.pb.h TestService.pb.cc TestService.pb.h +RpcTester_SOURCES = RpcTester.cpp RpcControllerTest.cpp\ + StreamRpcChannelTest.cpp StreamRpcHeaderTest.cpp + +nodist_RpcTester_SOURCES = TestService.pb.cc +RpcTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +RpcTester_LDFLAGS = $(CPPUNIT_LIBS) -lprotobuf +RpcTester_LDADD = ./libstreamrpcchannel.la \ + ../export_map/libolaexportmap.la \ + ../logging/liblogging.la \ + ../network/libolanetwork.la \ + ../utils/libolautils.la + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cc .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/rpc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/rpc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libstreamrpcchannel.la: $(libstreamrpcchannel_la_OBJECTS) $(libstreamrpcchannel_la_DEPENDENCIES) + $(CXXLINK) $(libstreamrpcchannel_la_OBJECTS) $(libstreamrpcchannel_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +RpcTester$(EXEEXT): $(RpcTester_OBJECTS) $(RpcTester_DEPENDENCIES) + @rm -f RpcTester$(EXEEXT) + $(RpcTester_LINK) $(RpcTester_OBJECTS) $(RpcTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Rpc.pb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RpcTester-RpcControllerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RpcTester-RpcTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RpcTester-StreamRpcChannelTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RpcTester-StreamRpcHeaderTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RpcTester-TestService.pb.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SimpleRpcController.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StreamRpcChannel.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +RpcTester-RpcTester.o: RpcTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-RpcTester.o -MD -MP -MF $(DEPDIR)/RpcTester-RpcTester.Tpo -c -o RpcTester-RpcTester.o `test -f 'RpcTester.cpp' || echo '$(srcdir)/'`RpcTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-RpcTester.Tpo $(DEPDIR)/RpcTester-RpcTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RpcTester.cpp' object='RpcTester-RpcTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-RpcTester.o `test -f 'RpcTester.cpp' || echo '$(srcdir)/'`RpcTester.cpp + +RpcTester-RpcTester.obj: RpcTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-RpcTester.obj -MD -MP -MF $(DEPDIR)/RpcTester-RpcTester.Tpo -c -o RpcTester-RpcTester.obj `if test -f 'RpcTester.cpp'; then $(CYGPATH_W) 'RpcTester.cpp'; else $(CYGPATH_W) '$(srcdir)/RpcTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-RpcTester.Tpo $(DEPDIR)/RpcTester-RpcTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RpcTester.cpp' object='RpcTester-RpcTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-RpcTester.obj `if test -f 'RpcTester.cpp'; then $(CYGPATH_W) 'RpcTester.cpp'; else $(CYGPATH_W) '$(srcdir)/RpcTester.cpp'; fi` + +RpcTester-RpcControllerTest.o: RpcControllerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-RpcControllerTest.o -MD -MP -MF $(DEPDIR)/RpcTester-RpcControllerTest.Tpo -c -o RpcTester-RpcControllerTest.o `test -f 'RpcControllerTest.cpp' || echo '$(srcdir)/'`RpcControllerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-RpcControllerTest.Tpo $(DEPDIR)/RpcTester-RpcControllerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RpcControllerTest.cpp' object='RpcTester-RpcControllerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-RpcControllerTest.o `test -f 'RpcControllerTest.cpp' || echo '$(srcdir)/'`RpcControllerTest.cpp + +RpcTester-RpcControllerTest.obj: RpcControllerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-RpcControllerTest.obj -MD -MP -MF $(DEPDIR)/RpcTester-RpcControllerTest.Tpo -c -o RpcTester-RpcControllerTest.obj `if test -f 'RpcControllerTest.cpp'; then $(CYGPATH_W) 'RpcControllerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RpcControllerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-RpcControllerTest.Tpo $(DEPDIR)/RpcTester-RpcControllerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RpcControllerTest.cpp' object='RpcTester-RpcControllerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-RpcControllerTest.obj `if test -f 'RpcControllerTest.cpp'; then $(CYGPATH_W) 'RpcControllerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RpcControllerTest.cpp'; fi` + +RpcTester-StreamRpcChannelTest.o: StreamRpcChannelTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-StreamRpcChannelTest.o -MD -MP -MF $(DEPDIR)/RpcTester-StreamRpcChannelTest.Tpo -c -o RpcTester-StreamRpcChannelTest.o `test -f 'StreamRpcChannelTest.cpp' || echo '$(srcdir)/'`StreamRpcChannelTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-StreamRpcChannelTest.Tpo $(DEPDIR)/RpcTester-StreamRpcChannelTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamRpcChannelTest.cpp' object='RpcTester-StreamRpcChannelTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-StreamRpcChannelTest.o `test -f 'StreamRpcChannelTest.cpp' || echo '$(srcdir)/'`StreamRpcChannelTest.cpp + +RpcTester-StreamRpcChannelTest.obj: StreamRpcChannelTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-StreamRpcChannelTest.obj -MD -MP -MF $(DEPDIR)/RpcTester-StreamRpcChannelTest.Tpo -c -o RpcTester-StreamRpcChannelTest.obj `if test -f 'StreamRpcChannelTest.cpp'; then $(CYGPATH_W) 'StreamRpcChannelTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamRpcChannelTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-StreamRpcChannelTest.Tpo $(DEPDIR)/RpcTester-StreamRpcChannelTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamRpcChannelTest.cpp' object='RpcTester-StreamRpcChannelTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-StreamRpcChannelTest.obj `if test -f 'StreamRpcChannelTest.cpp'; then $(CYGPATH_W) 'StreamRpcChannelTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamRpcChannelTest.cpp'; fi` + +RpcTester-StreamRpcHeaderTest.o: StreamRpcHeaderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-StreamRpcHeaderTest.o -MD -MP -MF $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Tpo -c -o RpcTester-StreamRpcHeaderTest.o `test -f 'StreamRpcHeaderTest.cpp' || echo '$(srcdir)/'`StreamRpcHeaderTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Tpo $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamRpcHeaderTest.cpp' object='RpcTester-StreamRpcHeaderTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-StreamRpcHeaderTest.o `test -f 'StreamRpcHeaderTest.cpp' || echo '$(srcdir)/'`StreamRpcHeaderTest.cpp + +RpcTester-StreamRpcHeaderTest.obj: StreamRpcHeaderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-StreamRpcHeaderTest.obj -MD -MP -MF $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Tpo -c -o RpcTester-StreamRpcHeaderTest.obj `if test -f 'StreamRpcHeaderTest.cpp'; then $(CYGPATH_W) 'StreamRpcHeaderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamRpcHeaderTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Tpo $(DEPDIR)/RpcTester-StreamRpcHeaderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamRpcHeaderTest.cpp' object='RpcTester-StreamRpcHeaderTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-StreamRpcHeaderTest.obj `if test -f 'StreamRpcHeaderTest.cpp'; then $(CYGPATH_W) 'StreamRpcHeaderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamRpcHeaderTest.cpp'; fi` + +RpcTester-TestService.pb.o: TestService.pb.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-TestService.pb.o -MD -MP -MF $(DEPDIR)/RpcTester-TestService.pb.Tpo -c -o RpcTester-TestService.pb.o `test -f 'TestService.pb.cc' || echo '$(srcdir)/'`TestService.pb.cc +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-TestService.pb.Tpo $(DEPDIR)/RpcTester-TestService.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TestService.pb.cc' object='RpcTester-TestService.pb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-TestService.pb.o `test -f 'TestService.pb.cc' || echo '$(srcdir)/'`TestService.pb.cc + +RpcTester-TestService.pb.obj: TestService.pb.cc +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -MT RpcTester-TestService.pb.obj -MD -MP -MF $(DEPDIR)/RpcTester-TestService.pb.Tpo -c -o RpcTester-TestService.pb.obj `if test -f 'TestService.pb.cc'; then $(CYGPATH_W) 'TestService.pb.cc'; else $(CYGPATH_W) '$(srcdir)/TestService.pb.cc'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/RpcTester-TestService.pb.Tpo $(DEPDIR)/RpcTester-TestService.pb.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TestService.pb.cc' object='RpcTester-TestService.pb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(RpcTester_CXXFLAGS) $(CXXFLAGS) -c -o RpcTester-TestService.pb.obj `if test -f 'TestService.pb.cc'; then $(CYGPATH_W) 'TestService.pb.cc'; else $(CYGPATH_W) '$(srcdir)/TestService.pb.cc'; fi` + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool clean-local \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +Rpc.pb.cc Rpc.pb.h: Rpc.proto + $(PROTOC) --cpp_out ./ Rpc.proto + +TestService.pb.cc TestService.pb.h: TestService.proto + $(PROTOC) --cpp_out ./ TestService.proto + +clean-local: + rm -f *.pb.{h,cc} + +# this has the problem that it doesn't get rebuilt if a dependency changes. +../network/libnetwork.la: + cd ../network && $(MAKE) $(AM_MAKEFLAGS) libnetwork.la +# 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/open-lighting-architecture/ola-0.8.4/common/rpc/Rpc.proto b/open-lighting-architecture/ola-0.8.4/common/rpc/Rpc.proto new file mode 100644 index 0000000..44a6508 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/Rpc.proto @@ -0,0 +1,46 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Rpc.proto + * Defines the protocol buffers used in the underlying RPC implementation. + * Copyright (C) 2005 - 2008 Simon Newton + */ + +/* + * Based on, but not guarenteed to be the same as the specification here: + * http://protorpc.likbilen.com/Protorpcdocprotobuf.html + */ + +package ola.rpc; + +enum Type { + REQUEST = 1; + RESPONSE = 2; + RESPONSE_CANCEL = 3; + RESPONSE_FAILED = 4; + RESPONSE_NOT_IMPLEMENTED = 5; + DISCONNECT = 6; + DESCRIPTOR_REQUEST = 7; // not implemented + DESCRIPTOR_RESPONSE = 8; // not implemented + REQUEST_CANCEL = 9; + STREAM_REQUEST = 10; // a request that we don't expect a response for +}; + +message RpcMessage { + required Type type = 1; + optional uint32 id = 2; + optional string name = 3; + optional bytes buffer = 4; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/RpcControllerTest.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/RpcControllerTest.cpp new file mode 100644 index 0000000..e8cb68f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/RpcControllerTest.cpp @@ -0,0 +1,82 @@ +/* + * 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 Library 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. + * + * RpcContollerTest.cpp + * Test fixture for the SimpleRpcController class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include "common/rpc/SimpleRpcController.h" + +using std::string; +using ola::rpc::SimpleRpcController; +using google::protobuf::Closure; +using google::protobuf::NewCallback; + +class RpcControllerTest : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RpcControllerTest); + CPPUNIT_TEST(testFailed); + CPPUNIT_TEST(testCancel); + CPPUNIT_TEST_SUITE_END(); + + public: + void testFailed(); + void testCancel(); + + private: + void Callback(); + bool m_callback_run; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(RpcControllerTest); + +void RpcControllerTest::testFailed() { + SimpleRpcController controller; + string failure = "Failed"; + controller.SetFailed(failure); + CPPUNIT_ASSERT(controller.Failed()); + CPPUNIT_ASSERT_EQUAL(controller.ErrorText(), failure); + controller.Reset(); + CPPUNIT_ASSERT(!controller.Failed()); +} + +void RpcControllerTest::Callback() { + m_callback_run = true; +} + +void RpcControllerTest::testCancel() { + SimpleRpcController controller; + controller.StartCancel(); + CPPUNIT_ASSERT(controller.IsCanceled()); + + controller.Reset(); + CPPUNIT_ASSERT(!controller.IsCanceled()); + + Closure *callback = NewCallback(this, &RpcControllerTest::Callback); + m_callback_run = false; + controller.NotifyOnCancel(callback); + controller.StartCancel(); + CPPUNIT_ASSERT(m_callback_run); + + controller.Reset(); + CPPUNIT_ASSERT(!controller.IsCanceled()); + m_callback_run = false; + controller.StartCancel(); + CPPUNIT_ASSERT(!m_callback_run); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/RpcTester.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/RpcTester.cpp new file mode 100644 index 0000000..1468a99 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/RpcTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * RpcTester.h + * Runs all the RPC tests + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.cpp new file mode 100644 index 0000000..440d127 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.cpp @@ -0,0 +1,55 @@ +/* + * 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 Library 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. + * + * SimpleRpcController.cpp + * The Simple RPC Controller + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include "ola/Logging.h" +#include "common/rpc/SimpleRpcController.h" + +namespace ola { +namespace rpc { + +SimpleRpcController::SimpleRpcController() + : m_failed(false), + m_cancelled(false), + m_error_text(""), + m_callback(NULL) { +} + +void SimpleRpcController::Reset() { + m_failed = false; + m_cancelled = false; + if (m_callback) + OLA_FATAL << "calling reset() while an rpc is in progress, we're " << + "leaking memory!"; + m_callback = NULL; +} + +void SimpleRpcController::StartCancel() { + m_cancelled = true; + if (m_callback) + m_callback->Run(); +} + +void SimpleRpcController::SetFailed(const std::string &reason) { + m_failed = true; + m_error_text = reason; +} +} // rpc +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.h b/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.h new file mode 100644 index 0000000..ea1e19c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/SimpleRpcController.h @@ -0,0 +1,55 @@ +/* + * 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 Library 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. + * + * SimpleRpcController.h + * Interface for a basic RPC Controller + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef COMMON_RPC_SIMPLERPCCONTROLLER_H_ +#define COMMON_RPC_SIMPLERPCCONTROLLER_H_ + +#include +#include + +namespace ola { +namespace rpc { + +class SimpleRpcController: public google::protobuf::RpcController { + public: + SimpleRpcController(); + ~SimpleRpcController() {} + + void Reset(); + bool Failed() const { return m_failed; } + std::string ErrorText() const { return m_error_text; } + void StartCancel(); + + void SetFailed(const std::string &reason); + bool IsCanceled() const { return m_cancelled; } + void NotifyOnCancel(google::protobuf::Closure *callback) { + m_callback = callback; + } + + private: + bool m_failed; + bool m_cancelled; + std::string m_error_text; + google::protobuf::Closure *m_callback; +}; +} // rpc +} // ola + +#endif // COMMON_RPC_SIMPLERPCCONTROLLER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.cpp new file mode 100644 index 0000000..c7bcd13 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.cpp @@ -0,0 +1,607 @@ +/* + * 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 Library 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. + * + * StreamRpcChannel.cpp + * Interface for the UDP RPC Channel + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + +#include "common/rpc/Rpc.pb.h" +#include "common/rpc/SimpleRpcController.h" +#include "common/rpc/StreamRpcChannel.h" +#include "ola/Closure.h" +#include "ola/Logging.h" + + +namespace ola { +namespace rpc { + +using google::protobuf::ServiceDescriptor; + +const char StreamRpcChannel::K_RPC_RECEIVED_TYPE_VAR[] = "rpc-received-type"; +const char StreamRpcChannel::K_RPC_RECEIVED_VAR[] = "rpc-received"; +const char StreamRpcChannel::K_RPC_SENT_ERROR_VAR[] = "rpc-send-errors"; +const char StreamRpcChannel::K_RPC_SENT_VAR[] = "rpc-sent"; +const char StreamRpcChannel::STREAMING_NO_RESPONSE[] = "STREAMING_NO_RESPONSE"; + +StreamRpcChannel::StreamRpcChannel(Service *service, + ola::network::ConnectedSocket *socket, + ExportMap *export_map) + : m_service(service), + m_on_close(NULL), + m_socket(socket), + m_seq(0), + m_buffer(NULL), + m_buffer_size(0), + m_expected_size(0), + m_current_size(0), + m_export_map(export_map), + m_recv_type_map(NULL) { + socket->SetOnData(NewClosure(this, &StreamRpcChannel::SocketReady)); + + // init the counters + const char *vars[] = { + K_RPC_RECEIVED_VAR, + K_RPC_SENT_ERROR_VAR, + K_RPC_SENT_VAR, + }; + + if (m_export_map) { + for (unsigned int i = 0; i < sizeof(vars) / sizeof(vars[0]); ++i) + m_export_map->GetCounterVar(string(vars[i])); + m_recv_type_map = m_export_map->GetUIntMapVar(K_RPC_RECEIVED_TYPE_VAR, + "type"); + } +} + + +StreamRpcChannel::~StreamRpcChannel() { + free(m_buffer); +} + + +/* + * Receive a message for this RPCChannel. Called when data is available on the + * socket. + */ +void StreamRpcChannel::SocketReady() { + if (!m_expected_size) { + // this is a new msg + unsigned int version; + if (ReadHeader(&version, &m_expected_size) < 0) + return; + + if (!m_expected_size) + return; + + if (version != PROTOCOL_VERSION) { + OLA_WARN << "protocol mismatch " << version << " != " << + PROTOCOL_VERSION; + return; + } + m_current_size = 0; + m_buffer_size = AllocateMsgBuffer(m_expected_size); + + if (m_buffer_size < m_expected_size) { + OLA_WARN << "buffer size to small " << m_buffer_size << " < " << + m_expected_size; + return; + } + } + + unsigned int data_read; + if (m_socket->Receive(m_buffer + m_current_size, + m_expected_size - m_current_size, + data_read) < 0) { + OLA_WARN << "something went wrong in socket recv\n"; + return; + } + + m_current_size += data_read; + + if (m_current_size == m_expected_size) { + // we've got all of this message so parse it. + if (!HandleNewMsg(m_buffer, m_expected_size)) { + // this probably means we've messed the framing up, close the channel + OLA_WARN << "Errors detected on RPC channel, closing"; + m_socket->Close(); + } + m_expected_size = 0; + } + return; +} + + +/* + * Set the Closure to be called if a write on this channel fails. This is + * different from the Socket on close handler which is called when reads hit + * EOF/ + */ +void StreamRpcChannel::SetOnClose(SingleUseClosure *closure) { + if (closure != m_on_close) { + delete m_on_close; + m_on_close = closure; + } +} + + +/* + * Call a method with the given request and reply + * TODO(simonn): reduce the number of copies here + */ +void StreamRpcChannel::CallMethod( + const MethodDescriptor *method, + RpcController *controller, + const Message *request, + Message *reply, + google::protobuf::Closure *done) { + string output; + RpcMessage message; + bool is_streaming = false; + + // Streaming methods are those with a reply set to STREAMING_NO_RESPONSE and + // no controller, request or closure provided + if (method->output_type()->name() == STREAMING_NO_RESPONSE) { + if (controller || reply || done) { + OLA_FATAL << "Calling streaming method " << method->name() << + " but a controller, reply or closure in non-NULL"; + return; + } + is_streaming = true; + } + + message.set_type(is_streaming ? STREAM_REQUEST : REQUEST); + message.set_id(m_seq++); + message.set_name(method->name()); + + request->SerializeToString(&output); + message.set_buffer(output); + bool r = SendMsg(&message); + + if (is_streaming) + return; + + if (!r) { + // send failed, call the handler now + controller->SetFailed("Failed to send request"); + done->Run(); + return; + } + + OutstandingResponse *response = GetOutstandingResponse(message.id()); + if (response) { + // fail any outstanding response with the same id + OLA_WARN << "response " << response->id << " already pending, failing " << + "now"; + response->controller->SetFailed("Duplicate request found"); + InvokeCallbackAndCleanup(response); + } + + response = new OutstandingResponse(); + response->id = message.id(); + response->controller = controller; + response->callback = done; + response->reply = reply; + m_responses[message.id()] = response; +} + + +/* + * Called when a response is ready. + */ +void StreamRpcChannel::RequestComplete(OutstandingRequest *request) { + string output; + RpcMessage message; + + if (request->controller->Failed()) { + SendRequestFailed(request); + return; + } + + message.set_type(RESPONSE); + message.set_id(request->id); + request->response->SerializeToString(&output); + message.set_buffer(output); + SendMsg(&message); + DeleteOutstandingRequest(request); +} + + +// private +//----------------------------------------------------------------------------- + +/* + * Write an RpcMessage to the write socket. + */ +bool StreamRpcChannel::SendMsg(RpcMessage *msg) { + if (m_socket->ReadDescriptor() == ola::network::Socket::INVALID_SOCKET) { + OLA_WARN << "RPC Socket closed, not sending messages"; + return false; + } + + string output; + msg->SerializeToString(&output); + int length = output.length(); + uint32_t header; + StreamRpcHeader::EncodeHeader(&header, PROTOCOL_VERSION, length); + + ssize_t ret = m_socket->Send(reinterpret_cast(&header), + sizeof(header)); + ret = m_socket->Send(reinterpret_cast(output.data()), + length); + + if (ret != length) { + if (ret == -1) + OLA_WARN << "Send failed " << strerror(errno); + else + OLA_WARN << "Failed to send full datagram, closing channel"; + // At the point framing is screwed and we should shut the channel down + m_socket->Close(); + if (m_on_close) + m_on_close->Run(); + + if (m_export_map) + (*m_export_map->GetCounterVar(K_RPC_SENT_ERROR_VAR))++; + return false; + } + + if (m_export_map) + (*m_export_map->GetCounterVar(K_RPC_SENT_VAR))++; + return true; +} + + +/* + * Allocate an incomming message buffer + * @param size the size of the new buffer to allocate + * @returns the size of the new buffer + */ +int StreamRpcChannel::AllocateMsgBuffer(unsigned int size) { + unsigned int requested_size = size; + uint8_t *new_buffer; + + if (size < m_buffer_size) + return size; + + if (m_buffer_size == 0 && size < INITIAL_BUFFER_SIZE) + requested_size = INITIAL_BUFFER_SIZE; + + if (requested_size > MAX_BUFFER_SIZE) + return m_buffer_size; + + new_buffer = static_cast(realloc(m_buffer, requested_size)); + if (new_buffer < 0) + return m_buffer_size; + + m_buffer = new_buffer; + m_buffer_size = requested_size; + return requested_size; +} + + +/* + * Read 4 bytes and decode the header fields. + * @returns: -1 if there is no data is available, version and size are 0 + */ +int StreamRpcChannel::ReadHeader(unsigned int *version, + unsigned int *size) const { + uint32_t header; + unsigned int data_read = 0; + *version = *size = 0; + + if (m_socket->Receive(reinterpret_cast(&header), + sizeof(header), data_read)) { + OLA_WARN << "read header error: " << strerror(errno); + return -1; + } + + if (!data_read) + return 0; + + StreamRpcHeader::DecodeHeader(header, version, size); + return 0; +} + + +/* + * Parse a new message and handle it. + */ +bool StreamRpcChannel::HandleNewMsg(uint8_t *data, unsigned int size) { + RpcMessage msg; + if (!msg.ParseFromArray(data, size)) { + OLA_WARN << "Failed to parse RPC"; + return false; + } + + if (m_export_map) + (*m_export_map->GetCounterVar(K_RPC_RECEIVED_VAR))++; + + switch (msg.type()) { + case REQUEST: + if (m_recv_type_map) + (*m_recv_type_map)["request"]++; + HandleRequest(&msg); + break; + case RESPONSE: + if (m_recv_type_map) + (*m_recv_type_map)["response"]++; + HandleResponse(&msg); + break; + case RESPONSE_CANCEL: + if (m_recv_type_map) + (*m_recv_type_map)["cancelled"]++; + HandleCanceledResponse(&msg); + break; + case RESPONSE_FAILED: + if (m_recv_type_map) + (*m_recv_type_map)["failed"]++; + HandleFailedResponse(&msg); + break; + case RESPONSE_NOT_IMPLEMENTED: + if (m_recv_type_map) + (*m_recv_type_map)["not-implemented"]++; + HandleNotImplemented(&msg); + break; + case STREAM_REQUEST: + if (m_recv_type_map) + (*m_recv_type_map)["stream_request"]++; + HandleStreamRequest(&msg); + break; + default: + OLA_WARN << "not sure of msg type " << msg.type(); + break; + } + return true; +} + + +/* + * Handle a new RPC method call. + */ +void StreamRpcChannel::HandleRequest(RpcMessage *msg) { + if (!m_service) { + OLA_WARN << "no service registered"; + return; + } + + const ServiceDescriptor *service = m_service->GetDescriptor(); + if (!service) { + OLA_WARN << "failed to get service descriptor"; + return; + } + const MethodDescriptor *method = service->FindMethodByName(msg->name()); + if (!method) { + OLA_WARN << "failed to get method descriptor"; + SendNotImplemented(msg->id()); + return; + } + + Message* request_pb = m_service->GetRequestPrototype(method).New(); + Message* response_pb = m_service->GetResponsePrototype(method).New(); + + if (!request_pb || !response_pb) { + OLA_WARN << "failed to get request or response objects"; + return; + } + + if (!request_pb->ParseFromString(msg->buffer())) { + OLA_WARN << "parsing of request pb failed"; + return; + } + + OutstandingRequest *request = new OutstandingRequest(); + request->id = msg->id(); + request->controller = new SimpleRpcController(); + request->response = response_pb; + + if (m_requests.find(msg->id()) != m_requests.end()) { + OLA_WARN << "dup sequence number for request " << msg->id(); + SendRequestFailed(m_requests[msg->id()]); + } + + m_requests[msg->id()] = request; + google::protobuf::Closure *callback = NewCallback( + this, &StreamRpcChannel::RequestComplete, request); + m_service->CallMethod(method, request->controller, request_pb, response_pb, + callback); + delete request_pb; +} + + +/* + * Handle a streaming RPC call. This doesn't return any response to the client. + */ +void StreamRpcChannel::HandleStreamRequest(RpcMessage *msg) { + if (!m_service) { + OLA_WARN << "no service registered"; + return; + } + + const ServiceDescriptor *service = m_service->GetDescriptor(); + if (!service) { + OLA_WARN << "failed to get service descriptor"; + return; + } + const MethodDescriptor *method = service->FindMethodByName(msg->name()); + if (!method) { + OLA_WARN << "failed to get method descriptor"; + SendNotImplemented(msg->id()); + return; + } + + if (method->output_type()->name() != STREAMING_NO_RESPONSE) { + OLA_WARN << "Streaming request recieved for " << method->name() << + ", but the output type isn't STREAMING_NO_RESPONSE"; + return; + } + + Message* request_pb = m_service->GetRequestPrototype(method).New(); + + if (!request_pb) { + OLA_WARN << "failed to get request or response objects"; + return; + } + + if (!request_pb->ParseFromString(msg->buffer())) { + OLA_WARN << "parsing of request pb failed"; + return; + } + + m_service->CallMethod(method, NULL, request_pb, NULL, NULL); + delete request_pb; +} + + +// server side +/* + * Notify the caller that the request failed. + */ +void StreamRpcChannel::SendRequestFailed(OutstandingRequest *request) { + RpcMessage message; + message.set_type(RESPONSE_FAILED); + message.set_id(request->id); + message.set_buffer(request->controller->ErrorText()); + SendMsg(&message); + DeleteOutstandingRequest(request); +} + + +/* + * Sent if we get a request for a non-existant method. + */ +void StreamRpcChannel::SendNotImplemented(int msg_id) { + RpcMessage message; + message.set_type(RESPONSE_NOT_IMPLEMENTED); + message.set_id(msg_id); + SendMsg(&message); +} + + +/* + * Cleanup an outstanding request after the response has been returned + */ +void StreamRpcChannel::DeleteOutstandingRequest(OutstandingRequest *request) { + m_requests.erase(request->id); + delete request->controller; + delete request->response; + delete request; +} + + +// client side methods +/* + * Handle a RPC response by invoking the callback. + */ +void StreamRpcChannel::HandleResponse(RpcMessage *msg) { + OutstandingResponse *response = GetOutstandingResponse(msg->id()); + if (response) { + response->reply->ParseFromString(msg->buffer()); + InvokeCallbackAndCleanup(response); + } +} + + +/* + * Handle a RPC response by invoking the callback. + */ +void StreamRpcChannel::HandleFailedResponse(RpcMessage *msg) { + OutstandingResponse *response = GetOutstandingResponse(msg->id()); + if (response) { + response->controller->SetFailed(msg->buffer()); + InvokeCallbackAndCleanup(response); + } +} + + +/* + * Handle a RPC response by invoking the callback. + */ +void StreamRpcChannel::HandleCanceledResponse(RpcMessage *msg) { + OLA_INFO << "Received a canceled response"; + OutstandingResponse *response = GetOutstandingResponse(msg->id()); + if (response) { + response->controller->SetFailed(msg->buffer()); + InvokeCallbackAndCleanup(response); + } +} + + +/* + * Handle a NOT_IMPLEMENTED by invoking the callback. + */ +void StreamRpcChannel::HandleNotImplemented(RpcMessage *msg) { + OLA_INFO << "Received a non-implemented response"; + OutstandingResponse *response = GetOutstandingResponse(msg->id()); + if (response) { + response->controller->SetFailed("Not Implemented"); + InvokeCallbackAndCleanup(response); + } +} + + +/* + * Find the outstanding response with id msg_id. + */ +OutstandingResponse *StreamRpcChannel::GetOutstandingResponse(int msg_id) { + if (m_responses.find(msg_id) != m_responses.end()) { + return m_responses[msg_id]; + } + return NULL; +} + + +/* + * Run the callback for a request. + */ +void StreamRpcChannel::InvokeCallbackAndCleanup(OutstandingResponse *response) { + if (response) { + int id = response->id; + response->callback->Run(); + delete response; + m_responses.erase(id); + } +} + + +// StreamRpcHeader +//-------------------------------------------------------------- + +/** + * Encode a header + */ +void StreamRpcHeader::EncodeHeader(uint32_t *header, unsigned int version, + unsigned int size) { + *header = (version << 28) & VERSION_MASK; + *header |= size & SIZE_MASK; +} + + +/** + * Decode a header + */ +void StreamRpcHeader::DecodeHeader(uint32_t header, unsigned int *version, + unsigned int *size) { + *version = (header & VERSION_MASK) >> 28; + *size = header & SIZE_MASK; +} +} // rpc +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.h b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.h new file mode 100644 index 0000000..336b40d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannel.h @@ -0,0 +1,157 @@ +/* + * 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 Library 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. + * + * StreamRpcChannel.h + * Interface for the Stream RPC Channel + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef COMMON_RPC_STREAMRPCCHANNEL_H_ +#define COMMON_RPC_STREAMRPCCHANNEL_H_ + +#include +#include +#include +#include +#include +#include +#include "ola/ExportMap.h" + +namespace ola { +namespace rpc { + +using google::protobuf::Message; +using google::protobuf::MethodDescriptor; +using google::protobuf::RpcChannel; +using google::protobuf::RpcController; +using google::protobuf::Service; + +class RpcMessage; + +class OutstandingRequest { + /* + * These are requests on the server end that haven't completed yet. + */ + public: + OutstandingRequest() {} + ~OutstandingRequest() {} + + int id; + RpcController *controller; + Message *response; +}; + +class OutstandingResponse { + /* + * These are Requests on the client end that haven't completed yet. + */ + public: + OutstandingResponse() {} + ~OutstandingResponse() {} + + int id; + RpcController *controller; + google::protobuf::Closure *callback; + Message *reply; +}; + + +class StreamRpcHeader { + /* + * The first 4 bytes are the header which contains the RPC protocol version + * (this is separate from the protobuf version) and the size of the protobuf. + */ + public: + static void EncodeHeader(uint32_t *header, unsigned int version, + unsigned int size); + static void DecodeHeader(uint32_t header, unsigned int *version, + unsigned int *size); + private: + static const unsigned int VERSION_MASK = 0xf0000000; + static const unsigned int SIZE_MASK = 0x0fffffff; +}; + + +class StreamRpcChannel: public RpcChannel { + /* + * Implements a RpcChannel over a pipe or socket. + */ + public : + StreamRpcChannel(Service *service, + ola::network::ConnectedSocket *socket, + ExportMap *export_map = NULL); + ~StreamRpcChannel(); + + void SocketReady(); + void SetOnClose(SingleUseClosure *closure); + + void CallMethod( + const MethodDescriptor *method, + RpcController *controller, + const Message *request, + Message *response, + google::protobuf::Closure *done); + + void RequestComplete(OutstandingRequest *request); + void SetService(Service *service) { m_service = service; } + static const unsigned int PROTOCOL_VERSION = 1; + + private: + bool SendMsg(RpcMessage *msg); + int AllocateMsgBuffer(unsigned int size); + int ReadHeader(unsigned int *version, unsigned int *size) const; + bool HandleNewMsg(uint8_t *buffer, unsigned int size); + void HandleRequest(RpcMessage *msg); + void HandleStreamRequest(RpcMessage *msg); + + // server end + void SendRequestFailed(OutstandingRequest *request); + void SendNotImplemented(int msg_id); + void DeleteOutstandingRequest(OutstandingRequest *request); + + // client end + void HandleResponse(RpcMessage *msg); + void HandleFailedResponse(RpcMessage *msg); + void HandleCanceledResponse(RpcMessage *msg); + void HandleNotImplemented(RpcMessage *msg); + OutstandingResponse *GetOutstandingResponse(int msg_id); + void InvokeCallbackAndCleanup(OutstandingResponse *response); + + Service *m_service; // service to dispatch requests to + SingleUseClosure *m_on_close; + // the socket to read/write to. + class ola::network::ConnectedSocket *m_socket; + uint32_t m_seq; // sequence number + uint8_t *m_buffer; // buffer for incomming msgs + unsigned int m_buffer_size; // size of the buffer + unsigned int m_expected_size; // the total size of the current msg + unsigned int m_current_size; // the amount of data read for the current msg + __gnu_cxx::hash_map m_requests; + __gnu_cxx::hash_map m_responses; + ExportMap *m_export_map; + UIntMap *m_recv_type_map; + + static const char K_RPC_RECEIVED_TYPE_VAR[]; + static const char K_RPC_RECEIVED_VAR[]; + static const char K_RPC_SENT_ERROR_VAR[]; + static const char K_RPC_SENT_VAR[]; + static const char STREAMING_NO_RESPONSE[]; + static const unsigned int INITIAL_BUFFER_SIZE = 1 << 11; // 2k + static const unsigned int MAX_BUFFER_SIZE = 1 << 20; // 1M +}; +} // rpc +} // ola + +#endif // COMMON_RPC_STREAMRPCCHANNEL_H_ diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannelTest.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannelTest.cpp new file mode 100644 index 0000000..bff7f66 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcChannelTest.cpp @@ -0,0 +1,203 @@ +/* + * 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 Library 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. + * + * StreamRpcChannelTest.cpp + * Test fixture for the StreamRpcChannel class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "common/rpc/StreamRpcChannel.h" +#include "common/rpc/SimpleRpcController.h" +#include "common/rpc/TestService.pb.h" + +using google::protobuf::NewCallback; +using ola::network::LoopbackSocket; +using ola::network::SelectServer; +using ola::rpc::EchoReply; +using ola::rpc::EchoRequest; +using ola::rpc::STREAMING_NO_RESPONSE; +using ola::rpc::SimpleRpcController; +using ola::rpc::StreamRpcChannel; +using ola::rpc::TestService; +using ola::rpc::TestService_Stub; +using std::string; + +/* + * Our test implementation + */ +class TestServiceImpl: public TestService { + public: + explicit TestServiceImpl(SelectServer *ss): m_ss(ss) {} + ~TestServiceImpl() {} + + void Echo(::google::protobuf::RpcController* controller, + const EchoRequest* request, + EchoReply* response, + ::google::protobuf::Closure* done); + + void FailedEcho(::google::protobuf::RpcController* controller, + const EchoRequest* request, + EchoReply* response, + ::google::protobuf::Closure* done); + + void Stream(::google::protobuf::RpcController* controller, + const ::ola::rpc::EchoRequest* request, + STREAMING_NO_RESPONSE* response, + ::google::protobuf::Closure* done); + + private: + SelectServer *m_ss; +}; + + +class StreamRpcChannelTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(StreamRpcChannelTest); + CPPUNIT_TEST(testEcho); + CPPUNIT_TEST(testFailedEcho); + CPPUNIT_TEST(testStreamRequest); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testEcho(); + void testFailedEcho(); + void testStreamRequest(); + void EchoComplete(); + void FailedEchoComplete(); + + private: + int m_fd_pair[2]; + SimpleRpcController m_controller; + EchoRequest m_request; + EchoReply m_reply; + TestService_Stub *m_stub; + SelectServer m_ss; + TestServiceImpl *m_service; + StreamRpcChannel *m_channel; + LoopbackSocket *m_socket; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(StreamRpcChannelTest); + + +void TestServiceImpl::Echo(::google::protobuf::RpcController* controller, + const EchoRequest* request, + EchoReply* response, + ::google::protobuf::Closure* done) { + response->set_data(request->data()); + done->Run(); + (void) controller; + (void) request; +} + + +void TestServiceImpl::FailedEcho(::google::protobuf::RpcController* controller, + const EchoRequest* request, + EchoReply* response, + ::google::protobuf::Closure* done) { + controller->SetFailed("Error"); + done->Run(); + (void) request; + (void) response; +} + +void TestServiceImpl::Stream(::google::protobuf::RpcController* controller, + const ::ola::rpc::EchoRequest* request, + STREAMING_NO_RESPONSE* response, + ::google::protobuf::Closure* done) { + CPPUNIT_ASSERT(!controller); + CPPUNIT_ASSERT(!response); + CPPUNIT_ASSERT(!done); + CPPUNIT_ASSERT(request); + CPPUNIT_ASSERT_EQUAL(string("foo"), request->data()); + m_ss->Terminate(); +} + + +void StreamRpcChannelTest::setUp() { + m_socket = new LoopbackSocket(); + m_socket->Init(); + + m_service = new TestServiceImpl(&m_ss); + m_channel = new StreamRpcChannel(m_service, m_socket); + m_ss.AddSocket(m_socket); + m_stub = new TestService_Stub(m_channel); +} + + +void StreamRpcChannelTest::tearDown() { + m_ss.RemoveSocket(m_socket); + delete m_socket; + delete m_stub; + delete m_channel; + delete m_service; +} + + +void StreamRpcChannelTest::EchoComplete() { + m_ss.Terminate(); + CPPUNIT_ASSERT(!m_controller.Failed()); + CPPUNIT_ASSERT_EQUAL(m_reply.data(), m_request.data()); +} + + +void StreamRpcChannelTest::FailedEchoComplete() { + m_ss.Terminate(); + CPPUNIT_ASSERT(m_controller.Failed()); +} + + +/* + * Check that we can call the echo method in the TestServiceImpl. + */ +void StreamRpcChannelTest::testEcho() { + m_request.set_data("foo"); + m_stub->Echo(&m_controller, + &m_request, + &m_reply, + NewCallback(this, &StreamRpcChannelTest::EchoComplete)); + + m_ss.Run(); +} + + +/* + * Check that method that fail return correctly + */ +void StreamRpcChannelTest::testFailedEcho() { + m_request.set_data("foo"); + m_stub->FailedEcho( + &m_controller, + &m_request, + &m_reply, + NewCallback(this, &StreamRpcChannelTest::FailedEchoComplete)); + m_ss.Run(); +} + +/* + * Check stream requests work + */ +void StreamRpcChannelTest::testStreamRequest() { + m_request.set_data("foo"); + m_stub->Stream(NULL, &m_request, NULL, NULL); + m_ss.Run(); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcHeaderTest.cpp b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcHeaderTest.cpp new file mode 100644 index 0000000..96eac99 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/StreamRpcHeaderTest.cpp @@ -0,0 +1,57 @@ +/* + * 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 Library 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. + * + * StreamRpcChannelTest.cpp + * Test fixture for the StreamRpcChannel class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include "common/rpc/StreamRpcChannel.h" + +using ola::rpc::StreamRpcHeader; +using ola::rpc::StreamRpcChannel; + +class StreamRpcHeaderTest : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(StreamRpcHeaderTest); + CPPUNIT_TEST(testHeaderEncoding); + CPPUNIT_TEST_SUITE_END(); + + public: + void testHeaderEncoding(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(StreamRpcHeaderTest); + +void StreamRpcHeaderTest::testHeaderEncoding() { + /* + * Test we can encode and decode headers correctly. + */ + uint32_t header; + unsigned int size, version, o_size, o_version; + + size = 0; + version = 0; + StreamRpcHeader::EncodeHeader(&header, version, size); + StreamRpcHeader::DecodeHeader(header, &o_version, &o_size); + CPPUNIT_ASSERT_EQUAL(version, o_version); + + version = StreamRpcChannel::PROTOCOL_VERSION; + size = 24; + StreamRpcHeader::EncodeHeader(&header, version, size); + StreamRpcHeader::DecodeHeader(header, &o_version, &o_size); + CPPUNIT_ASSERT_EQUAL(version, o_version); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/rpc/TestService.proto b/open-lighting-architecture/ola-0.8.4/common/rpc/TestService.proto new file mode 100644 index 0000000..e978c42 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/rpc/TestService.proto @@ -0,0 +1,39 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * TestService.proto + * Defines a simple service for testing the RpcChannel + * Copyright (C) 2005 - 2008 Simon Newton + */ + +package ola.rpc; + +message EchoRequest { + required string data = 1; +} + +message EchoReply { + required string data = 1; +} + +message STREAMING_NO_RESPONSE { + +} + +service TestService { + rpc Echo (EchoRequest) returns (EchoReply); + rpc FailedEcho (EchoRequest) returns (EchoReply); + rpc Stream (EchoRequest) returns (STREAMING_NO_RESPONSE); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueue.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueue.cpp new file mode 100644 index 0000000..5bdc26d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueue.cpp @@ -0,0 +1,81 @@ +/* + * 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 Library 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. + * + * OlaHttpServer.cpp + * Ola HTTP class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include + +#include "ola/ActionQueue.h" +#include "ola/Callback.h" +#include "ola/Closure.h" +#include "ola/Logging.h" + + +namespace ola { + +using std::vector; + +ActionQueue::~ActionQueue() { + vector::const_iterator iter; + for (iter = m_actions.begin(); iter != m_actions.end(); ++iter) + delete *iter; + m_actions.clear(); +} + + +void ActionQueue::AddAction(Action *action) { + m_actions.push_back(action); +} + + +/* + * Check the state of the current action, and if necessary run the next action. + */ +void ActionQueue::NextAction() { + if (!m_success) + return; + + if (m_action_index >= 0 && m_action_index < + static_cast(m_actions.size())) { + if (m_actions[m_action_index]->IsFatal() && + m_actions[m_action_index]->Failed()) { + // abort the chain here + m_success = false; + m_on_complete->Run(this); + return; + } + } + + if (m_action_index >= static_cast(m_actions.size())) { + OLA_WARN << "Action queue already finished!"; + } else if (m_action_index == static_cast(m_actions.size()) - 1) { + m_action_index++; + m_on_complete->Run(this); + } else { + m_action_index++; + m_actions[m_action_index]->Perform( + NewSingleClosure(this, &ActionQueue::NextAction)); + } +} + +Action *ActionQueue::GetAction(unsigned int i) { + if (i >= ActionCount()) + return NULL; + return m_actions[i]; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueueTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueueTest.cpp new file mode 100644 index 0000000..8419529 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/ActionQueueTest.cpp @@ -0,0 +1,154 @@ +/* + * 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 Library 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. + * + * ActionQueueTest.cpp + * Test fixture for the ActionQueue class + * Copyright (C) 2010 Simon Newton + */ + +#include + +#include "ola/ActionQueue.h" +#include "ola/Callback.h" + +using ola::Action; +using ola::ActionQueue; +using ola::SingleUseClosure; + +class ActionQueueTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ActionQueueTest); + CPPUNIT_TEST(testEmptyQueue); + CPPUNIT_TEST(testSimpleQueue); + CPPUNIT_TEST(testFailedQueue); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void CommandsComplete(ActionQueue *queue); + void testEmptyQueue(); + void testSimpleQueue(); + void testFailedQueue(); + + private: + ActionQueue *m_received_queue; +}; + + +/* + * A basic test action + */ +class MockAction: public Action { + public: + MockAction(bool fatal = false, bool fail = false): + Action(), + m_fatal(fatal), + m_failed(fail), + m_executed(false) {} + + bool IsFatal() const { return m_fatal; } + bool Failed() const { return m_failed; } + bool Executed() const { return m_executed; } + + void Perform(SingleUseClosure *on_done); + + private: + bool m_fatal; + bool m_failed; + bool m_executed; +}; + + +void MockAction::Perform(SingleUseClosure *on_done) { + m_executed = true; + on_done->Run(); +} + + +CPPUNIT_TEST_SUITE_REGISTRATION(ActionQueueTest); + + +void ActionQueueTest::setUp() { + m_received_queue = NULL; +} + + +void ActionQueueTest::CommandsComplete(ActionQueue *queue) { + m_received_queue = queue; +} + + +/* + * Check that an empty queue works. + */ +void ActionQueueTest::testEmptyQueue() { + ActionQueue queue( + NewSingleCallback(this, &ActionQueueTest::CommandsComplete)); + queue.NextAction(); + CPPUNIT_ASSERT_EQUAL(&queue, m_received_queue); + CPPUNIT_ASSERT(queue.WasSuccessful()); + + // try calling next item to make sure nothing happens + queue.NextAction(); +} + + +/* + * Test that a simple queue works + */ +void ActionQueueTest::testSimpleQueue() { + ActionQueue queue( + NewSingleCallback(this, &ActionQueueTest::CommandsComplete)); + + MockAction *action1 = new MockAction(); + queue.AddAction(action1); + MockAction *action2 = new MockAction(); + queue.AddAction(action2); + + queue.NextAction(); + CPPUNIT_ASSERT_EQUAL(&queue, m_received_queue); + CPPUNIT_ASSERT(queue.WasSuccessful()); + CPPUNIT_ASSERT(action1->Executed()); + CPPUNIT_ASSERT(action2->Executed()); + + // try calling next item to make sure nothing happens + queue.NextAction(); +} + + +/* + * Test that a simple queue works + */ +void ActionQueueTest::testFailedQueue() { + ActionQueue queue( + NewSingleCallback(this, &ActionQueueTest::CommandsComplete)); + + MockAction *action1 = new MockAction(false, true); + queue.AddAction(action1); + MockAction *action2 = new MockAction(true, true); + queue.AddAction(action2); + MockAction *action3 = new MockAction(); + queue.AddAction(action3); + + queue.NextAction(); + CPPUNIT_ASSERT_EQUAL(&queue, m_received_queue); + CPPUNIT_ASSERT(!queue.WasSuccessful()); + CPPUNIT_ASSERT(action1->Executed()); + CPPUNIT_ASSERT(action2->Executed()); + CPPUNIT_ASSERT(!action3->Executed()); + + // try calling next item to make sure nothing happens + queue.NextAction(); +} + diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/ClockTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/ClockTest.cpp new file mode 100644 index 0000000..7979eaf --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/ClockTest.cpp @@ -0,0 +1,108 @@ +/* + * 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 Library 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. + * + * ClockTest.cpp + * Unittest for String functions. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include +#include "ola/Clock.h" + + +class ClockTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ClockTest); + CPPUNIT_TEST(testTimeStamp); + CPPUNIT_TEST(testTimeInterval); + CPPUNIT_TEST_SUITE_END(); + + public: + void testTimeStamp(); + void testTimeInterval(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(ClockTest); + +using ola::Clock; +using ola::TimeStamp; +using ola::TimeInterval; +using std::string; + + +/* + * Test the TimeStamp class + */ +void ClockTest::testTimeStamp() { + TimeStamp timestamp, timestamp2; + CPPUNIT_ASSERT(!timestamp.IsSet()); + CPPUNIT_ASSERT(!timestamp2.IsSet()); + + // test assignment & copy constructor + Clock::CurrentTime(×tamp); + CPPUNIT_ASSERT(timestamp.IsSet()); + timestamp2 = timestamp; + CPPUNIT_ASSERT(timestamp2.IsSet()); + TimeStamp timestamp3(timestamp); + CPPUNIT_ASSERT(timestamp3.IsSet()); + CPPUNIT_ASSERT_EQUAL(timestamp, timestamp2); + CPPUNIT_ASSERT_EQUAL(timestamp, timestamp3); + + // test equalities + // Windows only seems to have ms resolution, to make the tests pass we need + // to sleep here + usleep(1000); + Clock::CurrentTime(×tamp3); + CPPUNIT_ASSERT(timestamp3 != timestamp); + CPPUNIT_ASSERT(timestamp3 > timestamp); + CPPUNIT_ASSERT(timestamp < timestamp3); + + // test intervals + TimeInterval interval = timestamp3 - timestamp; + + // test subtraction / addition + timestamp2 = timestamp + interval; + CPPUNIT_ASSERT_EQUAL(timestamp2, timestamp3); + timestamp2 -= interval; + CPPUNIT_ASSERT_EQUAL(timestamp, timestamp2); + + // test toString and AsInt + TimeInterval one_point_five_seconds(1500000); + CPPUNIT_ASSERT_EQUAL(string("1.500000"), one_point_five_seconds.ToString()); + CPPUNIT_ASSERT_EQUAL(static_cast(1500000), + one_point_five_seconds.AsInt()); +} + + +/* + * test time intervals + */ +void ClockTest::testTimeInterval() { + // test intervals + TimeInterval interval(500000); // 0.5s + TimeInterval interval2 = interval; + TimeInterval interval3(interval); + CPPUNIT_ASSERT_EQUAL(interval, interval2); + CPPUNIT_ASSERT_EQUAL(interval, interval3); + + TimeInterval interval4(1, 500000); // 1.5s + CPPUNIT_ASSERT(interval != interval4); + CPPUNIT_ASSERT(interval < interval4); + TimeInterval interval5(1, 600000); // 1.6s + CPPUNIT_ASSERT(interval4 != interval5); + CPPUNIT_ASSERT(interval4 < interval5); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/ClosureTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/ClosureTest.cpp new file mode 100644 index 0000000..742ce98 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/ClosureTest.cpp @@ -0,0 +1,549 @@ +/* + * 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 Library 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. + * + * ClosureTest.cpp + * Unittest for String functions. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include +#include "ola/Closure.h" + +using std::string; + +class ClosureTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ClosureTest); + CPPUNIT_TEST(testFunctionClosures); + CPPUNIT_TEST(testMethodClosures); + CPPUNIT_TEST(testFunctionCallbacks1); + CPPUNIT_TEST(testMethodCallbacks1); + CPPUNIT_TEST(testMethodCallbacks2); + CPPUNIT_TEST_SUITE_END(); + + public: + void testFunctionClosures(); + void testMethodClosures(); + void testFunctionCallbacks1(); + void testMethodCallbacks1(); + void testMethodCallbacks2(); + void testMethodCallbacks4(); + + void Method0() {} + bool BoolMethod0() { return true; } + + void Method1(unsigned int i) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + } + + bool BoolMethod1(unsigned int i) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + return true; + } + + void Method2(unsigned int i, int j) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + } + + bool BoolMethod2(unsigned int i, int j) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + return true; + } + + void Method3(unsigned int i, int j, char c) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + CPPUNIT_ASSERT_EQUAL(TEST_CHAR_VALUE, c); + } + + bool BoolMethod3(unsigned int i, int j, char c) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + CPPUNIT_ASSERT_EQUAL(TEST_CHAR_VALUE, c); + return true; + } + + void Method4(unsigned int i, int j, char c, const string &s) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + CPPUNIT_ASSERT_EQUAL(TEST_CHAR_VALUE, c); + CPPUNIT_ASSERT_EQUAL(string(TEST_STRING_VALUE), s); + } + + bool BoolMethod4(unsigned int i, int j, char c, const string &s) { + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(TEST_INT_VALUE2, j); + CPPUNIT_ASSERT_EQUAL(TEST_CHAR_VALUE, c); + CPPUNIT_ASSERT_EQUAL(string(TEST_STRING_VALUE), s); + return true; + } + + static const unsigned int TEST_INT_VALUE; + static const int TEST_INT_VALUE2; + static const char TEST_CHAR_VALUE; + static const char TEST_STRING_VALUE[]; +}; + + +const unsigned int ClosureTest::TEST_INT_VALUE = 42; +const int ClosureTest::TEST_INT_VALUE2 = 53; +const char ClosureTest::TEST_CHAR_VALUE = 'c'; +const char ClosureTest::TEST_STRING_VALUE[] = "foo"; +CPPUNIT_TEST_SUITE_REGISTRATION(ClosureTest); + +using ola::BaseCallback1; +using ola::BaseCallback2; +using ola::BaseCallback4; +using ola::Closure; +using ola::NewCallback; +using ola::NewClosure; +using ola::NewSingleCallback; +using ola::NewSingleClosure; +using ola::SingleUseClosure; + + +// Functions used for testing +void Function0() {} +bool BoolFunction0() { return true; } + +void Function1(unsigned int i) { + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE, i); +} + +bool BoolFunction1(unsigned int i) { + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE, i); + return true; +} + +void Function2(unsigned int i, int j) { + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE2, j); +} + +bool BoolFunction2(unsigned int i, int j) { + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE, i); + CPPUNIT_ASSERT_EQUAL(ClosureTest::TEST_INT_VALUE2, j); + return true; +} + + +/* + * Test the Function Closures class + */ +void ClosureTest::testFunctionClosures() { + // no arg, void return closures + SingleUseClosure *c1 = NewSingleClosure(&Function0); + c1->Run(); + Closure *c2 = NewClosure(&Function0); + c2->Run(); + c2->Run(); + delete c2; + + // no arg, bool closures + SingleUseClosure *c3 = NewSingleClosure(&BoolFunction0); + CPPUNIT_ASSERT(c3->Run()); + Closure *c4 = NewClosure(&BoolFunction0); + CPPUNIT_ASSERT(c4->Run()); + CPPUNIT_ASSERT(c4->Run()); + delete c4; + + // one arg, void return + SingleUseClosure *c5 = NewSingleClosure( + &Function1, + TEST_INT_VALUE); + c5->Run(); + Closure *c6 = NewClosure(&Function1, TEST_INT_VALUE); + c6->Run(); + c6->Run(); + delete c6; + + // one arg, bool closures + SingleUseClosure *c7 = NewSingleClosure( + &BoolFunction1, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c7->Run()); + Closure *c8 = NewClosure(&BoolFunction1, TEST_INT_VALUE); + CPPUNIT_ASSERT(c8->Run()); + CPPUNIT_ASSERT(c8->Run()); + delete c8; +} + + +/* + * Test the Method Closures + */ +void ClosureTest::testMethodClosures() { + // no arg, void return closures + SingleUseClosure *c1 = NewSingleClosure(this, &ClosureTest::Method0); + c1->Run(); + Closure *c2 = NewClosure(this, &ClosureTest::Method0); + c2->Run(); + c2->Run(); + delete c2; + + // no arg, bool closures + SingleUseClosure *c3 = NewSingleClosure(this, + &ClosureTest::BoolMethod0); + CPPUNIT_ASSERT(c3->Run()); + Closure *c4 = NewClosure(this, &ClosureTest::BoolMethod0); + CPPUNIT_ASSERT(c4->Run()); + CPPUNIT_ASSERT(c4->Run()); + delete c4; + + // one arg, void return + SingleUseClosure *c5 = NewSingleClosure( + this, + &ClosureTest::Method1, + TEST_INT_VALUE); + c5->Run(); + Closure *c6 = NewClosure(this, &ClosureTest::Method1, TEST_INT_VALUE); + c6->Run(); + c6->Run(); + delete c6; + + // one arg, bool closures + SingleUseClosure *c7 = NewSingleClosure( + this, + &ClosureTest::BoolMethod1, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c7->Run()); + Closure *c8 = NewClosure(this, + &ClosureTest::BoolMethod1, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c8->Run()); + CPPUNIT_ASSERT(c8->Run()); + delete c8; + + // two arg, void return + SingleUseClosure *c9 = NewSingleClosure( + this, + &ClosureTest::Method2, + TEST_INT_VALUE, + TEST_INT_VALUE2); + c9->Run(); + Closure *c10 = NewClosure(this, + &ClosureTest::Method2, + TEST_INT_VALUE, + TEST_INT_VALUE2); + c10->Run(); + c10->Run(); + delete c10; + + // two arg, bool closures + SingleUseClosure *c11 = NewSingleClosure( + this, + &ClosureTest::BoolMethod2, + TEST_INT_VALUE, + TEST_INT_VALUE2); + CPPUNIT_ASSERT(c11->Run()); + Closure *c12 = NewClosure(this, + &ClosureTest::BoolMethod2, + TEST_INT_VALUE, + TEST_INT_VALUE2); + CPPUNIT_ASSERT(c12->Run()); + CPPUNIT_ASSERT(c12->Run()); + delete c12; + + // three arg, void return + SingleUseClosure *c13 = NewSingleClosure( + this, + &ClosureTest::Method3, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + c13->Run(); + Closure *c14 = NewClosure(this, + &ClosureTest::Method3, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + c14->Run(); + c14->Run(); + delete c14; + + // three arg, bool closures + SingleUseClosure *c15 = NewSingleClosure( + this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + CPPUNIT_ASSERT(c15->Run()); + Closure *c16 = NewClosure(this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + CPPUNIT_ASSERT(c16->Run()); + CPPUNIT_ASSERT(c16->Run()); + delete c16; +} + + + +/* + * Test the single argument function closures + */ +void ClosureTest::testFunctionCallbacks1() { + // single arg, void return closures + BaseCallback1 *c1 = NewSingleCallback(&Function1); + c1->Run(TEST_INT_VALUE); + BaseCallback1 *c2 = NewCallback(&Function1); + c2->Run(TEST_INT_VALUE); + c2->Run(TEST_INT_VALUE); + delete c2; + + // test a function that returns bool + BaseCallback1 *c3 = NewSingleCallback(&BoolFunction1); + CPPUNIT_ASSERT(c3->Run(TEST_INT_VALUE)); + BaseCallback1 *c4 = NewCallback(&BoolFunction1); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE)); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE)); + delete c4; + + // single arg, void return closures + BaseCallback1 *c6 = NewSingleCallback( + &Function2, + TEST_INT_VALUE); + c6->Run(TEST_INT_VALUE2); + BaseCallback1 *c7 = NewCallback( + &Function2, + TEST_INT_VALUE); + c7->Run(TEST_INT_VALUE2); + c7->Run(TEST_INT_VALUE2); + delete c7; +} + + +/* + * Test the Method Callbacks + */ +void ClosureTest::testMethodCallbacks1() { + // test 1 arg callbacks that return unsigned ints + BaseCallback1 *c1 = NewSingleCallback( + this, + &ClosureTest::Method1); + c1->Run(TEST_INT_VALUE); + BaseCallback1 *c2 = NewCallback(this, + &ClosureTest::Method1); + c2->Run(TEST_INT_VALUE); + c2->Run(TEST_INT_VALUE); + delete c2; + + // test 1 arg callbacks that return bools + BaseCallback1 *c3 = NewSingleCallback( + this, + &ClosureTest::BoolMethod1); + CPPUNIT_ASSERT(c3->Run(TEST_INT_VALUE)); + BaseCallback1 *c4 = NewCallback( + this, + &ClosureTest::BoolMethod1); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE)); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE)); + delete c4; + + // test 1 arg initial, 1 arg deferred callbacks that return ints + BaseCallback1 *c5 = NewSingleCallback( + this, + &ClosureTest::Method2, + TEST_INT_VALUE); + c5->Run(TEST_INT_VALUE2); + BaseCallback1 *c6 = NewCallback( + this, + &ClosureTest::Method2, + TEST_INT_VALUE); + c6->Run(TEST_INT_VALUE2); + c6->Run(TEST_INT_VALUE2); + delete c6; + + // test 1 arg initial, 1 arg deferred callbacks that return bools + BaseCallback1 *c7 = NewSingleCallback( + this, + &ClosureTest::BoolMethod2, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c7->Run(TEST_INT_VALUE2)); + BaseCallback1 *c8 = NewCallback( + this, + &ClosureTest::BoolMethod2, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c8->Run(TEST_INT_VALUE2)); + CPPUNIT_ASSERT(c8->Run(TEST_INT_VALUE2)); + delete c8; + + // test 2 arg initial, 1 arg deferred callbacks that return ints + BaseCallback1 *c9 = NewSingleCallback( + this, + &ClosureTest::Method3, + TEST_INT_VALUE, + TEST_INT_VALUE2); + c9->Run(TEST_CHAR_VALUE); + BaseCallback1 *c10 = NewCallback( + this, + &ClosureTest::Method3, + TEST_INT_VALUE, + TEST_INT_VALUE2); + c10->Run(TEST_CHAR_VALUE); + c10->Run(TEST_CHAR_VALUE); + delete c10; + + // test 2 arg initial, 1 arg deferred callbacks that return bools + BaseCallback1 *c11 = NewSingleCallback( + this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE, + TEST_INT_VALUE2); + CPPUNIT_ASSERT(c11->Run(TEST_CHAR_VALUE)); + BaseCallback1 *c12 = NewCallback( + this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE, + TEST_INT_VALUE2); + CPPUNIT_ASSERT(c12->Run(TEST_CHAR_VALUE)); + CPPUNIT_ASSERT(c12->Run(TEST_CHAR_VALUE)); + delete c12; + + // test 3 arg initial, 1 arg deferred callbacks that return ints + BaseCallback1 *c13 = NewSingleCallback( + this, + &ClosureTest::Method4, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + c13->Run(TEST_STRING_VALUE); + BaseCallback1 *c14 = NewCallback( + this, + &ClosureTest::Method4, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + c14->Run(TEST_STRING_VALUE); + c14->Run(TEST_STRING_VALUE); + delete c14; + + // test 3 arg initial, 1 arg deferred callbacks that return bools + BaseCallback1 *c15 = NewSingleCallback( + this, + &ClosureTest::BoolMethod4, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + CPPUNIT_ASSERT(c15->Run(TEST_STRING_VALUE)); + BaseCallback1 *c16 = NewCallback( + this, + &ClosureTest::BoolMethod4, + TEST_INT_VALUE, + TEST_INT_VALUE2, + TEST_CHAR_VALUE); + CPPUNIT_ASSERT(c16->Run(TEST_STRING_VALUE)); + CPPUNIT_ASSERT(c16->Run(TEST_STRING_VALUE)); + delete c16; +} + + +/* + * Test the Method Callbacks + */ +void ClosureTest::testMethodCallbacks2() { + // test 2 arg callbacks that return void + BaseCallback2 *c1 = NewSingleCallback( + this, + &ClosureTest::Method2); + c1->Run(TEST_INT_VALUE, TEST_INT_VALUE2); + BaseCallback2 *c2 = NewCallback( + this, + &ClosureTest::Method2); + c2->Run(TEST_INT_VALUE, TEST_INT_VALUE2); + c2->Run(TEST_INT_VALUE, TEST_INT_VALUE2); + delete c2; + + // test 2 arg callbacks that return bools + BaseCallback2 *c3 = NewSingleCallback( + this, + &ClosureTest::BoolMethod2); + CPPUNIT_ASSERT(c3->Run(TEST_INT_VALUE, TEST_INT_VALUE2)); + BaseCallback2 *c4 = NewCallback( + this, + &ClosureTest::BoolMethod2); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE, TEST_INT_VALUE2)); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE, TEST_INT_VALUE2)); + delete c4; + + // test 1 create time, 2 run time arg callbacks that return void + BaseCallback2 *c5 = NewSingleCallback( + this, + &ClosureTest::Method3, + TEST_INT_VALUE); + c5->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE); + BaseCallback2 *c6 = NewCallback( + this, + &ClosureTest::Method3, + TEST_INT_VALUE); + c6->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE); + c6->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE); + delete c6; + + // test 1 create time, 2 run time arg callbacks that return bools + BaseCallback2 *c7 = NewSingleCallback( + this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c7->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE)); + BaseCallback2 *c8 = NewCallback( + this, + &ClosureTest::BoolMethod3, + TEST_INT_VALUE); + CPPUNIT_ASSERT(c8->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE)); + CPPUNIT_ASSERT(c8->Run(TEST_INT_VALUE2, TEST_CHAR_VALUE)); + delete c8; +} + + +/* + * Test the Method Callbacks + */ +void ClosureTest::testMethodCallbacks4() { + // test 2 arg callbacks that return unsigned ints + BaseCallback4 *c1 = + NewSingleCallback( + this, + &ClosureTest::Method4); + c1->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, TEST_STRING_VALUE); + BaseCallback4 *c2 = NewCallback( + this, + &ClosureTest::Method4); + c2->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, TEST_STRING_VALUE); + c2->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, TEST_STRING_VALUE); + delete c2; + + // test 2 arg callbacks that return bools + BaseCallback4 *c3 = + NewSingleCallback( + this, + &ClosureTest::BoolMethod4); + CPPUNIT_ASSERT(c3->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, + TEST_STRING_VALUE)); + BaseCallback4 *c4 = + NewCallback( + this, + &ClosureTest::BoolMethod4); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, + TEST_STRING_VALUE)); + CPPUNIT_ASSERT(c4->Run(TEST_INT_VALUE, TEST_INT_VALUE2, TEST_CHAR_VALUE, + TEST_STRING_VALUE)); + delete c4; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/DmxBuffer.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/DmxBuffer.cpp new file mode 100644 index 0000000..b41fc20 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/DmxBuffer.cpp @@ -0,0 +1,457 @@ +/* + * 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 Library 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. + * + * DmxBuffer.cpp + * The DmxBuffer class + * Copyright (C) 2005-2009 Simon Newton + * + * This implements a DmxBuffer which uses copy-on-write and delayed init. + * + * A DmxBuffer can hold up to 512 bytes of channel information. The amount of + * valid data is returned by calling Size(). + */ + +#include +#include +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/DmxBuffer.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" + +namespace ola { + +using std::min; +using std::max; +using std::vector; + +DmxBuffer::DmxBuffer() + : m_ref_count(NULL), + m_copy_on_write(false), + m_data(NULL), + m_length(0) { +} + + +/* + * Copy constructor. We just copy the underlying pointers and mark COW as + * true if the other buffer has data. + */ +DmxBuffer::DmxBuffer(const DmxBuffer &other) + : m_ref_count(NULL), + m_copy_on_write(false), + m_data(NULL), + m_length(0) { + + if (other.m_data && other.m_ref_count) { + CopyFromOther(other); + } +} + + +/* + * Create a new buffer from data + */ +DmxBuffer::DmxBuffer(const uint8_t *data, unsigned int length) + : m_ref_count(0), + m_copy_on_write(false), + m_data(NULL), + m_length(0) { + Set(data, length); +} + + +/* + * Create a new buffer from a string + */ +DmxBuffer::DmxBuffer(const string &data) + : m_ref_count(0), + m_copy_on_write(false), + m_data(NULL), + m_length(0) { + Set(data); +} + + +/* + * Cleanup + */ +DmxBuffer::~DmxBuffer() { + CleanupMemory(); +} + + +/* + * Make this buffer equal to another one + * @param other the other DmxBuffer + */ +DmxBuffer& DmxBuffer::operator=(const DmxBuffer &other) { + if (this != &other) { + CleanupMemory(); + if (other.m_data) { + CopyFromOther(other); + } + } + return *this; +} + + +/* + * Check for equality. + */ +bool DmxBuffer::operator==(const DmxBuffer &other) const { + return (m_length == other.m_length && + (m_data == other.m_data || + 0 == memcmp(m_data, other.m_data, m_length))); +} + + +/* + * HTP Merge from another DmxBuffer. + * @param other the DmxBuffer to HTP merge into this one + */ +bool DmxBuffer::HTPMerge(const DmxBuffer &other) { + if (!m_data) { + if (!Init()) + return false; + } + DuplicateIfNeeded(); + + unsigned int other_length = min((unsigned int) DMX_UNIVERSE_SIZE, + other.m_length); + unsigned int merge_length = min(m_length, other.m_length); + + for (unsigned int i = 0; i < merge_length; i++) { + m_data[i] = max(m_data[i], other.m_data[i]); + } + + if (other_length > m_length) { + memcpy(m_data + merge_length, other.m_data + merge_length, + other_length - merge_length); + m_length = other_length; + } + return true; +} + + +/* + * Set the contents of this DmxBuffer + * @post Size() == length + */ +bool DmxBuffer::Set(const uint8_t *data, unsigned int length) { + if (!data) + return false; + + if (m_copy_on_write) + CleanupMemory(); + if (!m_data) { + if (!Init()) + return false; + } + m_length = min(length, (unsigned int) DMX_UNIVERSE_SIZE); + memcpy(m_data, data, m_length); + return true; +} + + +/* + * Set the contents of this DmxBuffer + * @param data the string with the dmx data + * @post Size() == data.length() + */ +bool DmxBuffer::Set(const string &data) { + return Set(reinterpret_cast(data.data()), data.length()); +} + + +/* + * Sets the data in this buffer to be the same as the other one. + * Used instead of a COW to optimise. + * @post Size() == other.Size() + */ +bool DmxBuffer::Set(const DmxBuffer &other) { + return Set(other.m_data, other.m_length); +} + + +/* + * Convert a ',' separated list into a DmxBuffer. Invalid values are set to + * 0. 0s can be dropped between the commas. + * @param input the string to split + */ +bool DmxBuffer::SetFromString(const string &input) { + unsigned int i = 0; + vector dmx_values; + vector::const_iterator iter; + + if (m_copy_on_write) + CleanupMemory(); + if (!m_data) + if (!Init()) + return false; + + if (input.empty()) { + m_length = 0; + return true; + } + StringSplit(input, dmx_values, ","); + for (iter = dmx_values.begin(); + iter != dmx_values.end() && i < DMX_UNIVERSE_SIZE; ++iter, ++i) { + m_data[i] = atoi(iter->data()); + } + m_length = i; + return true; +} + + +/* + * Set a Range of data to a single value + * @param offset the starting channel + * @param value the value to set the range to + * @param length the length of the range to set + */ +bool DmxBuffer::SetRangeToValue(unsigned int offset, + uint8_t value, + unsigned int length) { + if (offset >= DMX_UNIVERSE_SIZE) + return false; + + if (!m_data) { + Blackout(); + } + + if (offset > m_length) + return false; + + DuplicateIfNeeded(); + + unsigned int copy_length = min(length, DMX_UNIVERSE_SIZE - offset); + memset(m_data + offset, value, copy_length); + m_length = max(m_length, offset + copy_length); + return true; +} + + +/* + * Set a range of data. Calling this on an uninitialized buffer will call + * Blackout() first. Attempting to set data with an offset > Size() is an + * error. + * @param offset the starting channel + * @param data a pointer to the new data + * @param length the length of the data + */ +bool DmxBuffer::SetRange(unsigned int offset, + const uint8_t *data, + unsigned int length) { + if (!data || offset >= DMX_UNIVERSE_SIZE) + return false; + + if (!m_data) { + Blackout(); + } + + if (offset > m_length) + return false; + + DuplicateIfNeeded(); + + unsigned int copy_length = min(length, DMX_UNIVERSE_SIZE - offset); + memcpy(m_data + offset, data, copy_length); + m_length = max(m_length, offset + copy_length); + return true; +} + + +/* + * Set a single channel. Calling this on an uninitialized buffer will call + * Blackout() first. Trying to set a channel more than 1 channel past the end + * of the valid data is an error. + */ +void DmxBuffer::SetChannel(unsigned int channel, uint8_t data) { + if (channel >= DMX_UNIVERSE_SIZE) + return; + + if (!m_data) { + Blackout(); + } + + if (channel > m_length) { + OLA_WARN << "attempting to set channel " << channel << "when length is " << + m_length; + return; + } + + DuplicateIfNeeded(); + m_data[channel] = data; + m_length = max(channel+1, m_length); +} + + +/* + * Get the contents of this buffer + */ +void DmxBuffer::Get(uint8_t *data, unsigned int *length) const { + if (m_data) { + *length = min(*length, m_length); + memcpy(data, m_data, *length); + } else { + *length = 0; + } +} + + +/* + * Returns the value of a channel. This returns 0 if the buffer wasn't + * initialized or the channel was out-of-bounds. + */ +uint8_t DmxBuffer::Get(unsigned int channel) const { + if (m_data && channel < m_length) + return m_data[channel]; + else + return 0; +} + + +/* + * Get the contents of the DmxBuffer as a string + */ +string DmxBuffer::Get() const { + string data; + data.append(reinterpret_cast(m_data), m_length); + return data; +} + + +/* + * Set the buffer to all zeros. + * @post Size() == DMX_UNIVERSE_SIZE + */ +bool DmxBuffer::Blackout() { + if (m_copy_on_write) + CleanupMemory(); + if (!m_data) + if (!Init()) + return false; + memset(m_data, 0, DMX_UNIVERSE_SIZE); + m_length = DMX_UNIVERSE_SIZE; + return true; +} + + +/* + * Reset the bufer to hold no data. + * @post Size() == 0 + */ +void DmxBuffer::Reset() { + if (m_data) + m_length = 0; +} + + +/* + * Convert to a human readable representation + */ +string DmxBuffer::ToString() const { + if (!m_data) + return ""; + + std::stringstream str; + str << static_cast(Size()) << ": "; + for (unsigned int i = 0; i < Size(); i++) { + if (i) + str << ","; + str << static_cast(m_data[i]); + } + return str.str(); +} + + +/* + * Allocate memory + */ +bool DmxBuffer::Init() { + try { + m_data = new uint8_t[DMX_UNIVERSE_SIZE]; + } catch (std::bad_alloc &ex) { + return false; + } + try { + m_ref_count = new unsigned int; + } catch (std::bad_alloc &ex) { + delete[] m_data; + return false; + } + m_length = 0; + *m_ref_count = 1; + return true; +} + + +/* + * Called before making a change, this duplicates the data if required. + */ +bool DmxBuffer::DuplicateIfNeeded() { + if (m_copy_on_write && *m_ref_count == 1) + m_copy_on_write = false; + + if (m_copy_on_write && *m_ref_count > 1) { + unsigned int *old_ref_count = m_ref_count; + uint8_t *original_data = m_data; + unsigned int length = m_length; + m_copy_on_write = false; + if (Init()) { + Set(original_data, length); + (*old_ref_count)--; + return true; + } + return false; + } + return true; +} + + +/* + * Setup this buffer to point to the data of the other buffer + * @param other the source buffer + * @pre other.m_data and other.m_ref_count are not NULL + */ +void DmxBuffer::CopyFromOther(const DmxBuffer &other) { + m_copy_on_write = true; + other.m_copy_on_write = true; + m_ref_count = other.m_ref_count; + (*m_ref_count)++; + m_data = other.m_data; + m_length = other.m_length; +} + + +/* + * Decrement the ref count by one and free the memory if required + */ +void DmxBuffer::CleanupMemory() { + if (m_ref_count && m_data) { + (*m_ref_count)--; + if (!*m_ref_count) { + delete[] m_data; + delete m_ref_count; + } + m_data = NULL; + m_ref_count = NULL; + m_length = 0; + } +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/DmxBufferTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/DmxBufferTest.cpp new file mode 100644 index 0000000..d2e5dd0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/DmxBufferTest.cpp @@ -0,0 +1,510 @@ +/* + * 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 Library 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. + * + * DmxBufferTest.cpp + * Unittest for the DmxBuffer + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/DmxBuffer.h" + +using std::string; +using ola::DmxBuffer; + +class DmxBufferTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DmxBufferTest); + CPPUNIT_TEST(testBlackout); + CPPUNIT_TEST(testGetSet); + CPPUNIT_TEST(testStringGetSet); + CPPUNIT_TEST(testAssign); + CPPUNIT_TEST(testCopy); + CPPUNIT_TEST(testMerge); + CPPUNIT_TEST(testStringToDmx); + CPPUNIT_TEST(testCopyOnWrite); + CPPUNIT_TEST(testSetRange); + CPPUNIT_TEST(testSetRangeToValue); + CPPUNIT_TEST(testSetChannel); + CPPUNIT_TEST(testToString); + CPPUNIT_TEST_SUITE_END(); + + public: + void testBlackout(); + void testGetSet(); + void testAssign(); + void testStringGetSet(); + void testCopy(); + void testMerge(); + void testStringToDmx(); + void testCopyOnWrite(); + void testSetRange(); + void testSetRangeToValue(); + void testSetChannel(); + void testToString(); + + private: + static const uint8_t TEST_DATA[]; + static const uint8_t TEST_DATA2[]; + static const uint8_t TEST_DATA3[]; + static const uint8_t MERGE_RESULT[]; + static const uint8_t MERGE_RESULT2[]; + + void runStringToDmx(const string &input, const DmxBuffer &expected); +}; + +const uint8_t DmxBufferTest::TEST_DATA[] = {1, 2, 3, 4, 5}; +const uint8_t DmxBufferTest::TEST_DATA2[] = {9, 8, 7, 6, 5, 4, 3, 2, 1}; +const uint8_t DmxBufferTest::TEST_DATA3[] = {10, 11, 12}; +const uint8_t DmxBufferTest::MERGE_RESULT[] = {10, 11, 12, 4, 5}; +const uint8_t DmxBufferTest::MERGE_RESULT2[] = {10, 11, 12, 6, 5, 4, 3, 2, 1}; + +CPPUNIT_TEST_SUITE_REGISTRATION(DmxBufferTest); + + +/* + * Test that Blackout() works + */ +void DmxBufferTest::testBlackout() { + DmxBuffer buffer; + CPPUNIT_ASSERT(buffer.Blackout()); + uint8_t *result = new uint8_t[DMX_UNIVERSE_SIZE]; + uint8_t *zero = new uint8_t[DMX_UNIVERSE_SIZE]; + unsigned int result_length = DMX_UNIVERSE_SIZE; + memset(zero, 0, DMX_UNIVERSE_SIZE); + buffer.Get(result, &result_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, result_length); + CPPUNIT_ASSERT(!memcmp(zero, result, result_length)); + delete[] result; + delete[] zero; + + buffer.Reset(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, buffer.Size()); +} + + +/* + * Check that Get/Set works correctly + */ +void DmxBufferTest::testGetSet() { + unsigned int fudge_factor = 10; + unsigned int result_length = sizeof(TEST_DATA2) + fudge_factor; + uint8_t *result = new uint8_t[result_length]; + unsigned int size = result_length; + DmxBuffer buffer; + string str_result; + + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, buffer.Get(0)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, buffer.Get(1)); + + CPPUNIT_ASSERT(!buffer.Set(NULL, sizeof(TEST_DATA))); + + CPPUNIT_ASSERT(buffer.Set(TEST_DATA, sizeof(TEST_DATA))); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, buffer.Get(0)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, buffer.Get(1)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), buffer.Size()); + buffer.Get(result, &size); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), size); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, result, size)); + str_result = buffer.Get(); + CPPUNIT_ASSERT_EQUAL((size_t) sizeof(TEST_DATA), str_result.length()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, str_result.data(), str_result.length())); + + size = result_length; + CPPUNIT_ASSERT(buffer.Set(TEST_DATA2, sizeof(TEST_DATA2))); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA2), buffer.Size()); + buffer.Get(result, &size); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA2), size); + CPPUNIT_ASSERT(!memcmp(TEST_DATA2, result, size)); + str_result = buffer.Get(); + CPPUNIT_ASSERT_EQUAL((size_t) sizeof(TEST_DATA2), str_result.length()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA2, str_result.data(), str_result.length())); + + // now check that Set() with another buffer works + DmxBuffer buffer2; + buffer2.Set(buffer); + str_result = buffer2.Get(); + CPPUNIT_ASSERT_EQUAL((size_t) sizeof(TEST_DATA2), str_result.length()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA2, str_result.data(), str_result.length())); + + delete[] result; +} + + +/* + * Check that the string set/get methods work + */ +void DmxBufferTest::testStringGetSet() { + const string data = "abcdefg"; + DmxBuffer buffer; + uint8_t *result = new uint8_t[data.length()]; + unsigned int size = data.length(); + + // Check that setting works + CPPUNIT_ASSERT(buffer.Set(data)); + CPPUNIT_ASSERT_EQUAL(data.length(), (size_t) buffer.Size()); + CPPUNIT_ASSERT_EQUAL(data, buffer.Get()); + buffer.Get(result, &size); + CPPUNIT_ASSERT_EQUAL(data.length(), (size_t) size); + CPPUNIT_ASSERT(!memcmp(data.data(), result, size)); + + // Check the string constructor + DmxBuffer string_buffer(data); + CPPUNIT_ASSERT(buffer == string_buffer); + + // Set with an empty string + string data2; + size = data.length(); + CPPUNIT_ASSERT(buffer.Set(data2)); + CPPUNIT_ASSERT_EQUAL(data2.length(), (size_t) buffer.Size()); + CPPUNIT_ASSERT_EQUAL(data2, buffer.Get()); + buffer.Get(result, &size); + CPPUNIT_ASSERT_EQUAL(data2.length(), (size_t) size); + CPPUNIT_ASSERT(!memcmp(data2.data(), result, size)); + delete[] result; +} + + +/* + * Check the copy and assignment operators work + */ +void DmxBufferTest::testAssign() { + unsigned int fudge_factor = 10; + unsigned int result_length = sizeof(TEST_DATA) + fudge_factor; + uint8_t *result = new uint8_t[result_length]; + DmxBuffer buffer(TEST_DATA, sizeof(TEST_DATA)); + DmxBuffer assignment_buffer(TEST_DATA3, sizeof(TEST_DATA3)); + DmxBuffer assignment_buffer2; + + // assigning to ourself does nothing + buffer = buffer; + + // assinging to a previously init'ed buffer + unsigned int size = result_length; + assignment_buffer = buffer; + assignment_buffer.Get(result, &size); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), + assignment_buffer.Size()); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), size); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, result, size)); + CPPUNIT_ASSERT(assignment_buffer == buffer); + + // assigning to a non-init'ed buffer + assignment_buffer2 = buffer; + size = result_length; + assignment_buffer2.Get(result, &result_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), + assignment_buffer2.Size()); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA), result_length); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, result, result_length)); + CPPUNIT_ASSERT(assignment_buffer2 == buffer); + + // now try assigning an unitialized buffer + DmxBuffer uninitialized_buffer; + DmxBuffer assignment_buffer3; + + assignment_buffer3 = uninitialized_buffer; + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, assignment_buffer3.Size()); + size = result_length; + assignment_buffer3.Get(result, &result_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, result_length); + CPPUNIT_ASSERT(assignment_buffer3 == uninitialized_buffer); + delete[] result; +} + + +/* + * Check that the copy constructor works + */ +void DmxBufferTest::testCopy() { + DmxBuffer buffer(TEST_DATA2, sizeof(TEST_DATA2)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA2), buffer.Size()); + + DmxBuffer copy_buffer(buffer); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA2), copy_buffer.Size()); + CPPUNIT_ASSERT(copy_buffer == buffer); + + unsigned int result_length = sizeof(TEST_DATA2); + uint8_t *result = new uint8_t[result_length]; + copy_buffer.Get(result, &result_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA2), result_length); + CPPUNIT_ASSERT(!memcmp(TEST_DATA2, result, result_length)); + delete[] result; +} + + +/* + * Check that HTP Merging works + */ +void DmxBufferTest::testMerge() { + DmxBuffer buffer1(TEST_DATA, sizeof(TEST_DATA)); + DmxBuffer buffer2(TEST_DATA3, sizeof(TEST_DATA3)); + DmxBuffer merge_result(MERGE_RESULT, sizeof(MERGE_RESULT)); + const DmxBuffer test_buffer(buffer1); + const DmxBuffer test_buffer2(buffer2); + DmxBuffer uninitialized_buffer, uninitialized_buffer2; + + // merge into an empty buffer + CPPUNIT_ASSERT(uninitialized_buffer.HTPMerge(buffer2)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(TEST_DATA3), buffer2.Size()); + CPPUNIT_ASSERT(test_buffer2 == uninitialized_buffer); + + // merge from an empty buffer + CPPUNIT_ASSERT(buffer2.HTPMerge(uninitialized_buffer2)); + CPPUNIT_ASSERT(buffer2 == test_buffer2); + + // merge two buffers (longer into shorter) + buffer2 = test_buffer2; + CPPUNIT_ASSERT(buffer2.HTPMerge(buffer1)); + CPPUNIT_ASSERT(buffer2 == merge_result); + + // merge shorter into longer + buffer2 = test_buffer2; + CPPUNIT_ASSERT(buffer1.HTPMerge(buffer2)); + CPPUNIT_ASSERT(buffer1 == merge_result); +} + + +/* + * Run the StringToDmxTest + * @param input the string to parse + * @param expected the expected result + */ +void DmxBufferTest::runStringToDmx(const string &input, + const DmxBuffer &expected) { + DmxBuffer buffer; + CPPUNIT_ASSERT(buffer.SetFromString(input)); + CPPUNIT_ASSERT(buffer == expected); +} + + +/* + * Test the StringToDmx function + */ +void DmxBufferTest::testStringToDmx() { + string input = "1,2,3,4"; + uint8_t expected1[] = {1, 2, 3, 4}; + runStringToDmx(input, DmxBuffer(expected1, sizeof(expected1))); + + input = "a,b,c,d"; + uint8_t expected2[] = {0, 0, 0, 0}; + runStringToDmx(input, DmxBuffer(expected2, sizeof(expected2))); + + input = "a,b,c,"; + uint8_t expected3[] = {0, 0, 0, 0}; + runStringToDmx(input, DmxBuffer(expected3, sizeof(expected3))); + + input = "255,,,"; + uint8_t expected4[] = {255, 0, 0, 0}; + runStringToDmx(input, DmxBuffer(expected4, sizeof(expected4))); + + input = "255,,,10"; + uint8_t expected5[] = {255, 0, 0, 10}; + runStringToDmx(input, DmxBuffer(expected5, sizeof(expected5))); + + input = " 266,,,10 "; + uint8_t expected6[] = {10, 0, 0, 10}; + runStringToDmx(input, DmxBuffer(expected6, sizeof(expected6))); + + input = ""; + uint8_t expected7[] = {}; + runStringToDmx(input, DmxBuffer(expected7, sizeof(expected7))); +} + + +/* + * Check that we make a copy of the buffers before writing + */ +void DmxBufferTest::testCopyOnWrite() { + string initial_data; + initial_data.append((const char*) TEST_DATA2, sizeof(TEST_DATA2)); + // these are used for comparisons and don't change + const DmxBuffer buffer3(TEST_DATA3, sizeof(TEST_DATA3)); + const DmxBuffer merge_result(MERGE_RESULT2, sizeof(MERGE_RESULT2)); + DmxBuffer src_buffer(initial_data); + DmxBuffer dest_buffer(src_buffer); + + // Check HTPMerge + dest_buffer.HTPMerge(buffer3); + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT(merge_result == dest_buffer); + dest_buffer = src_buffer; + // Check the other way + src_buffer.HTPMerge(buffer3); + CPPUNIT_ASSERT(merge_result == src_buffer); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer = dest_buffer; + + // Check Set works + dest_buffer.Set(TEST_DATA3, sizeof(TEST_DATA3)); + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT(buffer3 == dest_buffer); + dest_buffer = src_buffer; + // Check it works the other way + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer.Set(TEST_DATA3, sizeof(TEST_DATA3)); + CPPUNIT_ASSERT(buffer3 == src_buffer); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer = dest_buffer; + + // Check that SetFromString works + dest_buffer = src_buffer; + dest_buffer.SetFromString("10,11,12"); + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT(buffer3 == dest_buffer); + dest_buffer = src_buffer; + // Check it works the other way + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer.SetFromString("10,11,12"); + CPPUNIT_ASSERT(buffer3 == src_buffer); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer = dest_buffer; + + // Check the SetChannel() method, this should force a copy. + dest_buffer.SetChannel(0, 244); + string expected_change = initial_data; + expected_change[0] = 244; + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT_EQUAL(expected_change, dest_buffer.Get()); + dest_buffer = src_buffer; + // Check it works the other way + CPPUNIT_ASSERT_EQUAL(initial_data, src_buffer.Get()); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer.SetChannel(0, 234); + expected_change[0] = 234; + CPPUNIT_ASSERT_EQUAL(expected_change, src_buffer.Get()); + CPPUNIT_ASSERT_EQUAL(initial_data, dest_buffer.Get()); + src_buffer.Set(initial_data); +} + + +/* + * Check that SetRange works. + */ +void DmxBufferTest::testSetRange() { + unsigned int data_size = sizeof(TEST_DATA); + DmxBuffer buffer; + CPPUNIT_ASSERT(!buffer.SetRange(0, NULL, data_size)); + CPPUNIT_ASSERT(!buffer.SetRange(600, TEST_DATA, data_size)); + + // Setting an uninitialized buffer calls blackout first + CPPUNIT_ASSERT(buffer.SetRange(0, TEST_DATA, data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw(), data_size)); + + // try overrunning the buffer + CPPUNIT_ASSERT(buffer.SetRange(DMX_UNIVERSE_SIZE - 2, TEST_DATA, data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw() + DMX_UNIVERSE_SIZE - 2, + 2)); + + // reset the buffer so that the valid data is 0, and try again + buffer.Reset(); + CPPUNIT_ASSERT(buffer.SetRange(0, TEST_DATA, data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) data_size, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw(), data_size)); + + // setting past the end of the valid data should fail + CPPUNIT_ASSERT(!buffer.SetRange(50, TEST_DATA, data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) data_size, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw(), buffer.Size())); + + // overwrite part of the valid data + unsigned int offset = 2; + CPPUNIT_ASSERT(buffer.SetRange(offset, TEST_DATA, data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) data_size + offset, + buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw(), offset)); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw() + offset, + buffer.Size() - offset)); + + // now try writing 1 channel past the valid data + buffer.Reset(); + CPPUNIT_ASSERT(buffer.SetRange(0, TEST_DATA, data_size)); + CPPUNIT_ASSERT(buffer.SetRange(data_size, TEST_DATA, + data_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) data_size * 2, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw(), data_size)); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer.GetRaw() + data_size, data_size)); +} + + +/* + * Check that SetRangeToValue works + */ +void DmxBufferTest::testSetRangeToValue() { + const uint8_t RANGE_DATA[] = {50, 50, 50, 50, 50}; + DmxBuffer buffer; + CPPUNIT_ASSERT(!buffer.SetRangeToValue(600, 50, 2)); + + unsigned int range_size = 5; + CPPUNIT_ASSERT(buffer.SetRangeToValue(0, 50, range_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(RANGE_DATA, buffer.GetRaw(), range_size)); + + // setting outside the value range should fail + buffer.Reset(); + CPPUNIT_ASSERT(!buffer.SetRange(10, TEST_DATA, range_size)); +} + + +/* + * Check that SetChannel works + */ +void DmxBufferTest::testSetChannel() { + DmxBuffer buffer; + buffer.SetChannel(1, 10); + buffer.SetChannel(10, 50); + + uint8_t expected[DMX_UNIVERSE_SIZE]; + memset(expected, 0, DMX_UNIVERSE_SIZE); + expected[1] = 10; + expected[10] = 50; + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(expected, buffer.GetRaw(), buffer.Size())); + + // Check we can't set values greater than the buffer size + buffer.SetChannel(999, 50); + CPPUNIT_ASSERT_EQUAL((unsigned int) DMX_UNIVERSE_SIZE, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(expected, buffer.GetRaw(), buffer.Size())); + + // Check we can't set values outside the current valida data range + unsigned int slice_size = 20; + buffer.Set(expected, slice_size); + buffer.SetChannel(30, 90); + buffer.SetChannel(200, 10); + + CPPUNIT_ASSERT_EQUAL(slice_size, buffer.Size()); + CPPUNIT_ASSERT(!memcmp(expected, buffer.GetRaw(), buffer.Size())); +} + + +/* + * Test ToString() + */ +void DmxBufferTest::testToString() { + DmxBuffer buffer; + CPPUNIT_ASSERT_EQUAL(string(""), buffer.ToString()); + + buffer.SetFromString("1,2,3,4"); + CPPUNIT_ASSERT_EQUAL(string("4: 1,2,3,4"), buffer.ToString()); + + buffer.SetRangeToValue(0, 255, 5); + CPPUNIT_ASSERT_EQUAL(string("5: 255,255,255,255,255"), buffer.ToString()); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.am new file mode 100644 index 0000000..ed99f09 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.am @@ -0,0 +1,15 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = libolautils.la +libolautils_la_SOURCES = ActionQueue.cpp DmxBuffer.cpp OlaThread.cpp \ + RunLengthEncoder.cpp StringUtils.cpp TokenBucket.cpp + +TESTS = UtilsTester +check_PROGRAMS = $(TESTS) +UtilsTester_SOURCES = ActionQueueTest.cpp ClockTest.cpp ClosureTest.cpp \ + DmxBufferTest.cpp OlaThreadTest.cpp \ + RunLengthEncoderTest.cpp StringUtilsTest.cpp \ + UtilsTester.cpp +UtilsTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +UtilsTester_LDFLAGS = $(CPPUNIT_LIBS) +UtilsTester_LDADD = libolautils.la ../logging/liblogging.la diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.in new file mode 100644 index 0000000..af5a3d0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/Makefile.in @@ -0,0 +1,699 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = UtilsTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/utils +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolautils_la_LIBADD = +am_libolautils_la_OBJECTS = ActionQueue.lo DmxBuffer.lo OlaThread.lo \ + RunLengthEncoder.lo StringUtils.lo TokenBucket.lo +libolautils_la_OBJECTS = $(am_libolautils_la_OBJECTS) +am__EXEEXT_1 = UtilsTester$(EXEEXT) +am_UtilsTester_OBJECTS = UtilsTester-ActionQueueTest.$(OBJEXT) \ + UtilsTester-ClockTest.$(OBJEXT) \ + UtilsTester-ClosureTest.$(OBJEXT) \ + UtilsTester-DmxBufferTest.$(OBJEXT) \ + UtilsTester-OlaThreadTest.$(OBJEXT) \ + UtilsTester-RunLengthEncoderTest.$(OBJEXT) \ + UtilsTester-StringUtilsTest.$(OBJEXT) \ + UtilsTester-UtilsTester.$(OBJEXT) +UtilsTester_OBJECTS = $(am_UtilsTester_OBJECTS) +UtilsTester_DEPENDENCIES = libolautils.la ../logging/liblogging.la +UtilsTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(UtilsTester_CXXFLAGS) \ + $(CXXFLAGS) $(UtilsTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolautils_la_SOURCES) $(UtilsTester_SOURCES) +DIST_SOURCES = $(libolautils_la_SOURCES) $(UtilsTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libolautils.la +libolautils_la_SOURCES = ActionQueue.cpp DmxBuffer.cpp OlaThread.cpp \ + RunLengthEncoder.cpp StringUtils.cpp TokenBucket.cpp + +UtilsTester_SOURCES = ActionQueueTest.cpp ClockTest.cpp ClosureTest.cpp \ + DmxBufferTest.cpp OlaThreadTest.cpp \ + RunLengthEncoderTest.cpp StringUtilsTest.cpp \ + UtilsTester.cpp + +UtilsTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +UtilsTester_LDFLAGS = $(CPPUNIT_LIBS) +UtilsTester_LDADD = libolautils.la ../logging/liblogging.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/utils/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/utils/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolautils.la: $(libolautils_la_OBJECTS) $(libolautils_la_DEPENDENCIES) + $(CXXLINK) $(libolautils_la_OBJECTS) $(libolautils_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +UtilsTester$(EXEEXT): $(UtilsTester_OBJECTS) $(UtilsTester_DEPENDENCIES) + @rm -f UtilsTester$(EXEEXT) + $(UtilsTester_LINK) $(UtilsTester_OBJECTS) $(UtilsTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ActionQueue.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DmxBuffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaThread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RunLengthEncoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringUtils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TokenBucket.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-ActionQueueTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-ClockTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-ClosureTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-DmxBufferTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-OlaThreadTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-RunLengthEncoderTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-StringUtilsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilsTester-UtilsTester.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +UtilsTester-ActionQueueTest.o: ActionQueueTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ActionQueueTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-ActionQueueTest.Tpo -c -o UtilsTester-ActionQueueTest.o `test -f 'ActionQueueTest.cpp' || echo '$(srcdir)/'`ActionQueueTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ActionQueueTest.Tpo $(DEPDIR)/UtilsTester-ActionQueueTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ActionQueueTest.cpp' object='UtilsTester-ActionQueueTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ActionQueueTest.o `test -f 'ActionQueueTest.cpp' || echo '$(srcdir)/'`ActionQueueTest.cpp + +UtilsTester-ActionQueueTest.obj: ActionQueueTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ActionQueueTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-ActionQueueTest.Tpo -c -o UtilsTester-ActionQueueTest.obj `if test -f 'ActionQueueTest.cpp'; then $(CYGPATH_W) 'ActionQueueTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ActionQueueTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ActionQueueTest.Tpo $(DEPDIR)/UtilsTester-ActionQueueTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ActionQueueTest.cpp' object='UtilsTester-ActionQueueTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ActionQueueTest.obj `if test -f 'ActionQueueTest.cpp'; then $(CYGPATH_W) 'ActionQueueTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ActionQueueTest.cpp'; fi` + +UtilsTester-ClockTest.o: ClockTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ClockTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-ClockTest.Tpo -c -o UtilsTester-ClockTest.o `test -f 'ClockTest.cpp' || echo '$(srcdir)/'`ClockTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ClockTest.Tpo $(DEPDIR)/UtilsTester-ClockTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClockTest.cpp' object='UtilsTester-ClockTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ClockTest.o `test -f 'ClockTest.cpp' || echo '$(srcdir)/'`ClockTest.cpp + +UtilsTester-ClockTest.obj: ClockTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ClockTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-ClockTest.Tpo -c -o UtilsTester-ClockTest.obj `if test -f 'ClockTest.cpp'; then $(CYGPATH_W) 'ClockTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClockTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ClockTest.Tpo $(DEPDIR)/UtilsTester-ClockTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClockTest.cpp' object='UtilsTester-ClockTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ClockTest.obj `if test -f 'ClockTest.cpp'; then $(CYGPATH_W) 'ClockTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClockTest.cpp'; fi` + +UtilsTester-ClosureTest.o: ClosureTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ClosureTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-ClosureTest.Tpo -c -o UtilsTester-ClosureTest.o `test -f 'ClosureTest.cpp' || echo '$(srcdir)/'`ClosureTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ClosureTest.Tpo $(DEPDIR)/UtilsTester-ClosureTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClosureTest.cpp' object='UtilsTester-ClosureTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ClosureTest.o `test -f 'ClosureTest.cpp' || echo '$(srcdir)/'`ClosureTest.cpp + +UtilsTester-ClosureTest.obj: ClosureTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-ClosureTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-ClosureTest.Tpo -c -o UtilsTester-ClosureTest.obj `if test -f 'ClosureTest.cpp'; then $(CYGPATH_W) 'ClosureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClosureTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-ClosureTest.Tpo $(DEPDIR)/UtilsTester-ClosureTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClosureTest.cpp' object='UtilsTester-ClosureTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-ClosureTest.obj `if test -f 'ClosureTest.cpp'; then $(CYGPATH_W) 'ClosureTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClosureTest.cpp'; fi` + +UtilsTester-DmxBufferTest.o: DmxBufferTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-DmxBufferTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-DmxBufferTest.Tpo -c -o UtilsTester-DmxBufferTest.o `test -f 'DmxBufferTest.cpp' || echo '$(srcdir)/'`DmxBufferTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-DmxBufferTest.Tpo $(DEPDIR)/UtilsTester-DmxBufferTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DmxBufferTest.cpp' object='UtilsTester-DmxBufferTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-DmxBufferTest.o `test -f 'DmxBufferTest.cpp' || echo '$(srcdir)/'`DmxBufferTest.cpp + +UtilsTester-DmxBufferTest.obj: DmxBufferTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-DmxBufferTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-DmxBufferTest.Tpo -c -o UtilsTester-DmxBufferTest.obj `if test -f 'DmxBufferTest.cpp'; then $(CYGPATH_W) 'DmxBufferTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DmxBufferTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-DmxBufferTest.Tpo $(DEPDIR)/UtilsTester-DmxBufferTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DmxBufferTest.cpp' object='UtilsTester-DmxBufferTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-DmxBufferTest.obj `if test -f 'DmxBufferTest.cpp'; then $(CYGPATH_W) 'DmxBufferTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DmxBufferTest.cpp'; fi` + +UtilsTester-OlaThreadTest.o: OlaThreadTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-OlaThreadTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-OlaThreadTest.Tpo -c -o UtilsTester-OlaThreadTest.o `test -f 'OlaThreadTest.cpp' || echo '$(srcdir)/'`OlaThreadTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-OlaThreadTest.Tpo $(DEPDIR)/UtilsTester-OlaThreadTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaThreadTest.cpp' object='UtilsTester-OlaThreadTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-OlaThreadTest.o `test -f 'OlaThreadTest.cpp' || echo '$(srcdir)/'`OlaThreadTest.cpp + +UtilsTester-OlaThreadTest.obj: OlaThreadTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-OlaThreadTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-OlaThreadTest.Tpo -c -o UtilsTester-OlaThreadTest.obj `if test -f 'OlaThreadTest.cpp'; then $(CYGPATH_W) 'OlaThreadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaThreadTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-OlaThreadTest.Tpo $(DEPDIR)/UtilsTester-OlaThreadTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaThreadTest.cpp' object='UtilsTester-OlaThreadTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-OlaThreadTest.obj `if test -f 'OlaThreadTest.cpp'; then $(CYGPATH_W) 'OlaThreadTest.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaThreadTest.cpp'; fi` + +UtilsTester-RunLengthEncoderTest.o: RunLengthEncoderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-RunLengthEncoderTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Tpo -c -o UtilsTester-RunLengthEncoderTest.o `test -f 'RunLengthEncoderTest.cpp' || echo '$(srcdir)/'`RunLengthEncoderTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Tpo $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthEncoderTest.cpp' object='UtilsTester-RunLengthEncoderTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-RunLengthEncoderTest.o `test -f 'RunLengthEncoderTest.cpp' || echo '$(srcdir)/'`RunLengthEncoderTest.cpp + +UtilsTester-RunLengthEncoderTest.obj: RunLengthEncoderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-RunLengthEncoderTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Tpo -c -o UtilsTester-RunLengthEncoderTest.obj `if test -f 'RunLengthEncoderTest.cpp'; then $(CYGPATH_W) 'RunLengthEncoderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthEncoderTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Tpo $(DEPDIR)/UtilsTester-RunLengthEncoderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthEncoderTest.cpp' object='UtilsTester-RunLengthEncoderTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-RunLengthEncoderTest.obj `if test -f 'RunLengthEncoderTest.cpp'; then $(CYGPATH_W) 'RunLengthEncoderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthEncoderTest.cpp'; fi` + +UtilsTester-StringUtilsTest.o: StringUtilsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-StringUtilsTest.o -MD -MP -MF $(DEPDIR)/UtilsTester-StringUtilsTest.Tpo -c -o UtilsTester-StringUtilsTest.o `test -f 'StringUtilsTest.cpp' || echo '$(srcdir)/'`StringUtilsTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-StringUtilsTest.Tpo $(DEPDIR)/UtilsTester-StringUtilsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StringUtilsTest.cpp' object='UtilsTester-StringUtilsTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-StringUtilsTest.o `test -f 'StringUtilsTest.cpp' || echo '$(srcdir)/'`StringUtilsTest.cpp + +UtilsTester-StringUtilsTest.obj: StringUtilsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-StringUtilsTest.obj -MD -MP -MF $(DEPDIR)/UtilsTester-StringUtilsTest.Tpo -c -o UtilsTester-StringUtilsTest.obj `if test -f 'StringUtilsTest.cpp'; then $(CYGPATH_W) 'StringUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StringUtilsTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-StringUtilsTest.Tpo $(DEPDIR)/UtilsTester-StringUtilsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StringUtilsTest.cpp' object='UtilsTester-StringUtilsTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-StringUtilsTest.obj `if test -f 'StringUtilsTest.cpp'; then $(CYGPATH_W) 'StringUtilsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StringUtilsTest.cpp'; fi` + +UtilsTester-UtilsTester.o: UtilsTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-UtilsTester.o -MD -MP -MF $(DEPDIR)/UtilsTester-UtilsTester.Tpo -c -o UtilsTester-UtilsTester.o `test -f 'UtilsTester.cpp' || echo '$(srcdir)/'`UtilsTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-UtilsTester.Tpo $(DEPDIR)/UtilsTester-UtilsTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilsTester.cpp' object='UtilsTester-UtilsTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-UtilsTester.o `test -f 'UtilsTester.cpp' || echo '$(srcdir)/'`UtilsTester.cpp + +UtilsTester-UtilsTester.obj: UtilsTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -MT UtilsTester-UtilsTester.obj -MD -MP -MF $(DEPDIR)/UtilsTester-UtilsTester.Tpo -c -o UtilsTester-UtilsTester.obj `if test -f 'UtilsTester.cpp'; then $(CYGPATH_W) 'UtilsTester.cpp'; else $(CYGPATH_W) '$(srcdir)/UtilsTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/UtilsTester-UtilsTester.Tpo $(DEPDIR)/UtilsTester-UtilsTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilsTester.cpp' object='UtilsTester-UtilsTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(UtilsTester_CXXFLAGS) $(CXXFLAGS) -c -o UtilsTester-UtilsTester.obj `if test -f 'UtilsTester.cpp'; then $(CYGPATH_W) 'UtilsTester.cpp'; else $(CYGPATH_W) '$(srcdir)/UtilsTester.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/OlaThread.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/OlaThread.cpp new file mode 100644 index 0000000..86fce0f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/OlaThread.cpp @@ -0,0 +1,62 @@ +/* + * 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 Library 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. + * + * OlaThread.cpp + * A simple thread class + * Copyright (C) 2010 Simon Newton + */ + +#include "ola/Logging.h" +#include "ola/OlaThread.h" + +namespace ola { + +/* + * Called by the new thread + */ +void *StartThread(void *d) { + OlaThread *thread = reinterpret_cast(d); + return thread->Run(); +} + + +/* + * Start this thread + */ +bool OlaThread::Start() { + int ret = pthread_create(&m_thread_id, + NULL, + ola::StartThread, + reinterpret_cast(this)); + if (ret) { + OLA_WARN << "pthread create failed"; + return false; + } + return true; +} + + +/* + * Join this thread + */ +bool OlaThread::Join(void *ptr) { + if (m_thread_id) { + int ret = pthread_join(m_thread_id, &ptr); + m_thread_id = 0; + return 0 == ret; + } + return false; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/OlaThreadTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/OlaThreadTest.cpp new file mode 100644 index 0000000..18aee6f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/OlaThreadTest.cpp @@ -0,0 +1,66 @@ +/* + * 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 Library 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. + * + * OlaThreadTest.cpp + * Test fixture for the OlaThread class + * Copyright (C) 2010 Simon Newton + */ + +#include + +#include "ola/OlaThread.h" + +using ola::OlaThread; + +class OlaThreadTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(OlaThreadTest); + CPPUNIT_TEST(testOlaThread); + CPPUNIT_TEST_SUITE_END(); + + public: + void testOlaThread(); +}; + +class MockThread: public OlaThread { + public: + MockThread() + : OlaThread(), + thread_ran(false) { + } + ~MockThread() {} + + void *Run() { + thread_ran = true; + return NULL; + } + + bool thread_ran; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(OlaThreadTest); + + +/* + * Check that basic thread functionality works. + */ +void OlaThreadTest::testOlaThread() { + MockThread thread; + CPPUNIT_ASSERT(!thread.thread_ran); + thread.Start(); + CPPUNIT_ASSERT(thread.IsRunning()); + CPPUNIT_ASSERT(thread.Join()); + CPPUNIT_ASSERT(thread.thread_ran); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoder.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoder.cpp new file mode 100644 index 0000000..f9f8ab4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoder.cpp @@ -0,0 +1,135 @@ +/* + * 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 Library 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. + * + * RunLengthEncoder.cpp + * The Run Length Encoder + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include + +namespace ola { + +/* + * Take a DMXBuffer and RunLengthEncode the data + * @param src the DmxBuffer with the DMX data + * @param data where to store the RLE data + * @param size the size of the data segment, set to the amount of data encoded + * @return true if we encoded all data, false if we ran out of space + */ +bool RunLengthEncoder::Encode(const DmxBuffer &src, + uint8_t *data, + unsigned int &data_size) { + unsigned int src_size = src.Size(); + unsigned int dst_size = data_size; + unsigned int &dst_index = data_size; + dst_index = 0; + + unsigned int i; + for (i = 0; i < src_size && dst_index < dst_size;) { + // j points to the first non-repeating value + unsigned int j = i + 1; + while (j < src_size && src.Get(i) == src.Get(j) && j - i < 0x7f) { + j++; + } + + // if the number of repeats is more than 2 + // don't encode only two repeats, + if (j - i > 2) { + // if room left in dst buffer + if (dst_size - dst_index > 1) { + data[dst_index++] = (REPEAT_FLAG | (j - i)); + data[dst_index++] = src.Get(i); + } else { + // else return what we have done so far + return false; + } + i = j; + + } else { + // this value doesn't repeat more than twice + // find out where the next repeat starts + + // postcondition: j is one more than the last value we want to send + for (j = i + 1; j < src_size - 2 && j - i < 0x7f; j++) { + // at the end of the array + if (j == src_size - 2) { + j = src_size; + break; + } + + // if we're found a repeat of 3 or more stop here + if (src.Get(j) == src.Get(j+1) && src.Get(j) == src.Get(j+2)) + break; + } + if (j >= src_size - 2) + j = src_size; + + // if we have enough room left for all the values + if (dst_index + j - i < dst_size) { + data[dst_index++] = j - i; + memcpy(&data[dst_index], src.GetRaw() + i, j-i); + dst_index += j - i; + i = j; + + // see how much data we can get in + } else if (dst_size - dst_index > 1) { + unsigned int l = dst_size - dst_index -1; + data[dst_index++] = l; + memcpy(&data[dst_index], src.GetRaw() + i, l); + dst_index += l; + return false; + } else { + return false; + } + } + } + + if (i < src_size) + return false; + else + return true; +} + + +/* + * Decode the RLE'ed data into a DmxBuffer. + * @param dst the DmxBuffer to store the result + * @param start_channel the first channel for the RLE'ed data + * @param src_data the data to decode + * @param length the length of the data to decode + */ +bool RunLengthEncoder::Decode(DmxBuffer *dst, + unsigned int start_channel, + const uint8_t *src_data, + unsigned int length) { + int destination_index = start_channel; + + for (unsigned int i = 0; i < length;) { + unsigned int segment_length = src_data[i] & (~REPEAT_FLAG); + if (src_data[i] & REPEAT_FLAG) { + i++; + dst->SetRangeToValue(destination_index, src_data[i++], segment_length); + } else { + i++; + dst->SetRange(destination_index, src_data + i, segment_length); + i += segment_length; + } + destination_index += segment_length; + } + return true; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoderTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoderTest.cpp new file mode 100644 index 0000000..f0d3b9b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/RunLengthEncoderTest.cpp @@ -0,0 +1,167 @@ +/* + * 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 Library 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. + * + * RunLengthEncoderTest.cpp + * Test fixture for the RunLengthEncoder class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/DmxBuffer.h" +#include "ola/RunLengthEncoder.h" + +using ola::RunLengthEncoder; +using ola::DmxBuffer; + +class RunLengthEncoderTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RunLengthEncoderTest); + CPPUNIT_TEST(testEncode); + CPPUNIT_TEST(testEncode2); + CPPUNIT_TEST_SUITE_END(); + + public: + void testEncode(); + void testEncode2(); + void testEncodeDecode(); + void setUp(); + void tearDown(); + private: + ola::RunLengthEncoder m_encoder; + uint8_t *m_dst; + + void checkEncode(const DmxBuffer &buffer, + unsigned int dst_size, + bool is_incomplete, + const uint8_t *expected_data, + unsigned int expected_length); + void checkEncodeDecode(const uint8_t *data, unsigned int data_size); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(RunLengthEncoderTest); + + +/* + * allocate a scratch pad + */ +void RunLengthEncoderTest::setUp() { + m_dst = new uint8_t[DMX_UNIVERSE_SIZE]; +} + + +/* + * clean up + */ +void RunLengthEncoderTest::tearDown() { + delete[] m_dst; +} + + +/* + * Check that for a given buffer and dst buffer size, we get the expected data + */ +void RunLengthEncoderTest::checkEncode(const DmxBuffer &buffer, + unsigned int dst_size, + bool is_complete, + const uint8_t *expected_data, + unsigned int expected_length) { + memset(m_dst, 0, DMX_UNIVERSE_SIZE); + CPPUNIT_ASSERT_EQUAL(is_complete, + m_encoder.Encode(buffer, m_dst, dst_size)); + CPPUNIT_ASSERT_EQUAL(expected_length, dst_size); + CPPUNIT_ASSERT(!memcmp(expected_data, m_dst, dst_size)); +} + + +/* + * Check that encoding works. + */ +void RunLengthEncoderTest::testEncode() { + const uint8_t TEST_DATA[] = {1, 2, 2, 3, 0, 0, 0, 1, 3, 3, 3, 1, 2}; + const uint8_t EXPECTED_DATA[] = {4, 1, 2, 2, 3, 0x83, 0, 1, 1, 0x83, 3, 2, + 1, 2}; + const uint8_t EXPECTED_DATA2[] = {3, 1, 2, 2}; + const uint8_t EXPECTED_DATA3[] = {4, 1, 2, 2, 3, 0x83, 0, 1, 1, 0x83, 3, 1, + 1}; + DmxBuffer buffer(TEST_DATA, sizeof(TEST_DATA)); + + checkEncode(buffer, DMX_UNIVERSE_SIZE, true, EXPECTED_DATA, + sizeof(EXPECTED_DATA)); + + checkEncode(buffer, 4, false, EXPECTED_DATA2, sizeof(EXPECTED_DATA2)); + checkEncode(buffer, 5, false, EXPECTED_DATA, 5); + checkEncode(buffer, 6, false, EXPECTED_DATA, 5); + checkEncode(buffer, 7, false, EXPECTED_DATA, 7); + checkEncode(buffer, 8, false, EXPECTED_DATA, 7); + checkEncode(buffer, 9, false, EXPECTED_DATA, 9); + checkEncode(buffer, 10, false, EXPECTED_DATA, 9); + checkEncode(buffer, 11, false, EXPECTED_DATA, 11); + checkEncode(buffer, 12, false, EXPECTED_DATA, 11); + checkEncode(buffer, 13, false, EXPECTED_DATA3, sizeof(EXPECTED_DATA3)); +} + + +/* + * Check that encoding works. + */ +void RunLengthEncoderTest::testEncode2() { + const uint8_t TEST_DATA[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + const uint8_t EXPECTED_DATA[] = {0x8A, 0}; + DmxBuffer buffer(TEST_DATA, sizeof(TEST_DATA)); + + checkEncode(buffer, DMX_UNIVERSE_SIZE, true, EXPECTED_DATA, + sizeof(EXPECTED_DATA)); + + checkEncode(buffer, 2, true, EXPECTED_DATA, sizeof(EXPECTED_DATA)); + checkEncode(buffer, 1, false, EXPECTED_DATA, 0); + checkEncode(buffer, 0, false, EXPECTED_DATA, 0); +} + + +/* + * Call Encode then Decode and check the results + */ +void RunLengthEncoderTest::checkEncodeDecode(const uint8_t *data, + unsigned int data_size) { + DmxBuffer src(data, data_size); + DmxBuffer dst; + + unsigned int dst_size = DMX_UNIVERSE_SIZE; + memset(m_dst, 0, dst_size); + CPPUNIT_ASSERT(m_encoder.Encode(src, m_dst, dst_size)); + + CPPUNIT_ASSERT(m_encoder.Decode(&dst, 0, m_dst, dst_size)); + CPPUNIT_ASSERT(src == dst); + CPPUNIT_ASSERT_EQUAL(dst.Size(), data_size); + CPPUNIT_ASSERT(!memcmp(data, dst.GetRaw(), dst.Size())); +} + + +/* + * Check that an Encode/Decode pair works + */ +void RunLengthEncoderTest::testEncodeDecode() { + const uint8_t TEST_DATA[] = {1, 2, 2, 3, 0, 0, 0, 1, 3, 3, 3, 1, 2}; + const uint8_t TEST_DATA2[] = {0, 0, 0, 0, 6, 5, 4, 3, 3, 3}; + const uint8_t TEST_DATA3[] = {0, 0, 0}; + + checkEncodeDecode(TEST_DATA, sizeof(TEST_DATA)); + checkEncodeDecode(TEST_DATA2, sizeof(TEST_DATA2)); + checkEncodeDecode(TEST_DATA3, sizeof(TEST_DATA3)); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/StringUtils.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/StringUtils.cpp new file mode 100644 index 0000000..7503ded --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/StringUtils.cpp @@ -0,0 +1,260 @@ +/* + * 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 Library 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. + * + * StringUtils.cpp + * Random String functions. + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ola/StringUtils.h" + +namespace ola { + +using std::string; +using std::stringstream; +using std::vector; + +/* + * Split a string on delimtiers. If two delimiters appear next to each other an + * empty string is added to the output list. + * @param input the string to split + * @param tokens the vector to store the result in + * @param delimiters what to split on + */ +void StringSplit(const string &input, + vector &tokens, + const string &delimiters) { + string::size_type start_offset = 0; + string::size_type end_offset = 0; + + while (1) { + end_offset = input.find_first_of(delimiters, start_offset); + if (end_offset == string::npos) { + tokens.push_back(input.substr(start_offset, input.size() - start_offset)); + return; + } + tokens.push_back(input.substr(start_offset, end_offset - start_offset)); + start_offset = end_offset + 1 > input.size() ? string::npos : + end_offset + 1; + } +} + + +/* + * Trim leading and trailing whitespace from a string. + * @param the string to trim + */ +void StringTrim(std::string *input) { + string characters_to_trim = " \n\r\t"; + string::size_type start = input->find_first_not_of(characters_to_trim); + string::size_type end = input->find_last_not_of(characters_to_trim); + + if (start == string::npos) + input->clear(); + else + *input = input->substr(start, end - start + 1); +} + + +/** + * Take care of any NULLs embedded in the string + * @param the string to shorten + */ +void ShortenString(string *input) { + size_t index = input->find(static_cast(0)); + if (index != string::npos) + input->erase(index); +} + + +/* + * Convert an int to a string. + * @param i the int to convert + * @return the string representation of the int + */ +string IntToString(int i) { + stringstream str; + str << i; + return str.str(); +} + + +/* + * Convert an int to a string. + * @param i the int to convert + * @return the string representation of the int + */ +string IntToString(unsigned int i) { + stringstream str; + str << i; + return str.str(); +} + + +/* + * Convert a string to a unsigned int. + * @returns true if sucessfull, false otherwise + */ +bool StringToUInt(const string &value, unsigned int *output) { + if (value.empty()) + return false; + char *end_ptr; + errno = 0; + long l = strtol(value.data(), &end_ptr, 10); + if (l < 0 || (l == 0 && errno != 0)) + return false; + if (value == end_ptr) + return false; + *output = static_cast(l); + return true; +} + + +/* + * Convert a string to a uint16_t. + * @returns true if sucessfull, false otherwise + */ +bool StringToUInt16(const string &value, uint16_t *output) { + unsigned int v; + if (!StringToUInt(value, &v)) + return false; + if (v > 0xffff) + return false; + *output = static_cast(v); + return true; +} + + +/* + * Convert a string to a uint16_t. + * @returns true if sucessfull, false otherwise + */ +bool StringToUInt8(const string &value, uint8_t *output) { + unsigned int v; + if (!StringToUInt(value, &v)) + return false; + if (v > 0xff) + return false; + *output = static_cast(v); + return true; +} + + +/* + * Escape \ + */ +void Escape(string *original) { + for (string::iterator iter = original->begin(); iter != original->end(); + ++iter) { + switch (*iter) { + case '"': + iter = original->insert(iter, '\\'); + iter++; + break; + case '\\': + iter = original->insert(iter, '\\'); + iter++; + break; + case '/': + iter = original->insert(iter, '\\'); + iter++; + break; + case '\b': + *iter = 'b'; + iter = original->insert(iter, '\\'); + iter++; + break; + case '\f': + *iter = 'f'; + iter = original->insert(iter, '\\'); + iter++; + break; + case '\n': + *iter = 'n'; + iter = original->insert(iter, '\\'); + iter++; + break; + case '\r': + *iter = 'r'; + iter = original->insert(iter, '\\'); + iter++; + break; + case '\t': + *iter = 't'; + iter = original->insert(iter, '\\'); + iter++; + break; + default: + break; + } + } +} + + +/** + * Escape a string, returning a copy + */ +string EscapeString(const string &original) { + string result = original; + Escape(&result); + return result; +} + + +/* + * Convert a hex string to a unsigned int + */ +bool HexStringToUInt(const string &value, unsigned int *output) { + if (value.empty()) + return false; + + size_t found = value.find_first_not_of("ABCDEFabcdef0123456789"); + if (found != string::npos) + return false; + *output = strtoul(value.data(), NULL, 16); + return true; +} + + +/* + * Convert a hex string to a uint16_t + */ +bool HexStringToUInt16(const string &value, uint16_t *output) { + unsigned int v; + if (!HexStringToUInt(value, &v)) + return false; + if (v > 0xffff) + return false; + *output = static_cast(v); + return true; +} + + +/* + * Return a lower case version of this string + */ +void ToLower(string *s) { + std::transform(s->begin(), s->end(), s->begin(), + std::ptr_fun(std::tolower)); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/StringUtilsTest.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/StringUtilsTest.cpp new file mode 100644 index 0000000..4c1e225 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/StringUtilsTest.cpp @@ -0,0 +1,339 @@ +/* + * 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 Library 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. + * + * StringUtilsTest.cpp + * Unittest for String functions. + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include "ola/StringUtils.h" + +using std::string; +using std::vector; +using ola::Escape; +using ola::EscapeString; +using ola::HexStringToUInt16; +using ola::HexStringToUInt; +using ola::IntToString; +using ola::ShortenString; +using ola::StringSplit; +using ola::StringToUInt16; +using ola::StringToUInt8; +using ola::StringToUInt; +using ola::StringTrim; +using ola::ToLower; + +class StringUtilsTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(StringUtilsTest); + CPPUNIT_TEST(testSplit); + CPPUNIT_TEST(testTrim); + CPPUNIT_TEST(testShorten); + CPPUNIT_TEST(testIntToString); + CPPUNIT_TEST(testEscape); + CPPUNIT_TEST(testStringToUInt); + CPPUNIT_TEST(testStringToUInt16); + CPPUNIT_TEST(testStringToUInt8); + CPPUNIT_TEST(testHexStringToUInt); + CPPUNIT_TEST(testToLower); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSplit(); + void testTrim(); + void testShorten(); + void testIntToString(); + void testEscape(); + void testStringToUInt(); + void testStringToUInt16(); + void testStringToUInt8(); + void testHexStringToUInt(); + void testToLower(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(StringUtilsTest); + +/* + * Test the split function + */ +void StringUtilsTest::testSplit() { + vector tokens; + string input = ""; + StringSplit(input, tokens); + CPPUNIT_ASSERT_EQUAL((size_t) 1, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string(""), tokens[0]); + + input = "1 2 345"; + tokens.clear(); + StringSplit(input, tokens); + + CPPUNIT_ASSERT_EQUAL((size_t) 3, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[0]); + CPPUNIT_ASSERT_EQUAL(string("2"), tokens[1]); + CPPUNIT_ASSERT_EQUAL(string("345"), tokens[2]); + + input = "1,2,345"; + tokens.clear(); + StringSplit(input, tokens, ","); + + CPPUNIT_ASSERT_EQUAL((size_t) 3, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[0]); + CPPUNIT_ASSERT_EQUAL(string("2"), tokens[1]); + CPPUNIT_ASSERT_EQUAL(string("345"), tokens[2]); + + input = ",1,2,345,,"; + tokens.clear(); + StringSplit(input, tokens, ","); + + CPPUNIT_ASSERT_EQUAL((size_t) 6, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string(""), tokens[0]); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[1]); + CPPUNIT_ASSERT_EQUAL(string("2"), tokens[2]); + CPPUNIT_ASSERT_EQUAL(string("345"), tokens[3]); + CPPUNIT_ASSERT_EQUAL(string(""), tokens[4]); + CPPUNIT_ASSERT_EQUAL(string(""), tokens[5]); + + input = "1 2,345"; + tokens.clear(); + StringSplit(input, tokens, " ,"); + + CPPUNIT_ASSERT_EQUAL((size_t) 3, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[0]); + CPPUNIT_ASSERT_EQUAL(string("2"), tokens[1]); + CPPUNIT_ASSERT_EQUAL(string("345"), tokens[2]); + + input = "1, 2,345"; + tokens.clear(); + StringSplit(input, tokens, " ,"); + + CPPUNIT_ASSERT_EQUAL((size_t) 4, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[0]); + CPPUNIT_ASSERT_EQUAL(string(""), tokens[1]); + CPPUNIT_ASSERT_EQUAL(string("2"), tokens[2]); + CPPUNIT_ASSERT_EQUAL(string("345"), tokens[3]); + + input = "1"; + tokens.clear(); + StringSplit(input, tokens, "."); + + CPPUNIT_ASSERT_EQUAL((size_t) 1, tokens.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), tokens[0]); +} + + +/* + * Test the trim function. + */ +void StringUtilsTest::testTrim() { + string input = "foo bar baz"; + StringTrim(&input); + CPPUNIT_ASSERT_EQUAL(string("foo bar baz"), input); + input = " \rfoo bar\t\n"; + StringTrim(&input); + CPPUNIT_ASSERT_EQUAL(string("foo bar"), input); + input = " \r\t\n"; + StringTrim(&input); + CPPUNIT_ASSERT_EQUAL(string(""), input); +} + + +/* + * Test the shorten function. + */ +void StringUtilsTest::testShorten() { + string input = "foo bar baz"; + ShortenString(&input); + CPPUNIT_ASSERT_EQUAL(string("foo bar baz"), input); + input = "foo \0bar"; + ShortenString(&input); + CPPUNIT_ASSERT_EQUAL(string("foo "), input); + input = "foo\0bar\0baz"; + StringTrim(&input); + CPPUNIT_ASSERT_EQUAL(string("foo"), input); +} + + +/* + * test the IntToString function. + */ +void StringUtilsTest::testIntToString() { + CPPUNIT_ASSERT_EQUAL(string("0"), IntToString(0)); + CPPUNIT_ASSERT_EQUAL(string("1234"), IntToString(1234)); + CPPUNIT_ASSERT_EQUAL(string("-1234"), IntToString(-1234)); + unsigned int i = 42; + CPPUNIT_ASSERT_EQUAL(string("42"), IntToString(i)); +} + +void StringUtilsTest::testEscape() { + string s1 = "foo\""; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL(string("foo\\\""), s1); + + s1 = "he said \"foo\""; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL(string("he said \\\"foo\\\""), s1); + + s1 = "backslash\\test"; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL(string("backslash\\\\test"), s1); + + s1 = "newline\ntest"; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL(string("newline\\ntest"), s1); + + s1 = "tab\ttest"; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL(string("tab\\ttest"), s1); + + s1 = "one\"two\\three/four\bfive\fsix\nseven\reight\tnine"; + Escape(&s1); + CPPUNIT_ASSERT_EQUAL( + string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"), + s1); + + s1 = "one\"two\\three/four\bfive\fsix\nseven\reight\tnine"; + string result = EscapeString(s1); + CPPUNIT_ASSERT_EQUAL( + string("one\\\"two\\\\three\\/four\\bfive\\fsix\\nseven\\reight\\tnine"), + result); +} + + +void StringUtilsTest::testStringToUInt() { + unsigned int value; + CPPUNIT_ASSERT(!StringToUInt("", &value)); + CPPUNIT_ASSERT(!StringToUInt("-1", &value)); + CPPUNIT_ASSERT(StringToUInt("0", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, value); + CPPUNIT_ASSERT(StringToUInt("1", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, value); + CPPUNIT_ASSERT(StringToUInt("65537", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 65537, value); + CPPUNIT_ASSERT(!StringToUInt("foo", &value)); +} + + +void StringUtilsTest::testHexStringToUInt() { + unsigned int value; + CPPUNIT_ASSERT(!HexStringToUInt("", &value)); + CPPUNIT_ASSERT(!HexStringToUInt("-1", &value)); + + CPPUNIT_ASSERT(HexStringToUInt("0", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, value); + CPPUNIT_ASSERT(HexStringToUInt("1", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, value); + CPPUNIT_ASSERT(HexStringToUInt("a", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 10, value); + CPPUNIT_ASSERT(HexStringToUInt("f", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 15, value); + CPPUNIT_ASSERT(HexStringToUInt("a1", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 161, value); + CPPUNIT_ASSERT(HexStringToUInt("ff", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 255, value); + CPPUNIT_ASSERT(HexStringToUInt("a1", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 161, value); + CPPUNIT_ASSERT(HexStringToUInt("ff", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 255, value); + CPPUNIT_ASSERT(HexStringToUInt("ffff", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 65535, value); + + CPPUNIT_ASSERT(HexStringToUInt("ffffff", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 16777215, value); + CPPUNIT_ASSERT(HexStringToUInt("ffffffff", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4294967295UL, value); + CPPUNIT_ASSERT(HexStringToUInt("ef123456", &value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4010947670UL, value); + CPPUNIT_ASSERT(!HexStringToUInt("fz", &value)); + CPPUNIT_ASSERT(!HexStringToUInt("zfff", &value)); + CPPUNIT_ASSERT(!HexStringToUInt("0xf", &value)); + + // test HexStringToUInt16 + uint16_t value2; + CPPUNIT_ASSERT(!HexStringToUInt16("", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("-1", &value2)); + + CPPUNIT_ASSERT(HexStringToUInt16("0", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 0, value2); + CPPUNIT_ASSERT(HexStringToUInt16("1", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1, value2); + CPPUNIT_ASSERT(HexStringToUInt16("a", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, value2); + CPPUNIT_ASSERT(HexStringToUInt16("f", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 15, value2); + CPPUNIT_ASSERT(HexStringToUInt16("a1", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 161, value2); + CPPUNIT_ASSERT(HexStringToUInt16("ff", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 255, value2); + CPPUNIT_ASSERT(HexStringToUInt16("a1", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 161, value2); + CPPUNIT_ASSERT(HexStringToUInt16("ff", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 255, value2); + CPPUNIT_ASSERT(HexStringToUInt16("ffff", &value2)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 65535, value2); + + CPPUNIT_ASSERT(!HexStringToUInt16("ffffff", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("ffffffff", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("ef123456", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("fz", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("zfff", &value2)); + CPPUNIT_ASSERT(!HexStringToUInt16("0xf", &value2)); +} + + +void StringUtilsTest::testStringToUInt16() { + uint16_t value; + + CPPUNIT_ASSERT(!StringToUInt16("", &value)); + CPPUNIT_ASSERT(!StringToUInt16("-1", &value)); + CPPUNIT_ASSERT(!StringToUInt16("65536", &value)); + + CPPUNIT_ASSERT(StringToUInt16("0", &value)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 0, value); + CPPUNIT_ASSERT(StringToUInt16("1", &value)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1, value); + CPPUNIT_ASSERT(StringToUInt16("143", &value)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 143, value); + CPPUNIT_ASSERT(StringToUInt16("65535", &value)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 65535, value); +} + + +void StringUtilsTest::testStringToUInt8() { + uint8_t value; + + CPPUNIT_ASSERT(!StringToUInt8("", &value)); + CPPUNIT_ASSERT(!StringToUInt8("-1", &value)); + CPPUNIT_ASSERT(!StringToUInt8("256", &value)); + + CPPUNIT_ASSERT(StringToUInt8("0", &value)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, value); + CPPUNIT_ASSERT(StringToUInt8("1", &value)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, value); + CPPUNIT_ASSERT(StringToUInt8("143", &value)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 143, value); + CPPUNIT_ASSERT(StringToUInt8("255", &value)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 255, value); +} + + +void StringUtilsTest::testToLower() { + string s = "HelLo There"; + ToLower(&s); + CPPUNIT_ASSERT_EQUAL(string("hello there"), s); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/TokenBucket.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/TokenBucket.cpp new file mode 100644 index 0000000..e2cecbb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/TokenBucket.cpp @@ -0,0 +1,54 @@ +/* + * 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 Library 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. + * + * TokenBucket.cpp + * Token Bucket implementation. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include "olad/TokenBucket.h" + +namespace ola { + +/* + * Check if we have enough tokens for an operation. Assuming there is enough + * tokens, the count is decremented by one. + * @param now the current time + * @returns true if there is enough tokens, false otherwise + */ +bool TokenBucket::GetToken(const TimeStamp &now) { + Count(now); + if (m_count > 0) { + m_count--; + return true; + } + return false; +} + + +/* + * Get the number of tokens in the bucket + */ +unsigned int TokenBucket::Count(const TimeStamp &now) { + int64_t delta = (now - m_last).AsInt(); + unsigned int tokens = delta * m_rate / USEC_IN_SECONDS; + + m_count = std::min(m_max, m_count + tokens); + if (tokens) + m_last += ola::TimeInterval(tokens * USEC_IN_SECONDS / m_rate); + return m_count; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/utils/UtilsTester.cpp b/open-lighting-architecture/ola-0.8.4/common/utils/UtilsTester.cpp new file mode 100644 index 0000000..d0ff794 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/utils/UtilsTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * UtilsTester.h + * Runs all the utils tests + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/common/web/JsonSections.cpp b/open-lighting-architecture/ola-0.8.4/common/web/JsonSections.cpp new file mode 100644 index 0000000..3354529 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/web/JsonSections.cpp @@ -0,0 +1,171 @@ +/* + * 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 Library 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. + * + * JsonSections.cpp + * This builds the json string for the web UI. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/web/JsonSections.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" + + +namespace ola { +namespace web { + +using std::endl; +using std::pair; +using std::string; +using std::stringstream; +using std::vector; +using ola::EscapeString; + + + +string GenericItem::AsString() const { + stringstream output; + output << " {" << endl; + if (!m_button_text.empty()) + output << " \"button\": \"" << EscapeString(m_button_text) << "\"," + << endl; + output << " \"description\": \"" << EscapeString(m_description) << "\"," + << endl; + if (!m_id.empty()) + output << " \"id\": \"" << EscapeString(m_id) << "\"," << endl; + output << " \"type\": \"" << Type() << "\"," << endl; + output << " \"value\": " << Value() << "," << endl; + output << ExtraProperties(); + output << " }," << endl; + return output.str(); +} + + +string StringItem::Value() const { + return "\"" + EscapeString(m_value) + "\""; +} + + +string UIntItem::ExtraProperties() const { + stringstream output; + if (m_min_set) + output << " \"min\": " << m_min << "," << endl; + if (m_max_set) + output << " \"max\": " << m_max << "," << endl; + return output.str(); +} + + +string BoolItem::Value() const { + return m_value ? "1" : "0"; +} + +string HiddenItem::Value() const { + return "\"" + EscapeString(m_value) + "\""; +} + + +void SelectItem::AddItem(const string &label, const string &value) { + pair p(label, value); + m_values.push_back(p); +} + + +void SelectItem::AddItem(const string &label, unsigned int value) { + AddItem(label, IntToString(value)); +} + +string SelectItem::Value() const { + stringstream str; + str << "[" << endl; + vector >::const_iterator iter; + for (iter = m_values.begin(); iter != m_values.end(); ++iter) { + str << " {" << endl; + str << " \"label\": \"" << EscapeString(iter->first) << "\"," << + endl; + str << " \"value\": \"" << EscapeString(iter->second) << "\"," << + endl; + str << " }," << endl; + } + str << " ]"; + return str.str(); +} + + +string SelectItem::ExtraProperties() const { + stringstream output; + output << " \"selected_offset\": " << m_selected_offset << "," << endl; + return output.str(); +} + + +/** + * Create a new section response + */ +JsonSection::JsonSection(bool allow_refresh) + : m_allow_refresh(allow_refresh), + m_error(""), + m_save_button_text("") { +} + + +/** + * Cleanup + */ +JsonSection::~JsonSection() { + vector::const_iterator iter = m_items.begin(); + for (; iter != m_items.end(); ++iter) { + delete *iter; + } +} + + +/** + * Add an item to this section, ownership is transferred. + */ +void JsonSection::AddItem(const GenericItem *item) { + m_items.push_back(item); +} + + +/* + * Return the section as a string. + */ +string JsonSection::AsString() const { + stringstream output; + output << "{" << endl; + output << " \"refresh\": " << m_allow_refresh << "," << endl; + output << " \"error\": \"" << EscapeString(m_error) << "\"," << endl; + if (!m_save_button_text.empty()) + output << " \"save_button\": \"" << EscapeString(m_save_button_text) << + "\"," << endl; + output << " \"items\": [" << endl; + + vector::const_iterator iter = m_items.begin(); + for (; iter != m_items.end(); ++iter) { + output << (*iter)->AsString(); + } + output << " ]," << endl; + output << "}" << endl; + return output.str(); +} +} // web +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/common/web/JsonSectionsTest.cpp b/open-lighting-architecture/ola-0.8.4/common/web/JsonSectionsTest.cpp new file mode 100644 index 0000000..096be9e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/web/JsonSectionsTest.cpp @@ -0,0 +1,244 @@ +/* + * 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 Library 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. + * + * JsonSectionsTest.cpp + * Unittest for JsonSections classses. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include "ola/web/JsonSections.h" + +using std::string; +using std::vector; +using ola::web::BoolItem; +using ola::web::HiddenItem; +using ola::web::JsonSection; +using ola::web::SelectItem; +using ola::web::StringItem; +using ola::web::UIntItem; + +class JsonSectionsTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(JsonSectionsTest); + CPPUNIT_TEST(testStringItem); + CPPUNIT_TEST(testUIntItem); + CPPUNIT_TEST(testSelectItem); + CPPUNIT_TEST(testBoolItem); + CPPUNIT_TEST(testHiddenItem); + CPPUNIT_TEST(testSection); + CPPUNIT_TEST_SUITE_END(); + + public: + void testStringItem(); + void testUIntItem(); + void testSelectItem(); + void testBoolItem(); + void testHiddenItem(); + void testSection(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(JsonSectionsTest); + +/* + * Test the string item + */ +void JsonSectionsTest::testStringItem() { + StringItem item("Foo", "bar"); + string expected = + " {\n" + " \"description\": \"Foo\",\n" + " \"type\": \"string\",\n" + " \"value\": \"bar\",\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected, item.AsString()); + + StringItem item2("Foo", "bar", "baz"); + item2.SetButtonText("Action"); + string expected2 = + " {\n" + " \"button\": \"Action\",\n" + " \"description\": \"Foo\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"string\",\n" + " \"value\": \"bar\",\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected2, item2.AsString()); + + StringItem item3("Foo\" bar", "baz\\"); + item3.SetButtonText("Action\n"); + string expected3 = + " {\n" + " \"button\": \"Action\\n\",\n" + " \"description\": \"Foo\\\" bar\",\n" + " \"type\": \"string\",\n" + " \"value\": \"baz\\\\\",\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected3, item3.AsString()); +} + + +/* + * Test the uint item + */ +void JsonSectionsTest::testUIntItem() { + UIntItem item("Foo", 10); + string expected = + " {\n" + " \"description\": \"Foo\",\n" + " \"type\": \"uint\",\n" + " \"value\": 10,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected, item.AsString()); + + UIntItem item2("Foo", 20, "baz"); + item2.SetButtonText("Action"); + item2.SetMin(10); + string expected2 = + " {\n" + " \"button\": \"Action\",\n" + " \"description\": \"Foo\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"uint\",\n" + " \"value\": 20,\n" + " \"min\": 10,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected2, item2.AsString()); + + UIntItem item3("Foo", 20); + item3.SetMax(30); + string expected3 = + " {\n" + " \"description\": \"Foo\",\n" + " \"type\": \"uint\",\n" + " \"value\": 20,\n" + " \"max\": 30,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected3, item3.AsString()); + + UIntItem item4("Foo", 20); + item4.SetMin(10); + item4.SetMax(30); + string expected4 = + " {\n" + " \"description\": \"Foo\",\n" + " \"type\": \"uint\",\n" + " \"value\": 20,\n" + " \"min\": 10,\n" + " \"max\": 30,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected4, item4.AsString()); +} + + +/* + * Test the select item + */ +void JsonSectionsTest::testSelectItem() { + SelectItem item("Language", "lang"); + item.AddItem("English", "EN"); + item.AddItem("German", 2); + item.SetSelectedOffset(1); + string expected = + " {\n" + " \"description\": \"Language\",\n" + " \"id\": \"lang\",\n" + " \"type\": \"select\",\n" + " \"value\": [\n" + " {\n" + " \"label\": \"English\",\n" + " \"value\": \"EN\",\n" + " },\n" + " {\n" + " \"label\": \"German\",\n" + " \"value\": \"2\",\n" + " },\n" + " ],\n" + " \"selected_offset\": 1,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected, item.AsString()); +} + + +/* + * Test the bool item + */ +void JsonSectionsTest::testBoolItem() { + BoolItem item("Foo", true, "baz"); + string expected = + " {\n" + " \"description\": \"Foo\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"bool\",\n" + " \"value\": 1,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected, item.AsString()); + + BoolItem item2("Foo", false, "baz"); + string expected2 = + " {\n" + " \"description\": \"Foo\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"bool\",\n" + " \"value\": 0,\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected2, item2.AsString()); +} + +/* + * Test the hidden item + */ +void JsonSectionsTest::testHiddenItem() { + HiddenItem item("bar", "baz"); + item.SetButtonText("Action"); + string expected = + " {\n" + " \"button\": \"Action\",\n" + " \"description\": \"\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"hidden\",\n" + " \"value\": \"bar\",\n" + " },\n"; + CPPUNIT_ASSERT_EQUAL(expected, item.AsString()); +} + + +/* + * Test the entire section + */ +void JsonSectionsTest::testSection() { + JsonSection section(false); + HiddenItem *item = new HiddenItem("bar\r", "baz"); + + section.AddItem(item); + section.SetSaveButton("Action\\"); + + string expected = + "{\n" + " \"refresh\": 0,\n" + " \"error\": \"\",\n" + " \"save_button\": \"Action\\\\\",\n" + " \"items\": [\n" + " {\n" + " \"description\": \"\",\n" + " \"id\": \"baz\",\n" + " \"type\": \"hidden\",\n" + " \"value\": \"bar\\r\",\n" + " },\n" + " ],\n" + "}\n"; + CPPUNIT_ASSERT_EQUAL(expected, section.AsString()); +} diff --git a/open-lighting-architecture/ola-0.8.4/common/web/Makefile.am b/open-lighting-architecture/ola-0.8.4/common/web/Makefile.am new file mode 100644 index 0000000..c2dc8ff --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/web/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/common.mk + +noinst_LTLIBRARIES = libolaweb.la +libolaweb_la_SOURCES = JsonSections.cpp + +TESTS = WebTester +check_PROGRAMS = $(TESTS) +WebTester_SOURCES = JsonSectionsTest.cpp WebTester.cpp +WebTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +WebTester_LDFLAGS = $(CPPUNIT_LIBS) +WebTester_LDADD = libolaweb.la ../logging/liblogging.la ../utils/libolautils.la diff --git a/open-lighting-architecture/ola-0.8.4/common/web/Makefile.in b/open-lighting-architecture/ola-0.8.4/common/web/Makefile.in new file mode 100644 index 0000000..2a2ed9f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/web/Makefile.in @@ -0,0 +1,592 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = WebTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = common/web +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolaweb_la_LIBADD = +am_libolaweb_la_OBJECTS = JsonSections.lo +libolaweb_la_OBJECTS = $(am_libolaweb_la_OBJECTS) +am__EXEEXT_1 = WebTester$(EXEEXT) +am_WebTester_OBJECTS = WebTester-JsonSectionsTest.$(OBJEXT) \ + WebTester-WebTester.$(OBJEXT) +WebTester_OBJECTS = $(am_WebTester_OBJECTS) +WebTester_DEPENDENCIES = libolaweb.la ../logging/liblogging.la \ + ../utils/libolautils.la +WebTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(WebTester_CXXFLAGS) \ + $(CXXFLAGS) $(WebTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaweb_la_SOURCES) $(WebTester_SOURCES) +DIST_SOURCES = $(libolaweb_la_SOURCES) $(WebTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +noinst_LTLIBRARIES = libolaweb.la +libolaweb_la_SOURCES = JsonSections.cpp +WebTester_SOURCES = JsonSectionsTest.cpp WebTester.cpp +WebTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +WebTester_LDFLAGS = $(CPPUNIT_LIBS) +WebTester_LDADD = libolaweb.la ../logging/liblogging.la ../utils/libolautils.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/web/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/web/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaweb.la: $(libolaweb_la_OBJECTS) $(libolaweb_la_DEPENDENCIES) + $(CXXLINK) $(libolaweb_la_OBJECTS) $(libolaweb_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +WebTester$(EXEEXT): $(WebTester_OBJECTS) $(WebTester_DEPENDENCIES) + @rm -f WebTester$(EXEEXT) + $(WebTester_LINK) $(WebTester_OBJECTS) $(WebTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/JsonSections.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WebTester-JsonSectionsTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WebTester-WebTester.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +WebTester-JsonSectionsTest.o: JsonSectionsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -MT WebTester-JsonSectionsTest.o -MD -MP -MF $(DEPDIR)/WebTester-JsonSectionsTest.Tpo -c -o WebTester-JsonSectionsTest.o `test -f 'JsonSectionsTest.cpp' || echo '$(srcdir)/'`JsonSectionsTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/WebTester-JsonSectionsTest.Tpo $(DEPDIR)/WebTester-JsonSectionsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='JsonSectionsTest.cpp' object='WebTester-JsonSectionsTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -c -o WebTester-JsonSectionsTest.o `test -f 'JsonSectionsTest.cpp' || echo '$(srcdir)/'`JsonSectionsTest.cpp + +WebTester-JsonSectionsTest.obj: JsonSectionsTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -MT WebTester-JsonSectionsTest.obj -MD -MP -MF $(DEPDIR)/WebTester-JsonSectionsTest.Tpo -c -o WebTester-JsonSectionsTest.obj `if test -f 'JsonSectionsTest.cpp'; then $(CYGPATH_W) 'JsonSectionsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/JsonSectionsTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/WebTester-JsonSectionsTest.Tpo $(DEPDIR)/WebTester-JsonSectionsTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='JsonSectionsTest.cpp' object='WebTester-JsonSectionsTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -c -o WebTester-JsonSectionsTest.obj `if test -f 'JsonSectionsTest.cpp'; then $(CYGPATH_W) 'JsonSectionsTest.cpp'; else $(CYGPATH_W) '$(srcdir)/JsonSectionsTest.cpp'; fi` + +WebTester-WebTester.o: WebTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -MT WebTester-WebTester.o -MD -MP -MF $(DEPDIR)/WebTester-WebTester.Tpo -c -o WebTester-WebTester.o `test -f 'WebTester.cpp' || echo '$(srcdir)/'`WebTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/WebTester-WebTester.Tpo $(DEPDIR)/WebTester-WebTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='WebTester.cpp' object='WebTester-WebTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -c -o WebTester-WebTester.o `test -f 'WebTester.cpp' || echo '$(srcdir)/'`WebTester.cpp + +WebTester-WebTester.obj: WebTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -MT WebTester-WebTester.obj -MD -MP -MF $(DEPDIR)/WebTester-WebTester.Tpo -c -o WebTester-WebTester.obj `if test -f 'WebTester.cpp'; then $(CYGPATH_W) 'WebTester.cpp'; else $(CYGPATH_W) '$(srcdir)/WebTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/WebTester-WebTester.Tpo $(DEPDIR)/WebTester-WebTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='WebTester.cpp' object='WebTester-WebTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(WebTester_CXXFLAGS) $(CXXFLAGS) -c -o WebTester-WebTester.obj `if test -f 'WebTester.cpp'; then $(CYGPATH_W) 'WebTester.cpp'; else $(CYGPATH_W) '$(srcdir)/WebTester.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/common/web/WebTester.cpp b/open-lighting-architecture/ola-0.8.4/common/web/WebTester.cpp new file mode 100644 index 0000000..1c5fa7c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/common/web/WebTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * WebTester.h + * Runs all the web tests + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/config.h.in b/open-lighting-architecture/ola-0.8.4/config.h.in new file mode 100644 index 0000000..cbd0309 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config.h.in @@ -0,0 +1,277 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the `bzero' function. */ +#undef HAVE_BZERO + +/* Define to 1 if you have the declaration of `MSG_NOSIGNAL', and to 0 if you + don't. */ +#undef HAVE_DECL_MSG_NOSIGNAL + +/* Define to 1 if you have the declaration of `SO_NOSIGPIPE', and to 0 if you + don't. */ +#undef HAVE_DECL_SO_NOSIGPIPE + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* define if dmx4linux is installed */ +#undef HAVE_DMX4LINUX + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK + +/* Define to 1 if you have the `getifaddrs' function. */ +#undef HAVE_GETIFADDRS + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `inet_aton' function. */ +#undef HAVE_INET_ATON + +/* Define to 1 if you have the `inet_ntoa' function. */ +#undef HAVE_INET_NTOA + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* define if libmicrohttpd is installed */ +#undef HAVE_LIBMICROHTTPD + +/* define if libusb is installed */ +#undef HAVE_LIBUSB + +/* Define to 1 if you have the `uuid' library (-luuid). */ +#undef HAVE_LIBUUID + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_PACKET_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkdir' function. */ +#undef HAVE_MKDIR + +/* Define to 1 if you have the header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_OSSP_UUID_H + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* define if we have sockaddr_dl */ +#undef HAVE_SOCKADDR_DL_STRUCT + +/* define if socket address structures have length fields */ +#undef HAVE_SOCKADDR_SA_LEN + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if `stat' has the bug that it succeeds when given the + zero-length file name argument. */ +#undef HAVE_STAT_EMPTY_STRING_BUG + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UUID_UUID_H + +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFORK_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK + +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to 1 if the system supports IPv6 */ +#undef IPV6 + +/* Define to 1 if `lstat' dereferences a symlink specified with a trailing + slash. */ +#undef LSTAT_FOLLOWS_SLASHED_SYMLINK + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* defined if we should use the ossp uuid lib */ +#undef USE_OSSP_UUID + +/* Version number of package */ +#undef VERSION + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `int' if does not define. */ +#undef pid_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/open-lighting-architecture/ola-0.8.4/config/config.guess b/open-lighting-architecture/ola-0.8.4/config/config.guess new file mode 100755 index 0000000..396482d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/config.guess @@ -0,0 +1,1500 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-07-02' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# 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 build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +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\n"); 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`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%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) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# 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_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# 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 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/config.sub b/open-lighting-architecture/ola-0.8.4/config/config.sub new file mode 100755 index 0000000..fab0aa3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/config.sub @@ -0,0 +1,1616 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-09-20' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# 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. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -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* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/cppunit.m4 b/open-lighting-architecture/ola-0.8.4/config/cppunit.m4 new file mode 100644 index 0000000..41f067b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/cppunit.m4 @@ -0,0 +1,92 @@ +dnl +dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl +AC_DEFUN([AM_PATH_CPPUNIT], +[ + +AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)], + cppunit_config_prefix="$withval", cppunit_config_prefix="") +AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)], + cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="") + + if test x$cppunit_config_exec_prefix != x ; then + cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config + fi + fi + if test x$cppunit_config_prefix != x ; then + cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config + fi + fi + + AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no) + cppunit_version_min=$1 + + AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min) + no_cppunit="" + if test "$CPPUNIT_CONFIG" = "no" ; then + AC_MSG_RESULT(no) + no_cppunit=yes + else + CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` + CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` + cppunit_version=`$CPPUNIT_CONFIG --version` + + cppunit_major_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + cppunit_minor_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + cppunit_micro_version=`echo $cppunit_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + + cppunit_major_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + if test "x${cppunit_major_min}" = "x" ; then + cppunit_major_min=0 + fi + + cppunit_minor_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + if test "x${cppunit_minor_min}" = "x" ; then + cppunit_minor_min=0 + fi + + cppunit_micro_min=`echo $cppunit_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x${cppunit_micro_min}" = "x" ; then + cppunit_micro_min=0 + fi + + cppunit_version_proper=`expr \ + $cppunit_major_version \> $cppunit_major_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \> $cppunit_minor_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \= $cppunit_minor_min \& \ + $cppunit_micro_version \>= $cppunit_micro_min ` + + if test "$cppunit_version_proper" = "1" ; then + AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version]) + else + AC_MSG_RESULT(no) + no_cppunit=yes + fi + fi + + if test "x$no_cppunit" = x ; then + ifelse([$2], , :, [$2]) + else + CPPUNIT_CFLAGS="" + CPPUNIT_LIBS="" + ifelse([$3], , :, [$3]) + fi + + AC_SUBST(CPPUNIT_CFLAGS) + AC_SUBST(CPPUNIT_LIBS) +]) + + + diff --git a/open-lighting-architecture/ola-0.8.4/config/depcomp b/open-lighting-architecture/ola-0.8.4/config/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/install-sh b/open-lighting-architecture/ola-0.8.4/config/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/ltmain.sh b/open-lighting-architecture/ola-0.8.4/config/ltmain.sh new file mode 100644 index 0000000..06823e0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/ltmain.sh @@ -0,0 +1,6863 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_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 $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/missing b/open-lighting-architecture/ola-0.8.4/config/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/config/ola.m4 b/open-lighting-architecture/ola-0.8.4/config/ola.m4 new file mode 100644 index 0000000..2605e3e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/ola.m4 @@ -0,0 +1,55 @@ +## ola.m4 -- macros for OLA +## Copyright (C) 2009 Simon Newton +## +## 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., 675 Mass Ave, Cambridge, MA 02139, USA. + +# PROTOBUF_SUPPORT(version) +# Check that the protobuf headers are installed and that protoc is the correct +# version +# ----------------------------------------------------------------------------- +AC_DEFUN([PROTOBUF_SUPPORT], +[ +AC_REQUIRE_CPP() +AC_CHECK_HEADER(google/protobuf/stubs/common.h, , + AC_MSG_ERROR('protobuf library not installed')) +AC_PATH_PROG([PROTOC],[protoc]) +if test -z "$PROTOC" ; then + AC_MSG_ERROR([cannot find 'protoc' program]); +elif test -n "$1" ; then + AC_MSG_CHECKING([protoc version]) + [protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`] + [required=$1] + [required_major=`echo $required | sed 's/[^0-9].*//'`] + [required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`] + [required_patch=`echo $required | sed 's/^.*[^0-9]//'`] + [actual_major=`echo $protoc_version | sed 's/[^0-9].*//'`] + [actual_minor=`echo $protoc_version | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'`] + [actual_patch=`echo $protoc_version | sed 's/^.*[^0-9]//'`] + + protoc_version_proper=`expr \ + $actual_major \> $required_major \| \ + $actual_major \= $required_major \& \ + $actual_minor \> $required_minor \| \ + $actual_major \= $required_major \& \ + $actual_minor \= $required_minor \& \ + $actual_patch \>= $required_patch ` + + if test "$protoc_version_proper" = "1" ; then + AC_MSG_RESULT([$protoc_version]) + else + AC_MSG_ERROR([protoc version too old $protoc_version < $required]); + fi +fi +]) diff --git a/open-lighting-architecture/ola-0.8.4/config/pkg.m4 b/open-lighting-architecture/ola-0.8.4/config/pkg.m4 new file mode 100644 index 0000000..a0b9cd4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/pkg.m4 @@ -0,0 +1,155 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/open-lighting-architecture/ola-0.8.4/config/py-compile b/open-lighting-architecture/ola-0.8.4/config/py-compile new file mode 100755 index 0000000..d6e900b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/config/py-compile @@ -0,0 +1,146 @@ +#!/bin/sh +# py-compile - Compile a Python program + +scriptversion=2005-05-14.22 + +# Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +if [ -z "$PYTHON" ]; then + PYTHON=python +fi + +basedir= +destdir= +files= +while test $# -ne 0; do + case "$1" in + --basedir) + basedir=$2 + if test -z "$basedir"; then + echo "$0: Missing argument to --basedir." 1>&2 + exit 1 + fi + shift + ;; + --destdir) + destdir=$2 + if test -z "$destdir"; then + echo "$0: Missing argument to --destdir." 1>&2 + exit 1 + fi + shift + ;; + -h|--h*) + cat <<\EOF +Usage: py-compile [--help] [--version] [--basedir DIR] [--destdir DIR] FILES..." + +Byte compile some python scripts FILES. Use --destdir to specify any +leading directory path to the FILES that you don't want to include in the +byte compiled file. Specify --basedir for any additional path information you +do want to be shown in the byte compiled file. + +Example: + py-compile --destdir /tmp/pkg-root --basedir /usr/share/test test.py test2.py + +Report bugs to . +EOF + exit $? + ;; + -v|--v*) + echo "py-compile $scriptversion" + exit $? + ;; + *) + files="$files $1" + ;; + esac + shift +done + +if test -z "$files"; then + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 +fi + +# if basedir was given, then it should be prepended to filenames before +# byte compilation. +if [ -z "$basedir" ]; then + pathtrans="path = file" +else + pathtrans="path = os.path.join('$basedir', file)" +fi + +# if destdir was given, then it needs to be prepended to the filename to +# byte compile but not go into the compiled file. +if [ -z "$destdir" ]; then + filetrans="filepath = path" +else + filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)" +fi + +$PYTHON -c " +import sys, os, string, py_compile + +files = '''$files''' + +print 'Byte-compiling python modules...' +for file in string.split(files): + $pathtrans + $filetrans + if not os.path.exists(filepath) or not (len(filepath) >= 3 + and filepath[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + py_compile.compile(filepath, filepath + 'c', path) +print" || exit $? + +# this will fail for python < 1.5, but that doesn't matter ... +$PYTHON -O -c " +import sys, os, string, py_compile + +files = '''$files''' +print 'Byte-compiling python modules (optimized versions) ...' +for file in string.split(files): + $pathtrans + $filetrans + if not os.path.exists(filepath) or not (len(filepath) >= 3 + and filepath[-3:] == '.py'): + continue + print file, + sys.stdout.flush() + py_compile.compile(filepath, filepath + 'o', path) +print" 2>/dev/null || : + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-0.8.4/configure b/open-lighting-architecture/ola-0.8.4/configure new file mode 100755 index 0000000..0422bf3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/configure @@ -0,0 +1,27174 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="configure.ac" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +ac_aux_dir +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CXX +CXXFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CXX +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +CC +CFLAGS +ac_ct_CC +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CPP +LN_S +CXXCPP +GREP +EGREP +LIBOBJS +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +ECHO +AR +RANLIB +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +USING_WIN32_TRUE +USING_WIN32_FALSE +PROTOC +PKG_CONFIG +UUID_CFLAGS +UUID_LIBS +OSSP_UUID_CFLAGS +OSSP_UUID_LIBS +HAVE_DMX4LINUX_TRUE +HAVE_DMX4LINUX_FALSE +libusb_CFLAGS +libusb_LIBS +HAVE_LIBUSB_TRUE +HAVE_LIBUSB_FALSE +PLUGIN_LIBS +OLA_SERVER_LIBS +plugindir +www_datadir +OLAD_DEFINES +CPPUNIT_CONFIG +CPPUNIT_CFLAGS +CPPUNIT_LIBS +HAVE_LIBMICROHTTPD_TRUE +HAVE_LIBMICROHTTPD_FALSE +MICROHTTPD_LIBS +BUILD_PYTHON_LIBS_TRUE +BUILD_PYTHON_LIBS_FALSE +PYTHON +PYTHON_VERSION +PYTHON_PREFIX +PYTHON_EXEC_PREFIX +PYTHON_PLATFORM +pythondir +pkgpythondir +pyexecdir +pkgpyexecdir +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CXX +CXXFLAGS +LDFLAGS +LIBS +CPPFLAGS +CCC +CC +CFLAGS +CPP +CXXCPP +F77 +FFLAGS +PKG_CONFIG +UUID_CFLAGS +UUID_LIBS +OSSP_UUID_CFLAGS +OSSP_UUID_LIBS +libusb_CFLAGS +libusb_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-gcov turn on code coverage analysis tools + --enable-python-libs Build the python interface + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] include additional configurations [automatic] + --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional) + --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional) + +Some influential environment variables: + CXX C++ compiler command + CXXFLAGS C++ compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CC C compiler command + CFLAGS C compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + PKG_CONFIG path to pkg-config utility + UUID_CFLAGS C compiler flags for UUID, overriding pkg-config + UUID_LIBS linker flags for UUID, overriding pkg-config + OSSP_UUID_CFLAGS + C compiler flags for OSSP_UUID, overriding pkg-config + OSSP_UUID_LIBS + linker flags for OSSP_UUID, overriding pkg-config + libusb_CFLAGS + C compiler flags for libusb, overriding pkg-config + libusb_LIBS linker flags for libusb, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + + +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.10' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=ola + VERSION=0.8.4 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# Checks for programs. +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 +echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C++ compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 +echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C++ compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CXX" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Checks for typedefs, structures, and compiler characteristics. + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdbool_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Bool ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Bool=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_inline=$ac_kw +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } + + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef pid_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + + { echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint16_t=no + for ac_type in 'uint16_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> (16 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + case $ac_type in + uint16_t) ac_cv_c_uint16_t=yes ;; + *) ac_cv_c_uint16_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint16_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint16_t" >&6; } + case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + + + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint32_t=no + for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + case $ac_type in + uint32_t) ac_cv_c_uint32_t=yes ;; + *) ac_cv_c_uint32_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint32_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } + case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT32_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + + + { echo "$as_me:$LINENO: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint8_t=no + for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + case $ac_type in + uint8_t) ac_cv_c_uint8_t=yes ;; + *) ac_cv_c_uint8_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint8_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint8_t" >&6; } + case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT8_T 1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + +for ac_header in vfork.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_func in fork vfork +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +if test "x$ac_cv_func_fork" = xyes; then + { echo "$as_me:$LINENO: checking for working fork" >&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6; } +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { echo "$as_me:$LINENO: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; } +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Thanks to Paul Eggert for this test. */ +$ac_includes_default +#include +#ifdef HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_vfork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; } + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WORKING_VFORK 1 +_ACEOF + +else + +cat >>confdefs.h <<\_ACEOF +#define vfork fork +_ACEOF + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_WORKING_FORK 1 +_ACEOF + +fi + +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + +{ echo "$as_me:$LINENO: checking for working memcmp" >&5 +echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_working=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memcmp_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 +echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + +{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } +if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f conftest.sym conftest.file +echo >conftest.file +if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then + if test "$cross_compiling" = yes; then + ac_cv_func_lstat_dereferences_slashed_symlink=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + /* Linux will dereference the symlink and fail. + That is better in the sense that it means we will not + have to compile and use the lstat wrapper. */ + return lstat ("conftest.sym/", &sbuf) == 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_lstat_dereferences_slashed_symlink=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +else + # If the `ln -s' command failed, then we probably don't even + # have an lstat function. + ac_cv_func_lstat_dereferences_slashed_symlink=no +fi +rm -f conftest.sym conftest.file + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } + +test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && + +cat >>confdefs.h <<_ACEOF +#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 +_ACEOF + + +if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then + case " $LIBOBJS " in + *" lstat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; +esac + +fi + +{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; } +if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_stat_empty_string_bug=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +struct stat sbuf; + return stat ("", &sbuf) == 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_stat_empty_string_bug=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_stat_empty_string_bug=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 +echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; } +if test $ac_cv_func_stat_empty_string_bug = yes; then + case " $LIBOBJS " in + *" stat.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<_ACEOF +#define HAVE_STAT_EMPTY_STRING_BUG 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +{ echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; } +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _doprnt (); +/* 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__doprnt || defined __stub____doprnt +choke me +#endif + +int +main () +{ +return _doprnt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func__doprnt=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6; } +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + + + + + + + + + + + + + + +for ac_func in bzero gettimeofday memmove memset mkdir strdup strrchr \ + inet_ntoa inet_aton select socket strerror getifaddrs +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Checks for header files. + + + + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } +if test "${ac_cv_search_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + + + + + + + + + +for ac_header in arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h \ + sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h \ + endian.h unistd.h linux/if_packet.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 8913 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_prog_f77_g=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } +else + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10693: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:10697: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:10961: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:10965: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:11065: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:11069: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* 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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* 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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which library types will actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" +fi + + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15809: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:15813: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15913: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15917: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17483: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17487: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17587: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:17591: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:19785: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:19789: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:20053: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:20057: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:20157: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:20161: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +# windows platform support + if test "$host_os" = 'mingw32'; then + USING_WIN32_TRUE= + USING_WIN32_FALSE='#' +else + USING_WIN32_TRUE='#' + USING_WIN32_FALSE= +fi + + +# check for protobuf support + + +if test "${ac_cv_header_google_protobuf_stubs_common_h+set}" = set; then + { echo "$as_me:$LINENO: checking for google/protobuf/stubs/common.h" >&5 +echo $ECHO_N "checking for google/protobuf/stubs/common.h... $ECHO_C" >&6; } +if test "${ac_cv_header_google_protobuf_stubs_common_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_google_protobuf_stubs_common_h" >&5 +echo "${ECHO_T}$ac_cv_header_google_protobuf_stubs_common_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking google/protobuf/stubs/common.h usability" >&5 +echo $ECHO_N "checking google/protobuf/stubs/common.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking google/protobuf/stubs/common.h presence" >&5 +echo $ECHO_N "checking google/protobuf/stubs/common.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: google/protobuf/stubs/common.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: google/protobuf/stubs/common.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for google/protobuf/stubs/common.h" >&5 +echo $ECHO_N "checking for google/protobuf/stubs/common.h... $ECHO_C" >&6; } +if test "${ac_cv_header_google_protobuf_stubs_common_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_google_protobuf_stubs_common_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_google_protobuf_stubs_common_h" >&5 +echo "${ECHO_T}$ac_cv_header_google_protobuf_stubs_common_h" >&6; } + +fi +if test $ac_cv_header_google_protobuf_stubs_common_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: 'protobuf library not installed'" >&5 +echo "$as_me: error: 'protobuf library not installed'" >&2;} + { (exit 1); exit 1; }; } +fi + + +# Extract the first word of "protoc", so it can be a program name with args. +set dummy protoc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PROTOC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PROTOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PROTOC="$PROTOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PROTOC="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PROTOC=$ac_cv_path_PROTOC +if test -n "$PROTOC"; then + { echo "$as_me:$LINENO: result: $PROTOC" >&5 +echo "${ECHO_T}$PROTOC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test -z "$PROTOC" ; then + { { echo "$as_me:$LINENO: error: cannot find 'protoc' program" >&5 +echo "$as_me: error: cannot find 'protoc' program" >&2;} + { (exit 1); exit 1; }; }; +elif test -n "2.3.0" ; then + { echo "$as_me:$LINENO: checking protoc version" >&5 +echo $ECHO_N "checking protoc version... $ECHO_C" >&6; } + protoc_version=`$PROTOC --version 2>&1 | grep 'libprotoc' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'` + required=2.3.0 + required_major=`echo $required | sed 's/[^0-9].*//'` + required_minor=`echo $required | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'` + required_patch=`echo $required | sed 's/^.*[^0-9]//'` + actual_major=`echo $protoc_version | sed 's/[^0-9].*//'` + actual_minor=`echo $protoc_version | sed 's/[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*/\1/'` + actual_patch=`echo $protoc_version | sed 's/^.*[^0-9]//'` + + protoc_version_proper=`expr \ + $actual_major \> $required_major \| \ + $actual_major \= $required_major \& \ + $actual_minor \> $required_minor \| \ + $actual_major \= $required_major \& \ + $actual_minor \= $required_minor \& \ + $actual_patch \>= $required_patch ` + + if test "$protoc_version_proper" = "1" ; then + { echo "$as_me:$LINENO: result: $protoc_version" >&5 +echo "${ECHO_T}$protoc_version" >&6; } + else + { { echo "$as_me:$LINENO: error: protoc version too old $protoc_version < $required" >&5 +echo "$as_me: error: protoc version too old $protoc_version < $required" >&2;} + { (exit 1); exit 1; }; }; + fi +fi + + +# check for pthread support +if test "${ac_cv_header_pthread_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking pthread.h usability" >&5 +echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking pthread.h presence" >&5 +echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pthread.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pthread.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_pthread_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6; } + +fi +if test $ac_cv_header_pthread_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: Missing pthread, please install it" >&5 +echo "$as_me: error: Missing pthread, please install it" >&2;} + { (exit 1); exit 1; }; } +fi + + +LIBS="-lpthread $LIBS" + +# check for ipv6 support - taken from unp +{ echo "$as_me:$LINENO: checking for IPv6 support" >&5 +echo $ECHO_N "checking for IPv6 support... $ECHO_C" >&6; } +if test "${ac_cv_ipv6+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_ipv6=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# include +# include +# include +# include + /* Make sure the definitions for AF_INET6 and struct sockaddr_in6 + * are defined, and that we can actually create an IPv6 TCP socket. + */ + main() + { + int fd; + struct sockaddr_in6 foo; + fd = socket(AF_INET6, SOCK_STREAM, 0); + exit(fd >= 0 ? 0 : 1); + } +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_ipv6=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_ipv6=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_ipv6" >&5 +echo "${ECHO_T}$ac_cv_ipv6" >&6; } +if test $ac_cv_ipv6 = yes ; then + +cat >>confdefs.h <<\_ACEOF +#define IPV6 1 +_ACEOF + +fi + +# Check if sockaddr{} has sa_len member. +{ echo "$as_me:$LINENO: checking for struct sockaddr.sa_len" >&5 +echo $ECHO_N "checking for struct sockaddr.sa_len... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_sockaddr_sa_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +static struct sockaddr ac_aggr; +if (ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +static struct sockaddr ac_aggr; +if (sizeof ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_sa_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_sockaddr_sa_len=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_sa_len" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sockaddr_sa_len" >&6; } +if test $ac_cv_member_struct_sockaddr_sa_len = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKADDR_SA_LEN 1 +_ACEOF + +fi + + +{ echo "$as_me:$LINENO: checking for struct sockaddr_dl.sdl_family" >&5 +echo $ECHO_N "checking for struct sockaddr_dl.sdl_family... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_sockaddr_dl_sdl_family+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +static struct sockaddr_dl ac_aggr; +if (ac_aggr.sdl_family) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_dl_sdl_family=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +static struct sockaddr_dl ac_aggr; +if (sizeof ac_aggr.sdl_family) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_sockaddr_dl_sdl_family=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_sockaddr_dl_sdl_family=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_dl_sdl_family" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sockaddr_dl_sdl_family" >&6; } +if test $ac_cv_member_struct_sockaddr_dl_sdl_family = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SOCKADDR_DL_STRUCT 1 +_ACEOF + +fi + + +# check for SO_NOSIGPIPE or MSG_NOSIGNAL +{ echo "$as_me:$LINENO: checking whether MSG_NOSIGNAL is declared" >&5 +echo $ECHO_N "checking whether MSG_NOSIGNAL is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_MSG_NOSIGNAL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#ifndef MSG_NOSIGNAL + (void) MSG_NOSIGNAL; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_MSG_NOSIGNAL=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_MSG_NOSIGNAL=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_MSG_NOSIGNAL" >&5 +echo "${ECHO_T}$ac_cv_have_decl_MSG_NOSIGNAL" >&6; } +if test $ac_cv_have_decl_MSG_NOSIGNAL = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MSG_NOSIGNAL 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_MSG_NOSIGNAL 0 +_ACEOF + +have_msg_no_pipe=no +fi + + + +{ echo "$as_me:$LINENO: checking whether SO_NOSIGPIPE is declared" >&5 +echo $ECHO_N "checking whether SO_NOSIGPIPE is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_SO_NOSIGPIPE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#ifndef SO_NOSIGPIPE + (void) SO_NOSIGPIPE; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_SO_NOSIGPIPE=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_SO_NOSIGPIPE=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_SO_NOSIGPIPE" >&5 +echo "${ECHO_T}$ac_cv_have_decl_SO_NOSIGPIPE" >&6; } +if test $ac_cv_have_decl_SO_NOSIGPIPE = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SO_NOSIGPIPE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SO_NOSIGPIPE 0 +_ACEOF + +have_so_no_pipe=no +fi + + + +if test "${have_msg_no_pipe}" = "no" && test "${have_so_no_pipe}" = "no"; then + { { echo "$as_me:$LINENO: error: Your system needs either MSG_NOSIGNAL or SO_NOSIGPIPE" >&5 +echo "$as_me: error: Your system needs either MSG_NOSIGNAL or SO_NOSIGPIPE" >&2;} + { (exit 1); exit 1; }; } +fi + +# Check for pkg-config + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + PKG_CONFIG="" + fi + +fi + +if test -z "$PKG_CONFIG"; then + { { echo "$as_me:$LINENO: error: Missing pkg-config, please install it" >&5 +echo "$as_me: error: Missing pkg-config, please install it" >&2;} + { (exit 1); exit 1; }; } +fi + +# check for uuid +# uuid handling is quite complex as we can use either the OSSP uuid or the one +# with e2fsprogs. On top of that the header file is different on different +#platforms +use_ossp_uuid="no" + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for UUID" >&5 +echo $ECHO_N "checking for UUID... $ECHO_C" >&6; } + +if test -n "$UUID_CFLAGS"; then + pkg_cv_UUID_CFLAGS="$UUID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$UUID_LIBS"; then + pkg_cv_UUID_LIBS="$UUID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "uuid" 2>&1` + else + UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors "uuid" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UUID_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + # the uuid pkg wasn't found, let's try ossp-uuid instead + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for OSSP_UUID" >&5 +echo $ECHO_N "checking for OSSP_UUID... $ECHO_C" >&6; } + +if test -n "$OSSP_UUID_CFLAGS"; then + pkg_cv_OSSP_UUID_CFLAGS="$OSSP_UUID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ossp-uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "ossp-uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_OSSP_UUID_CFLAGS=`$PKG_CONFIG --cflags "ossp-uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OSSP_UUID_LIBS"; then + pkg_cv_OSSP_UUID_LIBS="$OSSP_UUID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ossp-uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "ossp-uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_OSSP_UUID_LIBS=`$PKG_CONFIG --libs "ossp-uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OSSP_UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ossp-uuid" 2>&1` + else + OSSP_UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors "ossp-uuid" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OSSP_UUID_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + # if this fails, then our last chance is to check for uuid/uuid.h (present + # on OS X by default). + +for ac_header in uuid/uuid.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: Missing the uuid library" >&5 +echo "$as_me: error: Missing the uuid library" >&2;} + { (exit 1); exit 1; }; } + +fi + +done + + +elif test $pkg_failed = untried; then + # if this fails, then our last chance is to check for uuid/uuid.h (present + # on OS X by default). + +for ac_header in uuid/uuid.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: Missing the uuid library" >&5 +echo "$as_me: error: Missing the uuid library" >&2;} + { (exit 1); exit 1; }; } + +fi + +done + + +else + OSSP_UUID_CFLAGS=$pkg_cv_OSSP_UUID_CFLAGS + OSSP_UUID_LIBS=$pkg_cv_OSSP_UUID_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + use_ossp_uuid="yes" +fi + +elif test $pkg_failed = untried; then + # the uuid pkg wasn't found, let's try ossp-uuid instead + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for OSSP_UUID" >&5 +echo $ECHO_N "checking for OSSP_UUID... $ECHO_C" >&6; } + +if test -n "$OSSP_UUID_CFLAGS"; then + pkg_cv_OSSP_UUID_CFLAGS="$OSSP_UUID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ossp-uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "ossp-uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_OSSP_UUID_CFLAGS=`$PKG_CONFIG --cflags "ossp-uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$OSSP_UUID_LIBS"; then + pkg_cv_OSSP_UUID_LIBS="$OSSP_UUID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"ossp-uuid\"") >&5 + ($PKG_CONFIG --exists --print-errors "ossp-uuid") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_OSSP_UUID_LIBS=`$PKG_CONFIG --libs "ossp-uuid" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + OSSP_UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ossp-uuid" 2>&1` + else + OSSP_UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors "ossp-uuid" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$OSSP_UUID_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + # if this fails, then our last chance is to check for uuid/uuid.h (present + # on OS X by default). + +for ac_header in uuid/uuid.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: Missing the uuid library" >&5 +echo "$as_me: error: Missing the uuid library" >&2;} + { (exit 1); exit 1; }; } + +fi + +done + + +elif test $pkg_failed = untried; then + # if this fails, then our last chance is to check for uuid/uuid.h (present + # on OS X by default). + +for ac_header in uuid/uuid.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: Missing the uuid library" >&5 +echo "$as_me: error: Missing the uuid library" >&2;} + { (exit 1); exit 1; }; } + +fi + +done + + +else + OSSP_UUID_CFLAGS=$pkg_cv_OSSP_UUID_CFLAGS + OSSP_UUID_LIBS=$pkg_cv_OSSP_UUID_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + use_ossp_uuid="yes" +fi + +else + UUID_CFLAGS=$pkg_cv_UUID_CFLAGS + UUID_LIBS=$pkg_cv_UUID_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +for ac_header in ossp/uuid.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + use_ossp_uuid="yes" +else + +for ac_header in uuid/uuid.h + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +{ echo "$as_me:$LINENO: checking for uuid_generate in -luuid" >&5 +echo $ECHO_N "checking for uuid_generate in -luuid... $ECHO_C" >&6; } +if test "${ac_cv_lib_uuid_uuid_generate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luuid $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_generate (); +int +main () +{ +return uuid_generate (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_uuid_uuid_generate=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_uuid_uuid_generate=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_uuid_uuid_generate" >&5 +echo "${ECHO_T}$ac_cv_lib_uuid_uuid_generate" >&6; } +if test $ac_cv_lib_uuid_uuid_generate = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUUID 1 +_ACEOF + + LIBS="-luuid $LIBS" + +else + use_ossp_uuid="yes" +fi + +fi + +done + +fi + +done + +fi + +if test "${use_ossp_uuid}" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define USE_OSSP_UUID 1 +_ACEOF + +fi + +# check for plugin dependencies. We also build a list of plugins that we're +# going to compile here so the binary knows what to link against +PLUGINS="artnet dummy espnet e131 opendmx pathport sandnet shownet stageprofi usbpro" + +# check for dmx4linux +have_dmx4linux="" +{ echo "$as_me:$LINENO: checking for DMXdev in -ldmx4linux" >&5 +echo $ECHO_N "checking for DMXdev in -ldmx4linux... $ECHO_C" >&6; } +if test "${ac_cv_lib_dmx4linux_DMXdev+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldmx4linux $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char DMXdev (); +int +main () +{ +return DMXdev (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dmx4linux_DMXdev=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dmx4linux_DMXdev=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dmx4linux_DMXdev" >&5 +echo "${ECHO_T}$ac_cv_lib_dmx4linux_DMXdev" >&6; } +if test $ac_cv_lib_dmx4linux_DMXdev = yes; then + have_dmx4linux="yes" +fi + +if test "${ac_cv_header_dmx_dmxioctl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for dmx/dmxioctl.h" >&5 +echo $ECHO_N "checking for dmx/dmxioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_dmx_dmxioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_dmx_dmxioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_dmx_dmxioctl_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking dmx/dmxioctl.h usability" >&5 +echo $ECHO_N "checking dmx/dmxioctl.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking dmx/dmxioctl.h presence" >&5 +echo $ECHO_N "checking dmx/dmxioctl.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: dmx/dmxioctl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: dmx/dmxioctl.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for dmx/dmxioctl.h" >&5 +echo $ECHO_N "checking for dmx/dmxioctl.h... $ECHO_C" >&6; } +if test "${ac_cv_header_dmx_dmxioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_dmx_dmxioctl_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_dmx_dmxioctl_h" >&5 +echo "${ECHO_T}$ac_cv_header_dmx_dmxioctl_h" >&6; } + +fi +if test $ac_cv_header_dmx_dmxioctl_h = yes; then + : +else + have_dmx4linux="" +fi + + + + if test "${have_dmx4linux}" = "yes"; then + HAVE_DMX4LINUX_TRUE= + HAVE_DMX4LINUX_FALSE='#' +else + HAVE_DMX4LINUX_TRUE='#' + HAVE_DMX4LINUX_FALSE= +fi + + +if test "${have_dmx4linux}" = "yes"; then + PLUGINS="${PLUGINS} dmx4linux" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DMX4LINUX 1 +_ACEOF + +fi + +# check for libusb +have_libusb="no" + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for libusb" >&5 +echo $ECHO_N "checking for libusb... $ECHO_C" >&6; } + +if test -n "$libusb_CFLAGS"; then + pkg_cv_libusb_CFLAGS="$libusb_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0 >= 1.0.2\"") >&5 + ($PKG_CONFIG --exists --print-errors "libusb-1.0 >= 1.0.2") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libusb_CFLAGS=`$PKG_CONFIG --cflags "libusb-1.0 >= 1.0.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$libusb_LIBS"; then + pkg_cv_libusb_LIBS="$libusb_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libusb-1.0 >= 1.0.2\"") >&5 + ($PKG_CONFIG --exists --print-errors "libusb-1.0 >= 1.0.2") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libusb_LIBS=`$PKG_CONFIG --libs "libusb-1.0 >= 1.0.2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + libusb_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libusb-1.0 >= 1.0.2" 2>&1` + else + libusb_PKG_ERRORS=`$PKG_CONFIG --print-errors "libusb-1.0 >= 1.0.2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libusb_PKG_ERRORS" >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + true +elif test $pkg_failed = untried; then + true +else + libusb_CFLAGS=$pkg_cv_libusb_CFLAGS + libusb_LIBS=$pkg_cv_libusb_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + have_libusb="yes" +fi + if test "${have_libusb}" = "yes"; then + HAVE_LIBUSB_TRUE= + HAVE_LIBUSB_FALSE='#' +else + HAVE_LIBUSB_TRUE='#' + HAVE_LIBUSB_FALSE= +fi + + +if test "${have_libusb}" = "yes"; then + PLUGINS="${PLUGINS} usbdmx" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBUSB 1 +_ACEOF + +fi + +# create a list of plugin libs +PLUGIN_LIBS='' +OLA_SERVER_LIBS='' +for p in $PLUGINS; do + LIB_NAME="libola$p" + PLUGIN_LIBS="$PLUGIN_LIBS \$(top_builddir)/plugins/$p/$LIB_NAME.la" + OLA_SERVER_LIBS="$OLA_SERVER_LIBS -l$LIB_NAME" +done + + + + +# plugin & html data directories +plugindir=$libdir/olad +ola_datadir=$datadir/olad +www_datadir=$ola_datadir/www + + + +OLAD_DEFINES="-DHTTP_DATA_DIR=\\\"$www_datadir\\\" -DPLUGIN_DIR=\\\"$plugindir\\\" " + + +# check for cppunit + + + +# Check whether --with-cppunit-prefix was given. +if test "${with_cppunit_prefix+set}" = set; then + withval=$with_cppunit_prefix; cppunit_config_prefix="$withval" +else + cppunit_config_prefix="" +fi + + +# Check whether --with-cppunit-exec-prefix was given. +if test "${with_cppunit_exec_prefix+set}" = set; then + withval=$with_cppunit_exec_prefix; cppunit_config_exec_prefix="$withval" +else + cppunit_config_exec_prefix="" +fi + + + if test x$cppunit_config_exec_prefix != x ; then + cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config + fi + fi + if test x$cppunit_config_prefix != x ; then + cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix" + if test x${CPPUNIT_CONFIG+set} != xset ; then + CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config + fi + fi + + # Extract the first word of "cppunit-config", so it can be a program name with args. +set dummy cppunit-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_CPPUNIT_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $CPPUNIT_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_CPPUNIT_CONFIG="$CPPUNIT_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CPPUNIT_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_path_CPPUNIT_CONFIG" && ac_cv_path_CPPUNIT_CONFIG="no" + ;; +esac +fi +CPPUNIT_CONFIG=$ac_cv_path_CPPUNIT_CONFIG +if test -n "$CPPUNIT_CONFIG"; then + { echo "$as_me:$LINENO: result: $CPPUNIT_CONFIG" >&5 +echo "${ECHO_T}$CPPUNIT_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + cppunit_version_min=1.9.6 + + { echo "$as_me:$LINENO: checking for Cppunit - version >= $cppunit_version_min" >&5 +echo $ECHO_N "checking for Cppunit - version >= $cppunit_version_min... $ECHO_C" >&6; } + no_cppunit="" + if test "$CPPUNIT_CONFIG" = "no" ; then + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + no_cppunit=yes + else + CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` + CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` + cppunit_version=`$CPPUNIT_CONFIG --version` + + cppunit_major_version=`echo $cppunit_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + cppunit_minor_version=`echo $cppunit_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + cppunit_micro_version=`echo $cppunit_version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + + cppunit_major_min=`echo $cppunit_version_min | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + if test "x${cppunit_major_min}" = "x" ; then + cppunit_major_min=0 + fi + + cppunit_minor_min=`echo $cppunit_version_min | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + if test "x${cppunit_minor_min}" = "x" ; then + cppunit_minor_min=0 + fi + + cppunit_micro_min=`echo $cppunit_version_min | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x${cppunit_micro_min}" = "x" ; then + cppunit_micro_min=0 + fi + + cppunit_version_proper=`expr \ + $cppunit_major_version \> $cppunit_major_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \> $cppunit_minor_min \| \ + $cppunit_major_version \= $cppunit_major_min \& \ + $cppunit_minor_version \= $cppunit_minor_min \& \ + $cppunit_micro_version \>= $cppunit_micro_min ` + + if test "$cppunit_version_proper" = "1" ; then + { echo "$as_me:$LINENO: result: $cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&5 +echo "${ECHO_T}$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + no_cppunit=yes + fi + fi + + if test "x$no_cppunit" = x ; then + : + else + CPPUNIT_CFLAGS="" + CPPUNIT_LIBS="" + { { echo "$as_me:$LINENO: error: Missing cppunit, please install >= 1.9.6" >&5 +echo "$as_me: error: Missing cppunit, please install >= 1.9.6" >&2;} + { (exit 1); exit 1; }; } + fi + + + + + +# gcov +# Check whether --enable-gcov was given. +if test "${enable_gcov+set}" = set; then + enableval=$enable_gcov; use_gcov="yes" +fi + + +if test "${use_gcov}" = "yes"; then + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + CXXFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -fprofile-arcs" +fi + +# look for microhttpd +{ echo "$as_me:$LINENO: checking for MHD_start_daemon in -lmicrohttpd" >&5 +echo $ECHO_N "checking for MHD_start_daemon in -lmicrohttpd... $ECHO_C" >&6; } +if test "${ac_cv_lib_microhttpd_MHD_start_daemon+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmicrohttpd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char MHD_start_daemon (); +int +main () +{ +return MHD_start_daemon (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_microhttpd_MHD_start_daemon=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_microhttpd_MHD_start_daemon=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_microhttpd_MHD_start_daemon" >&5 +echo "${ECHO_T}$ac_cv_lib_microhttpd_MHD_start_daemon" >&6; } +if test $ac_cv_lib_microhttpd_MHD_start_daemon = yes; then + have_microhttpd="yes" +fi + + if test "${have_microhttpd}" = "yes"; then + HAVE_LIBMICROHTTPD_TRUE= + HAVE_LIBMICROHTTPD_FALSE='#' +else + HAVE_LIBMICROHTTPD_TRUE='#' + HAVE_LIBMICROHTTPD_FALSE= +fi + + +if test "${have_microhttpd}" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBMICROHTTPD 1 +_ACEOF + + MICROHTTPD_LIBS="-lmicrohttpd" +else + MICROHTTPD_LIBS='' +fi + + +# python wrappers +# Check whether --enable-python-libs was given. +if test "${enable_python_libs+set}" = set; then + enableval=$enable_python_libs; build_python_libs="yes" + +fi + + if test "${build_python_libs}" = "yes"; then + BUILD_PYTHON_LIBS_TRUE= + BUILD_PYTHON_LIBS_FALSE='#' +else + BUILD_PYTHON_LIBS_TRUE='#' + BUILD_PYTHON_LIBS_FALSE= +fi + + +if test "${build_python_libs}" = "yes"; then + + + + + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + { echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.4" >&5 +echo $ECHO_N "checking whether $PYTHON version >= 2.4... $ECHO_C" >&6; } + prog="import sys, string +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +minver = map(int, string.split('2.4', '.')) + [0, 0, 0] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { { echo "$as_me:$LINENO: error: too old" >&5 +echo "$as_me: error: too old" >&2;} + { (exit 1); exit 1; }; } +fi + + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + { echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.4" >&5 +echo $ECHO_N "checking for a Python interpreter with version >= 2.4... $ECHO_C" >&6; } +if test "${am_cv_pathless_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + for am_cv_pathless_PYTHON in python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do + test "$am_cv_pathless_PYTHON" = none && break + prog="import sys, string +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +minver = map(int, string.split('2.4', '.')) + [0, 0, 0] +minverhex = 0 +for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i] +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 + ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + break +fi + + done +fi +{ echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 +echo "${ECHO_T}$am_cv_pathless_PYTHON" >&6; } + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. +set dummy $am_cv_pathless_PYTHON; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PYTHON in + [\\/]* | ?:[\\/]*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { echo "$as_me:$LINENO: result: $PYTHON" >&5 +echo "${ECHO_T}$PYTHON" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + + + if test "$PYTHON" = :; then + { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 +echo "$as_me: error: no suitable Python interpreter found" >&2;} + { (exit 1); exit 1; }; } + else + + + { echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 +echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6; } +if test "${am_cv_python_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` +fi +{ echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +echo "${ECHO_T}$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version + + + + PYTHON_PREFIX='${prefix}' + + PYTHON_EXEC_PREFIX='${exec_prefix}' + + + + { echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 +echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6; } +if test "${am_cv_python_platform+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` +fi +{ echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +echo "${ECHO_T}$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + + + { echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6; } +if test "${am_cv_python_pythondir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` +fi +{ echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +echo "${ECHO_T}$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir + + + + pkgpythondir=\${pythondir}/$PACKAGE + + + { echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6; } +if test "${am_cv_python_pyexecdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` +fi +{ echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +echo "${ECHO_T}$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir + + + + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + + + fi + + +fi + +ac_config_commands="$ac_config_commands default-1" + + + +# output +ac_config_files="$ac_config_files Makefile common/Makefile common/export_map/Makefile common/logging/Makefile common/protocol/Makefile common/rdm/Makefile common/rpc/Makefile common/network/Makefile common/utils/Makefile common/web/Makefile debian/Makefile include/Makefile include/ola/Makefile include/ola/network/Makefile include/ola/rdm/Makefile include/ola/web/Makefile include/olad/Makefile ola/Makefile python/Makefile python/rpc/Makefile python/examples/Makefile olad/Makefile olad/OlaVersion.h olad/testdata/Makefile olad/www/Makefile plugins/Makefile plugins/artnet/Makefile plugins/artnet/messages/Makefile plugins/artnet/messages/libolaartnetconf.pc plugins/dmx4linux/Makefile plugins/dummy/Makefile plugins/e131/Makefile plugins/e131/e131/Makefile plugins/e131/messages/Makefile plugins/e131/messages/libolae131conf.pc plugins/espnet/Makefile plugins/opendmx/Makefile plugins/pathport/Makefile plugins/sandnet/Makefile plugins/shownet/Makefile plugins/stageprofi/Makefile plugins/usbdmx/Makefile plugins/usbpro/Makefile plugins/usbpro/messages/Makefile plugins/usbpro/messages/libolausbproconf.pc tools/Makefile tools/usbpro/Makefile libola.pc libolaserver.pc" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${USING_WIN32_TRUE}" && test -z "${USING_WIN32_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"USING_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"USING_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_DMX4LINUX_TRUE}" && test -z "${HAVE_DMX4LINUX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_DMX4LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_DMX4LINUX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_LIBUSB_TRUE}" && test -z "${HAVE_LIBUSB_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_LIBUSB\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_LIBMICROHTTPD_TRUE}" && test -z "${HAVE_LIBMICROHTTPD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_LIBMICROHTTPD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_LIBMICROHTTPD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${BUILD_PYTHON_LIBS_TRUE}" && test -z "${BUILD_PYTHON_LIBS_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"BUILD_PYTHON_LIBS\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"BUILD_PYTHON_LIBS\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + srcdir=$srcdir + have_threads=$have_threads + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; + "common/export_map/Makefile") CONFIG_FILES="$CONFIG_FILES common/export_map/Makefile" ;; + "common/logging/Makefile") CONFIG_FILES="$CONFIG_FILES common/logging/Makefile" ;; + "common/protocol/Makefile") CONFIG_FILES="$CONFIG_FILES common/protocol/Makefile" ;; + "common/rdm/Makefile") CONFIG_FILES="$CONFIG_FILES common/rdm/Makefile" ;; + "common/rpc/Makefile") CONFIG_FILES="$CONFIG_FILES common/rpc/Makefile" ;; + "common/network/Makefile") CONFIG_FILES="$CONFIG_FILES common/network/Makefile" ;; + "common/utils/Makefile") CONFIG_FILES="$CONFIG_FILES common/utils/Makefile" ;; + "common/web/Makefile") CONFIG_FILES="$CONFIG_FILES common/web/Makefile" ;; + "debian/Makefile") CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/ola/Makefile") CONFIG_FILES="$CONFIG_FILES include/ola/Makefile" ;; + "include/ola/network/Makefile") CONFIG_FILES="$CONFIG_FILES include/ola/network/Makefile" ;; + "include/ola/rdm/Makefile") CONFIG_FILES="$CONFIG_FILES include/ola/rdm/Makefile" ;; + "include/ola/web/Makefile") CONFIG_FILES="$CONFIG_FILES include/ola/web/Makefile" ;; + "include/olad/Makefile") CONFIG_FILES="$CONFIG_FILES include/olad/Makefile" ;; + "ola/Makefile") CONFIG_FILES="$CONFIG_FILES ola/Makefile" ;; + "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "python/rpc/Makefile") CONFIG_FILES="$CONFIG_FILES python/rpc/Makefile" ;; + "python/examples/Makefile") CONFIG_FILES="$CONFIG_FILES python/examples/Makefile" ;; + "olad/Makefile") CONFIG_FILES="$CONFIG_FILES olad/Makefile" ;; + "olad/OlaVersion.h") CONFIG_FILES="$CONFIG_FILES olad/OlaVersion.h" ;; + "olad/testdata/Makefile") CONFIG_FILES="$CONFIG_FILES olad/testdata/Makefile" ;; + "olad/www/Makefile") CONFIG_FILES="$CONFIG_FILES olad/www/Makefile" ;; + "plugins/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/Makefile" ;; + "plugins/artnet/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/artnet/Makefile" ;; + "plugins/artnet/messages/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/artnet/messages/Makefile" ;; + "plugins/artnet/messages/libolaartnetconf.pc") CONFIG_FILES="$CONFIG_FILES plugins/artnet/messages/libolaartnetconf.pc" ;; + "plugins/dmx4linux/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/dmx4linux/Makefile" ;; + "plugins/dummy/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/dummy/Makefile" ;; + "plugins/e131/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/e131/Makefile" ;; + "plugins/e131/e131/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/e131/e131/Makefile" ;; + "plugins/e131/messages/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/e131/messages/Makefile" ;; + "plugins/e131/messages/libolae131conf.pc") CONFIG_FILES="$CONFIG_FILES plugins/e131/messages/libolae131conf.pc" ;; + "plugins/espnet/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/espnet/Makefile" ;; + "plugins/opendmx/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/opendmx/Makefile" ;; + "plugins/pathport/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/pathport/Makefile" ;; + "plugins/sandnet/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/sandnet/Makefile" ;; + "plugins/shownet/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/shownet/Makefile" ;; + "plugins/stageprofi/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/stageprofi/Makefile" ;; + "plugins/usbdmx/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/usbdmx/Makefile" ;; + "plugins/usbpro/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/usbpro/Makefile" ;; + "plugins/usbpro/messages/Makefile") CONFIG_FILES="$CONFIG_FILES plugins/usbpro/messages/Makefile" ;; + "plugins/usbpro/messages/libolausbproconf.pc") CONFIG_FILES="$CONFIG_FILES plugins/usbpro/messages/libolausbproconf.pc" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tools/usbpro/Makefile") CONFIG_FILES="$CONFIG_FILES tools/usbpro/Makefile" ;; + "libola.pc") CONFIG_FILES="$CONFIG_FILES libola.pc" ;; + "libolaserver.pc") CONFIG_FILES="$CONFIG_FILES libolaserver.pc" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +ac_aux_dir!$ac_aux_dir$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +LN_S!$LN_S$ac_delim +CXXCPP!$CXXCPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +ECHO!$ECHO$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +USING_WIN32_TRUE!$USING_WIN32_TRUE$ac_delim +USING_WIN32_FALSE!$USING_WIN32_FALSE$ac_delim +PROTOC!$PROTOC$ac_delim +PKG_CONFIG!$PKG_CONFIG$ac_delim +UUID_CFLAGS!$UUID_CFLAGS$ac_delim +UUID_LIBS!$UUID_LIBS$ac_delim +OSSP_UUID_CFLAGS!$OSSP_UUID_CFLAGS$ac_delim +OSSP_UUID_LIBS!$OSSP_UUID_LIBS$ac_delim +HAVE_DMX4LINUX_TRUE!$HAVE_DMX4LINUX_TRUE$ac_delim +HAVE_DMX4LINUX_FALSE!$HAVE_DMX4LINUX_FALSE$ac_delim +libusb_CFLAGS!$libusb_CFLAGS$ac_delim +libusb_LIBS!$libusb_LIBS$ac_delim +HAVE_LIBUSB_TRUE!$HAVE_LIBUSB_TRUE$ac_delim +HAVE_LIBUSB_FALSE!$HAVE_LIBUSB_FALSE$ac_delim +PLUGIN_LIBS!$PLUGIN_LIBS$ac_delim +OLA_SERVER_LIBS!$OLA_SERVER_LIBS$ac_delim +plugindir!$plugindir$ac_delim +www_datadir!$www_datadir$ac_delim +OLAD_DEFINES!$OLAD_DEFINES$ac_delim +CPPUNIT_CONFIG!$CPPUNIT_CONFIG$ac_delim +CPPUNIT_CFLAGS!$CPPUNIT_CFLAGS$ac_delim +CPPUNIT_LIBS!$CPPUNIT_LIBS$ac_delim +HAVE_LIBMICROHTTPD_TRUE!$HAVE_LIBMICROHTTPD_TRUE$ac_delim +HAVE_LIBMICROHTTPD_FALSE!$HAVE_LIBMICROHTTPD_FALSE$ac_delim +MICROHTTPD_LIBS!$MICROHTTPD_LIBS$ac_delim +BUILD_PYTHON_LIBS_TRUE!$BUILD_PYTHON_LIBS_TRUE$ac_delim +BUILD_PYTHON_LIBS_FALSE!$BUILD_PYTHON_LIBS_FALSE$ac_delim +PYTHON!$PYTHON$ac_delim +PYTHON_VERSION!$PYTHON_VERSION$ac_delim +PYTHON_PREFIX!$PYTHON_PREFIX$ac_delim +PYTHON_EXEC_PREFIX!$PYTHON_EXEC_PREFIX$ac_delim +PYTHON_PLATFORM!$PYTHON_PLATFORM$ac_delim +pythondir!$pythondir$ac_delim +pkgpythondir!$pkgpythondir$ac_delim +pyexecdir!$pyexecdir$ac_delim +pkgpyexecdir!$pkgpyexecdir$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| . 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + "default-1":C) + if test -n "$CONFIG_FILES" && test -n "$CONFIG_HEADERS"; then + # If both these vars are non-empty, then config.status wasn't run by + # automake rules (which always set one or the other to empty). + CONFIG_OTHER=${CONFIG_OTHER-ola/common.h} + fi + echo $CONFIG_OTHER + case "$CONFIG_OTHER" in + *ola/common.h*) + outfile=ola/common.h + stampfile=ola/stamp-common + tmpfile=${outfile}T + dirname="sed s,^.*/,,g" + + echo creating $outfile + cat > $tmpfile << _EOF_ +/* -*- Mode: C -*- + * -------------------------------------------------------------------- + * DO NOT EDIT THIS FILE! It has been automatically generated + * from: configure.in and `echo $outfile|$dirname`.in + * on host: `(hostname || uname -n) 2>/dev/null | sed 1q` + * -------------------------------------------------------------------- + */ + +#ifndef OLA_COMMON_H +#define OLA_COMMON_H 1 + +_EOF_ + + # The ugly but portable cpp stuff comes from here + infile=$srcdir/ola/`echo $outfile | sed 's,.*/,,g;s,\..*$,,g'`-h.in + sed '/^##.*$/d' $infile >> $tmpfile + + cat >> $tmpfile << '_EOF_' + +#endif /* OLA_COMMON_H */ +_EOF_ + + if cmp -s $tmpfile $outfile; then + echo $outfile is unchanged + rm -f $tmpfile + else + mv $tmpfile $outfile + touch $stampfile + fi + esac; + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/open-lighting-architecture/ola-0.8.4/configure.ac b/open-lighting-architecture/ola-0.8.4/configure.ac new file mode 100644 index 0000000..0c4d8cd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/configure.ac @@ -0,0 +1,365 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(configure.ac) +AC_CONFIG_AUX_DIR(config) +AC_SUBST(ac_aux_dir) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(ola, 0.8.4) + +# Checks for programs. +AC_LANG(C++) +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_SIZE_T +AC_HEADER_STDBOOL +AC_C_CONST +AC_C_INLINE +AC_TYPE_PID_T +AC_HEADER_TIME +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_FORK +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_STAT +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([bzero gettimeofday memmove memset mkdir strdup strrchr \ + inet_ntoa inet_aton select socket strerror getifaddrs]) + +# Checks for header files. +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h \ + sys/ioctl.h sys/socket.h sys/time.h syslog.h termios.h \ + endian.h unistd.h linux/if_packet.h]) + +AC_PROG_LIBTOOL + +# windows platform support +AM_CONDITIONAL(USING_WIN32, test "$host_os" = 'mingw32') + +# check for protobuf support +PROTOBUF_SUPPORT([2.3.0]) + +# check for pthread support +AC_CHECK_HEADER([pthread.h], + [], + [AC_MSG_ERROR([Missing pthread, please install it])]) +LIBS="-lpthread $LIBS" + +# check for ipv6 support - taken from unp +AC_MSG_CHECKING(for IPv6 support) +AC_CACHE_VAL(ac_cv_ipv6, + AC_TRY_RUN([ +# include +# include +# include +# include + /* Make sure the definitions for AF_INET6 and struct sockaddr_in6 + * are defined, and that we can actually create an IPv6 TCP socket. + */ + main() + { + int fd; + struct sockaddr_in6 foo; + fd = socket(AF_INET6, SOCK_STREAM, 0); + exit(fd >= 0 ? 0 : 1); + }], + ac_cv_ipv6=yes, + ac_cv_ipv6=no, + ac_cv_ipv6=no)) +AC_MSG_RESULT($ac_cv_ipv6) +if test $ac_cv_ipv6 = yes ; then + AC_DEFINE(IPV6, 1, Define to 1 if the system supports IPv6) +fi + +# Check if sockaddr{} has sa_len member. +AC_CHECK_MEMBER( + [struct sockaddr.sa_len], + AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, define if socket address structures have length fields), + , + [#include + #include ]) + +AC_CHECK_MEMBER( + struct sockaddr_dl.sdl_family, + AC_DEFINE(HAVE_SOCKADDR_DL_STRUCT, 1, define if we have sockaddr_dl), + , + [#include + #include ]) + +# check for SO_NOSIGPIPE or MSG_NOSIGNAL +AC_CHECK_DECLS(MSG_NOSIGNAL, + , + have_msg_no_pipe=no, + [#include + #include ]) + +AC_CHECK_DECLS(SO_NOSIGPIPE, + , + have_so_no_pipe=no, + [#include + #include ]) + +if test "${have_msg_no_pipe}" = "no" && test "${have_so_no_pipe}" = "no"; then + AC_MSG_ERROR([Your system needs either MSG_NOSIGNAL or SO_NOSIGPIPE]) +fi + +# Check for pkg-config +PKG_PROG_PKG_CONFIG + +if test -z "$PKG_CONFIG"; then + AC_MSG_ERROR([Missing pkg-config, please install it]) +fi + +# check for uuid +# uuid handling is quite complex as we can use either the OSSP uuid or the one +# with e2fsprogs. On top of that the header file is different on different +#platforms +use_ossp_uuid="no" +PKG_CHECK_MODULES( + UUID, + [uuid], + [AC_CHECK_HEADERS( + [ossp/uuid.h], + [use_ossp_uuid="yes"], + [AC_CHECK_HEADERS( + [uuid/uuid.h] + [], + [AC_CHECK_LIB([uuid], + [uuid_generate], + [], + [use_ossp_uuid="yes"])])], + [] + )], + # the uuid pkg wasn't found, let's try ossp-uuid instead + [PKG_CHECK_MODULES( + OSSP_UUID, + [ossp-uuid], + [use_ossp_uuid="yes"], + # if this fails, then our last chance is to check for uuid/uuid.h (present + # on OS X by default). + [AC_CHECK_HEADERS( + [uuid/uuid.h], + [], + [AC_MSG_ERROR([Missing the uuid library])] + )] + )] +) + +if test "${use_ossp_uuid}" = "yes"; then + AC_DEFINE(USE_OSSP_UUID, 1, [defined if we should use the ossp uuid lib]) +fi + +# check for plugin dependencies. We also build a list of plugins that we're +# going to compile here so the binary knows what to link against +PLUGINS="artnet dummy espnet e131 opendmx pathport sandnet shownet stageprofi usbpro" + +# check for dmx4linux +have_dmx4linux="" +AC_CHECK_LIB(dmx4linux, DMXdev, [have_dmx4linux="yes"]) +AC_CHECK_HEADER( + [dmx/dmxioctl.h], + [], + [have_dmx4linux=""]) + +AM_CONDITIONAL(HAVE_DMX4LINUX, test "${have_dmx4linux}" = "yes") + +if test "${have_dmx4linux}" = "yes"; then + PLUGINS="${PLUGINS} dmx4linux" + AC_DEFINE(HAVE_DMX4LINUX, 1, [define if dmx4linux is installed]) +fi + +# check for libusb +have_libusb="no" +PKG_CHECK_MODULES(libusb, [libusb-1.0 >= 1.0.2], [have_libusb="yes"], [true]) +AM_CONDITIONAL(HAVE_LIBUSB, test "${have_libusb}" = "yes") + +if test "${have_libusb}" = "yes"; then + PLUGINS="${PLUGINS} usbdmx" + AC_DEFINE(HAVE_LIBUSB, 1, [define if libusb is installed]) +fi + +# create a list of plugin libs +PLUGIN_LIBS='' +OLA_SERVER_LIBS='' +for p in $PLUGINS; do + LIB_NAME="libola$p" + PLUGIN_LIBS="$PLUGIN_LIBS \$(top_builddir)/plugins/$p/$LIB_NAME.la" + OLA_SERVER_LIBS="$OLA_SERVER_LIBS -l$LIB_NAME" +done + +AC_SUBST(PLUGIN_LIBS) +AC_SUBST(OLA_SERVER_LIBS) + +# plugin & html data directories +plugindir=$libdir/olad +ola_datadir=$datadir/olad +www_datadir=$ola_datadir/www +AC_SUBST(plugindir) +AC_SUBST(www_datadir) + +OLAD_DEFINES="-DHTTP_DATA_DIR=\\\"$www_datadir\\\" -DPLUGIN_DIR=\\\"$plugindir\\\" " +AC_SUBST(OLAD_DEFINES) + +# check for cppunit +AM_PATH_CPPUNIT( + 1.9.6, + [], + [AC_MSG_ERROR([Missing cppunit, please install >= 1.9.6])]) + +# gcov +AC_ARG_ENABLE(gcov, + AC_HELP_STRING([--enable-gcov], + [turn on code coverage analysis tools]), + [use_gcov="yes"], + ) + +if test "${use_gcov}" = "yes"; then + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + CXXFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -fprofile-arcs" +fi + +# look for microhttpd +AC_CHECK_LIB(microhttpd, MHD_start_daemon, [have_microhttpd="yes"]) +AM_CONDITIONAL(HAVE_LIBMICROHTTPD, test "${have_microhttpd}" = "yes") + +if test "${have_microhttpd}" = "yes"; then + AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [define if libmicrohttpd is installed]) + MICROHTTPD_LIBS="-lmicrohttpd" +else + MICROHTTPD_LIBS='' +fi +AC_SUBST(MICROHTTPD_LIBS) + +# python wrappers +AC_ARG_ENABLE(python-libs, + AC_HELP_STRING([--enable-python-libs], + [Build the python interface]), + [build_python_libs="yes"] + ) +AM_CONDITIONAL(BUILD_PYTHON_LIBS, test "${build_python_libs}" = "yes") + +if test "${build_python_libs}" = "yes"; then + AM_PATH_PYTHON(2.4) +fi + +AC_OUTPUT_COMMANDS([ + if test -n "$CONFIG_FILES" && test -n "$CONFIG_HEADERS"; then + # If both these vars are non-empty, then config.status wasn't run by + # automake rules (which always set one or the other to empty). + CONFIG_OTHER=${CONFIG_OTHER-ola/common.h} + fi + echo $CONFIG_OTHER + case "$CONFIG_OTHER" in + *ola/common.h*) + outfile=ola/common.h + stampfile=ola/stamp-common + tmpfile=${outfile}T + dirname="sed s,^.*/,,g" + + echo creating $outfile + cat > $tmpfile << _EOF_ +/* -*- Mode: C -*- + * -------------------------------------------------------------------- + * DO NOT EDIT THIS FILE! It has been automatically generated + * from: configure.in and `echo $outfile|$dirname`.in + * on host: `(hostname || uname -n) 2>/dev/null | sed 1q` + * -------------------------------------------------------------------- + */ + +#ifndef OLA_COMMON_H +#define OLA_COMMON_H 1 + +_EOF_ + + # The ugly but portable cpp stuff comes from here + infile=$srcdir/ola/`echo $outfile | sed 's,.*/,,g;s,\..*$,,g'`-h.in + sed '/^##.*$/d' $infile >> $tmpfile + + cat >> $tmpfile << '_EOF_' + +#endif /* OLA_COMMON_H */ +_EOF_ + + if cmp -s $tmpfile $outfile; then + echo $outfile is unchanged + rm -f $tmpfile + else + mv $tmpfile $outfile + touch $stampfile + fi + esac; +],[ + srcdir=$srcdir + have_threads=$have_threads +]) + + +# output +AC_OUTPUT( Makefile\ + common/Makefile\ + common/export_map/Makefile\ + common/logging/Makefile\ + common/protocol/Makefile\ + common/rdm/Makefile\ + common/rpc/Makefile\ + common/network/Makefile\ + common/utils/Makefile\ + common/web/Makefile\ + debian/Makefile\ + include/Makefile\ + include/ola/Makefile\ + include/ola/network/Makefile\ + include/ola/rdm/Makefile\ + include/ola/web/Makefile\ + include/olad/Makefile\ + ola/Makefile \ + python/Makefile \ + python/rpc/Makefile \ + python/examples/Makefile \ + olad/Makefile \ + olad/OlaVersion.h \ + olad/testdata/Makefile \ + olad/www/Makefile \ + plugins/Makefile \ + plugins/artnet/Makefile \ + plugins/artnet/messages/Makefile \ + plugins/artnet/messages/libolaartnetconf.pc \ + plugins/dmx4linux/Makefile \ + plugins/dummy/Makefile \ + plugins/e131/Makefile \ + plugins/e131/e131/Makefile \ + plugins/e131/messages/Makefile \ + plugins/e131/messages/libolae131conf.pc \ + plugins/espnet/Makefile \ + plugins/opendmx/Makefile \ + plugins/pathport/Makefile \ + plugins/sandnet/Makefile \ + plugins/shownet/Makefile \ + plugins/stageprofi/Makefile \ + plugins/usbdmx/Makefile \ + plugins/usbpro/Makefile \ + plugins/usbpro/messages/Makefile \ + plugins/usbpro/messages/libolausbproconf.pc \ + tools/Makefile \ + tools/usbpro/Makefile \ + libola.pc \ + libolaserver.pc \ + ) diff --git a/open-lighting-architecture/ola-0.8.4/debian/Makefile.am b/open-lighting-architecture/ola-0.8.4/debian/Makefile.am new file mode 100644 index 0000000..ae7911f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/Makefile.am @@ -0,0 +1,4 @@ +# debian build files +EXTRA_DIST = changelog compat control copyright dirs docs libola1.dirs \ + libola1.install libola-dev.dirs libola-dev.install Makefile.am \ + olad.dirs olad.install postinst postrm rules diff --git a/open-lighting-architecture/ola-0.8.4/debian/Makefile.in b/open-lighting-architecture/ola-0.8.4/debian/Makefile.in new file mode 100644 index 0000000..35dbe50 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/Makefile.in @@ -0,0 +1,354 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = debian +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ + +# debian build files +EXTRA_DIST = changelog compat control copyright dirs docs libola1.dirs \ + libola1.install libola-dev.dirs libola-dev.install Makefile.am \ + olad.dirs olad.install postinst postrm rules + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu debian/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu debian/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/debian/changelog b/open-lighting-architecture/ola-0.8.4/debian/changelog new file mode 100644 index 0000000..4b4e878 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/changelog @@ -0,0 +1,6 @@ +ola (0.7.3-1) unstable; urgency=low + + * Initial release + + -- Simon Newton Sun, 16 May 2010 04:03:33 +0000 + diff --git a/open-lighting-architecture/ola-0.8.4/debian/compat b/open-lighting-architecture/ola-0.8.4/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/compat @@ -0,0 +1 @@ +7 diff --git a/open-lighting-architecture/ola-0.8.4/debian/control b/open-lighting-architecture/ola-0.8.4/debian/control new file mode 100644 index 0000000..0165cef --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/control @@ -0,0 +1,31 @@ +Source: ola +Priority: extra +Maintainer: Simon Newton +Build-Depends: debhelper (>= 7), autotools-dev +Standards-Version: 3.8.0 +Section: libs +Homepage: http://code.google.com/p/linux-lighting/ + +Package: libola-dev +Section: libdevel +Architecture: any +Depends: libola1 (= ${binary:Version}) +Description: Open Lighting Architecture + The Open Lighting Architecture (OLA) provides a plugin framework for + distributing DMX512 control signals on Mac and Linux. + +Package: libola1 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Open Lighting Architecture Library + The Open Lighting Architecture (OLA) provides a plugin framework for + distributing DMX512 control signals on Mac and Linux. + +Package: olad +Section: electronics +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Open Lighting Architecture Daemon + The Open Lighting Architecture (OLA) provides a plugin framework for + distributing DMX512 control signals on Mac and Linux. diff --git a/open-lighting-architecture/ola-0.8.4/debian/copyright b/open-lighting-architecture/ola-0.8.4/debian/copyright new file mode 100644 index 0000000..78cd51f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/copyright @@ -0,0 +1,30 @@ +This package was debianized by Simon Newton on +Sun, 16 May 2010 04:03:33 +0000. + +It was downloaded from http://code.google.com/p/linux-lighting/ + +Upstream Author: + + Simon Newton + +Copyright: + + Copyright (C) 2005 Simon Newton + +License: + + You are free to distribute this software under the terms of + the GNU General Public License either version of the License, + or (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., Franklin St, Fifth Floor, Boston, MA - USA + +The Debian packaging is (C) 2010, Simon Newton and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. diff --git a/open-lighting-architecture/ola-0.8.4/debian/dirs b/open-lighting-architecture/ola-0.8.4/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/open-lighting-architecture/ola-0.8.4/debian/docs b/open-lighting-architecture/ola-0.8.4/debian/docs new file mode 100644 index 0000000..d0bf7a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +README.rpm +TODO diff --git a/open-lighting-architecture/ola-0.8.4/debian/libola-dev.dirs b/open-lighting-architecture/ola-0.8.4/debian/libola-dev.dirs new file mode 100644 index 0000000..4418816 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/libola-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include diff --git a/open-lighting-architecture/ola-0.8.4/debian/libola-dev.install b/open-lighting-architecture/ola-0.8.4/debian/libola-dev.install new file mode 100644 index 0000000..93fa2ac --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/libola-dev.install @@ -0,0 +1,8 @@ +usr/include/* +usr/lib/pkgconfig/* +usr/lib/libola*.so +usr/lib/libola*.la +usr/lib/libola*.a +usr/lib/olad/libola*.so +usr/lib/olad/libola*.la +usr/lib/olad/libola*.a diff --git a/open-lighting-architecture/ola-0.8.4/debian/libola1.dirs b/open-lighting-architecture/ola-0.8.4/debian/libola1.dirs new file mode 100644 index 0000000..6845771 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/libola1.dirs @@ -0,0 +1 @@ +usr/lib diff --git a/open-lighting-architecture/ola-0.8.4/debian/libola1.install b/open-lighting-architecture/ola-0.8.4/debian/libola1.install new file mode 100644 index 0000000..be022f0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/libola1.install @@ -0,0 +1,4 @@ +usr/lib/libola*.so.? +usr/lib/libola*.so.?.?.* +usr/lib/olad/libola*.so.? +usr/lib/olad/libola*.so.?.?.* diff --git a/open-lighting-architecture/ola-0.8.4/debian/olad.dirs b/open-lighting-architecture/ola-0.8.4/debian/olad.dirs new file mode 100644 index 0000000..0e927ca --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/olad.dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/olad/www diff --git a/open-lighting-architecture/ola-0.8.4/debian/olad.install b/open-lighting-architecture/ola-0.8.4/debian/olad.install new file mode 100644 index 0000000..fad474a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/olad.install @@ -0,0 +1,2 @@ +usr/bin/* +usr/share/olad/* diff --git a/open-lighting-architecture/ola-0.8.4/debian/postinst b/open-lighting-architecture/ola-0.8.4/debian/postinst new file mode 100644 index 0000000..61b5259 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/postinst @@ -0,0 +1,41 @@ +#!/bin/sh +# postinst script for ola +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/open-lighting-architecture/ola-0.8.4/debian/postrm b/open-lighting-architecture/ola-0.8.4/debian/postrm new file mode 100644 index 0000000..7b81acc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/postrm @@ -0,0 +1,39 @@ +#!/bin/sh +# postrm script for ola +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/open-lighting-architecture/ola-0.8.4/debian/rules b/open-lighting-architecture/ola-0.8.4/debian/rules new file mode 100755 index 0000000..44515c8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/debian/rules @@ -0,0 +1,108 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +else +CROSS= --build $(DEB_BUILD_GNU_TYPE) +endif + + + + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +config.status: configure + dh_testdir + # Add here commands to configure the package. +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" + + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + [ ! -f Makefile ] || $(MAKE) distclean + rm -f config.sub config.guess + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs -V + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/open-lighting-architecture/ola-0.8.4/include/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/Makefile.am new file mode 100644 index 0000000..0988a78 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = ola olad diff --git a/open-lighting-architecture/ola-0.8.4/include/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/Makefile.in new file mode 100644 index 0000000..0969496 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/Makefile.in @@ -0,0 +1,508 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +SUBDIRS = ola olad +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/ActionQueue.h b/open-lighting-architecture/ola-0.8.4/include/ola/ActionQueue.h new file mode 100644 index 0000000..e5e667b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/ActionQueue.h @@ -0,0 +1,78 @@ +/* + * 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 Library 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. + * + * ActionQueue.h + * Interface for the ActionQueue class. + * Copyright (C) 2005-2010 Simon Newton + * + * An ActionQueue allows Actions to be queued up and the executed + * asynchronously. Perform(on_done) is called on each action in turn and an + * action calls on_done when it's completed. + */ + +#ifndef INCLUDE_OLA_ACTIONQUEUE_H_ +#define INCLUDE_OLA_ACTIONQUEUE_H_ + +#include +#include "ola/Callback.h" +#include "ola/Closure.h" + +namespace ola { + +/* + * The base action class + */ +class Action { + public: + Action() {} + virtual ~Action() {} + + // returns true if the failure of this action causes aborts the entire + // chain. + virtual bool IsFatal() const = 0; + virtual bool Failed() const = 0; + + virtual void Perform(SingleUseClosure *on_done) = 0; +}; + + +/* + * An Action Queue. Action objects can be added to the queue and are then run + * sequentially. + */ +class ActionQueue { + public: + ActionQueue(SingleUseCallback1 *on_complete): + m_on_complete(on_complete), + m_action_index(-1), + m_success(true) { + } + ~ActionQueue(); + + void AddAction(Action *action); + void NextAction(); + bool WasSuccessful() const { return m_success; } + + unsigned int ActionCount() const { return m_actions.size(); } + Action *GetAction(unsigned int i); + + private: + SingleUseCallback1 *m_on_complete; + std::vector m_actions; + int m_action_index; + bool m_success; +}; +} // ola +#endif // INCLUDE_OLA_ACTIONQUEUE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/BaseTypes.h b/open-lighting-architecture/ola-0.8.4/include/ola/BaseTypes.h new file mode 100644 index 0000000..79f3197 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/BaseTypes.h @@ -0,0 +1,37 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * BaseTypes.h + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLA_BASETYPES_H_ +#define INCLUDE_OLA_BASETYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +enum { DMX_UNIVERSE_SIZE = 512 }; +static const int OLA_DEFAULT_PORT = 9010; +static const uint16_t OPEN_LIGHTING_ESTA_CODE = 0x7a70; + +#ifdef __cplusplus +} +#endif + +#endif // INCLUDE_OLA_BASETYPES_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Callback.h b/open-lighting-architecture/ola-0.8.4/include/ola/Callback.h new file mode 100644 index 0000000..d2ea941 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Callback.h @@ -0,0 +1,2217 @@ +/* + * 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 Library 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. + * + * Callback.h + * Callback classes, these are similar to closures but can take arguments at + * exec time. + * Copyright (C) 2005-2010 Simon Newton + * + * THIS FILE IS AUTOGENERATED! + * Please run edit & run gen_callbacks.py if you need to add more types. + */ + +#ifndef INCLUDE_OLA_CALLBACK_H_ +#define INCLUDE_OLA_CALLBACK_H_ + +namespace ola { + +// 1 argument callbacks +template +class BaseCallback1 { + public: + virtual ~BaseCallback1() {} + virtual ReturnType Run(Arg0 arg0) = 0; + virtual ReturnType DoRun(Arg0 arg0) = 0; +}; + + +// A callback, this can be called multiple times +template +class Callback1: public BaseCallback1 { + public: + virtual ~Callback1() {} + ReturnType Run(Arg0 arg0) { return DoRun(arg0); } +}; + + +// A single use callback, this deletes itself after it's run. +template +class SingleUseCallback1: public BaseCallback1 { + public: + virtual ~SingleUseCallback1() {} + ReturnType Run(Arg0 arg0) { + ReturnType ret = DoRun(arg0); + delete this; + return ret; + } +}; + + +// A single use callback returning void. +template +class SingleUseCallback1: public BaseCallback1 { + public: + virtual ~SingleUseCallback1() {} + void Run(Arg0 arg0) { + DoRun(arg0); + delete this; + } +}; + + +// A Function callback with 0 create-time args and 1 exec time args +template +class FunctionCallback0_1: public Parent { + public: + typedef ReturnType (*Function)(Arg0); + FunctionCallback0_1(Function callback): + Parent(), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0) { + return m_callback(arg0); + } + private: + Function m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + ReturnType (*callback)(Arg0)) { + return new FunctionCallback0_1< + SingleUseCallback1, + ReturnType, + Arg0>( + callback); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + ReturnType (*callback)(Arg0)) { + return new FunctionCallback0_1< + Callback1, + ReturnType, + Arg0>( + callback); +} + + +// A Method callback with 0 create-time args and 1 exec time args +template +class MethodCallback0_1: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg0); + MethodCallback0_1(Class *object, Method callback): + Parent(), + m_object(object), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0) { + return (m_object->*m_callback)(arg0); + } + private: + Class *m_object; + Method m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(Arg0)) { + return new MethodCallback0_1, + ReturnType, + Arg0>( + object, + method); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + Class* object, + ReturnType (Class::*method)(Arg0)) { + return new MethodCallback0_1, + ReturnType, + Arg0>( + object, + method); +} + + +// A Function callback with 1 create-time args and 1 exec time args +template +class FunctionCallback1_1: public Parent { + public: + typedef ReturnType (*Function)(A0, Arg0); + FunctionCallback1_1(Function callback, A0 a0): + Parent(), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0) { + return m_callback(m_a0, arg0); + } + private: + Function m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + ReturnType (*callback)(A0, Arg0), + A0 a0) { + return new FunctionCallback1_1< + SingleUseCallback1, + ReturnType, + A0, + Arg0>( + callback, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + ReturnType (*callback)(A0, Arg0), + A0 a0) { + return new FunctionCallback1_1< + Callback1, + ReturnType, + A0, + Arg0>( + callback, + a0); +} + + +// A Method callback with 1 create-time args and 1 exec time args +template +class MethodCallback1_1: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, Arg0); + MethodCallback1_1(Class *object, Method callback, A0 a0): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0) { + return (m_object->*m_callback)(m_a0, arg0); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0), + A0 a0) { + return new MethodCallback1_1, + ReturnType, + A0, + Arg0>( + object, + method, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0), + A0 a0) { + return new MethodCallback1_1, + ReturnType, + A0, + Arg0>( + object, + method, + a0); +} + + +// A Function callback with 2 create-time args and 1 exec time args +template +class FunctionCallback2_1: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, Arg0); + FunctionCallback2_1(Function callback, A0 a0, A1 a1): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0) { + return m_callback(m_a0, m_a1, arg0); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + ReturnType (*callback)(A0, A1, Arg0), + A0 a0, + A1 a1) { + return new FunctionCallback2_1< + SingleUseCallback1, + ReturnType, + A0, + A1, + Arg0>( + callback, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + ReturnType (*callback)(A0, A1, Arg0), + A0 a0, + A1 a1) { + return new FunctionCallback2_1< + Callback1, + ReturnType, + A0, + A1, + Arg0>( + callback, + a0, + a1); +} + + +// A Method callback with 2 create-time args and 1 exec time args +template +class MethodCallback2_1: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, Arg0); + MethodCallback2_1(Class *object, Method callback, A0 a0, A1 a1): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0) { + return (m_object->*m_callback)(m_a0, m_a1, arg0); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0), + A0 a0, + A1 a1) { + return new MethodCallback2_1, + ReturnType, + A0, + A1, + Arg0>( + object, + method, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0), + A0 a0, + A1 a1) { + return new MethodCallback2_1, + ReturnType, + A0, + A1, + Arg0>( + object, + method, + a0, + a1); +} + + +// A Function callback with 3 create-time args and 1 exec time args +template +class FunctionCallback3_1: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, A2, Arg0); + FunctionCallback3_1(Function callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0) { + return m_callback(m_a0, m_a1, m_a2, arg0); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + ReturnType (*callback)(A0, A1, A2, Arg0), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_1< + SingleUseCallback1, + ReturnType, + A0, + A1, + A2, + Arg0>( + callback, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + ReturnType (*callback)(A0, A1, A2, Arg0), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_1< + Callback1, + ReturnType, + A0, + A1, + A2, + Arg0>( + callback, + a0, + a1, + a2); +} + + +// A Method callback with 3 create-time args and 1 exec time args +template +class MethodCallback3_1: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0); + MethodCallback3_1(Class *object, Method callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0) { + return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback1* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_1, + ReturnType, + A0, + A1, + A2, + Arg0>( + object, + method, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback1* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_1, + ReturnType, + A0, + A1, + A2, + Arg0>( + object, + method, + a0, + a1, + a2); +} + + +// 2 argument callbacks +template +class BaseCallback2 { + public: + virtual ~BaseCallback2() {} + virtual ReturnType Run(Arg0 arg0, Arg1 arg1) = 0; + virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1) = 0; +}; + + +// A callback, this can be called multiple times +template +class Callback2: public BaseCallback2 { + public: + virtual ~Callback2() {} + ReturnType Run(Arg0 arg0, Arg1 arg1) { return DoRun(arg0, arg1); } +}; + + +// A single use callback, this deletes itself after it's run. +template +class SingleUseCallback2: public BaseCallback2 { + public: + virtual ~SingleUseCallback2() {} + ReturnType Run(Arg0 arg0, Arg1 arg1) { + ReturnType ret = DoRun(arg0, arg1); + delete this; + return ret; + } +}; + + +// A single use callback returning void. +template +class SingleUseCallback2: public BaseCallback2 { + public: + virtual ~SingleUseCallback2() {} + void Run(Arg0 arg0, Arg1 arg1) { + DoRun(arg0, arg1); + delete this; + } +}; + + +// A Function callback with 0 create-time args and 2 exec time args +template +class FunctionCallback0_2: public Parent { + public: + typedef ReturnType (*Function)(Arg0, Arg1); + FunctionCallback0_2(Function callback): + Parent(), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return m_callback(arg0, arg1); + } + private: + Function m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + ReturnType (*callback)(Arg0, Arg1)) { + return new FunctionCallback0_2< + SingleUseCallback2, + ReturnType, + Arg0, + Arg1>( + callback); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + ReturnType (*callback)(Arg0, Arg1)) { + return new FunctionCallback0_2< + Callback2, + ReturnType, + Arg0, + Arg1>( + callback); +} + + +// A Method callback with 0 create-time args and 2 exec time args +template +class MethodCallback0_2: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg0, Arg1); + MethodCallback0_2(Class *object, Method callback): + Parent(), + m_object(object), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return (m_object->*m_callback)(arg0, arg1); + } + private: + Class *m_object; + Method m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1)) { + return new MethodCallback0_2, + ReturnType, + Arg0, + Arg1>( + object, + method); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1)) { + return new MethodCallback0_2, + ReturnType, + Arg0, + Arg1>( + object, + method); +} + + +// A Function callback with 1 create-time args and 2 exec time args +template +class FunctionCallback1_2: public Parent { + public: + typedef ReturnType (*Function)(A0, Arg0, Arg1); + FunctionCallback1_2(Function callback, A0 a0): + Parent(), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return m_callback(m_a0, arg0, arg1); + } + private: + Function m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + ReturnType (*callback)(A0, Arg0, Arg1), + A0 a0) { + return new FunctionCallback1_2< + SingleUseCallback2, + ReturnType, + A0, + Arg0, + Arg1>( + callback, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + ReturnType (*callback)(A0, Arg0, Arg1), + A0 a0) { + return new FunctionCallback1_2< + Callback2, + ReturnType, + A0, + Arg0, + Arg1>( + callback, + a0); +} + + +// A Method callback with 1 create-time args and 2 exec time args +template +class MethodCallback1_2: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, Arg0, Arg1); + MethodCallback1_2(Class *object, Method callback, A0 a0): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return (m_object->*m_callback)(m_a0, arg0, arg1); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1), + A0 a0) { + return new MethodCallback1_2, + ReturnType, + A0, + Arg0, + Arg1>( + object, + method, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1), + A0 a0) { + return new MethodCallback1_2, + ReturnType, + A0, + Arg0, + Arg1>( + object, + method, + a0); +} + + +// A Function callback with 2 create-time args and 2 exec time args +template +class FunctionCallback2_2: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, Arg0, Arg1); + FunctionCallback2_2(Function callback, A0 a0, A1 a1): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return m_callback(m_a0, m_a1, arg0, arg1); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1), + A0 a0, + A1 a1) { + return new FunctionCallback2_2< + SingleUseCallback2, + ReturnType, + A0, + A1, + Arg0, + Arg1>( + callback, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1), + A0 a0, + A1 a1) { + return new FunctionCallback2_2< + Callback2, + ReturnType, + A0, + A1, + Arg0, + Arg1>( + callback, + a0, + a1); +} + + +// A Method callback with 2 create-time args and 2 exec time args +template +class MethodCallback2_2: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1); + MethodCallback2_2(Class *object, Method callback, A0 a0, A1 a1): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1), + A0 a0, + A1 a1) { + return new MethodCallback2_2, + ReturnType, + A0, + A1, + Arg0, + Arg1>( + object, + method, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1), + A0 a0, + A1 a1) { + return new MethodCallback2_2, + ReturnType, + A0, + A1, + Arg0, + Arg1>( + object, + method, + a0, + a1); +} + + +// A Function callback with 3 create-time args and 2 exec time args +template +class FunctionCallback3_2: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1); + FunctionCallback3_2(Function callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return m_callback(m_a0, m_a1, m_a2, arg0, arg1); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_2< + SingleUseCallback2, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1>( + callback, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_2< + Callback2, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1>( + callback, + a0, + a1, + a2); +} + + +// A Method callback with 3 create-time args and 2 exec time args +template +class MethodCallback3_2: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1); + MethodCallback3_2(Class *object, Method callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_2, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1>( + object, + method, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_2, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1>( + object, + method, + a0, + a1, + a2); +} + + +// A Function callback with 4 create-time args and 2 exec time args +template +class FunctionCallback4_2: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, A2, A3, Arg0, Arg1); + FunctionCallback4_2(Function callback, A0 a0, A1 a1, A2 a2, A3 a3): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2), + m_a3(a3) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return m_callback(m_a0, m_a1, m_a2, m_a3, arg0, arg1); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; + A3 m_a3; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2, + A3 a3) { + return new FunctionCallback4_2< + SingleUseCallback2, + ReturnType, + A0, + A1, + A2, + A3, + Arg0, + Arg1>( + callback, + a0, + a1, + a2, + a3); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + ReturnType (*callback)(A0, A1, A2, A3, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2, + A3 a3) { + return new FunctionCallback4_2< + Callback2, + ReturnType, + A0, + A1, + A2, + A3, + Arg0, + Arg1>( + callback, + a0, + a1, + a2, + a3); +} + + +// A Method callback with 4 create-time args and 2 exec time args +template +class MethodCallback4_2: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, A2, A3, Arg0, Arg1); + MethodCallback4_2(Class *object, Method callback, A0 a0, A1 a1, A2 a2, A3 a3): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2), + m_a3(a3) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1) { + return (m_object->*m_callback)(m_a0, m_a1, m_a2, m_a3, arg0, arg1); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; + A3 m_a3; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback2* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2, + A3 a3) { + return new MethodCallback4_2, + ReturnType, + A0, + A1, + A2, + A3, + Arg0, + Arg1>( + object, + method, + a0, + a1, + a2, + a3); +} + + +// Helper method to create a new Callback. +template +inline Callback2* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, A3, Arg0, Arg1), + A0 a0, + A1 a1, + A2 a2, + A3 a3) { + return new MethodCallback4_2, + ReturnType, + A0, + A1, + A2, + A3, + Arg0, + Arg1>( + object, + method, + a0, + a1, + a2, + a3); +} + + +// 3 argument callbacks +template +class BaseCallback3 { + public: + virtual ~BaseCallback3() {} + virtual ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0; + virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) = 0; +}; + + +// A callback, this can be called multiple times +template +class Callback3: public BaseCallback3 { + public: + virtual ~Callback3() {} + ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) { return DoRun(arg0, arg1, arg2); } +}; + + +// A single use callback, this deletes itself after it's run. +template +class SingleUseCallback3: public BaseCallback3 { + public: + virtual ~SingleUseCallback3() {} + ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + ReturnType ret = DoRun(arg0, arg1, arg2); + delete this; + return ret; + } +}; + + +// A single use callback returning void. +template +class SingleUseCallback3: public BaseCallback3 { + public: + virtual ~SingleUseCallback3() {} + void Run(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + DoRun(arg0, arg1, arg2); + delete this; + } +}; + + +// A Function callback with 0 create-time args and 3 exec time args +template +class FunctionCallback0_3: public Parent { + public: + typedef ReturnType (*Function)(Arg0, Arg1, Arg2); + FunctionCallback0_3(Function callback): + Parent(), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return m_callback(arg0, arg1, arg2); + } + private: + Function m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + ReturnType (*callback)(Arg0, Arg1, Arg2)) { + return new FunctionCallback0_3< + SingleUseCallback3, + ReturnType, + Arg0, + Arg1, + Arg2>( + callback); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + ReturnType (*callback)(Arg0, Arg1, Arg2)) { + return new FunctionCallback0_3< + Callback3, + ReturnType, + Arg0, + Arg1, + Arg2>( + callback); +} + + +// A Method callback with 0 create-time args and 3 exec time args +template +class MethodCallback0_3: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg0, Arg1, Arg2); + MethodCallback0_3(Class *object, Method callback): + Parent(), + m_object(object), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return (m_object->*m_callback)(arg0, arg1, arg2); + } + private: + Class *m_object; + Method m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1, Arg2)) { + return new MethodCallback0_3, + ReturnType, + Arg0, + Arg1, + Arg2>( + object, + method); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1, Arg2)) { + return new MethodCallback0_3, + ReturnType, + Arg0, + Arg1, + Arg2>( + object, + method); +} + + +// A Function callback with 1 create-time args and 3 exec time args +template +class FunctionCallback1_3: public Parent { + public: + typedef ReturnType (*Function)(A0, Arg0, Arg1, Arg2); + FunctionCallback1_3(Function callback, A0 a0): + Parent(), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return m_callback(m_a0, arg0, arg1, arg2); + } + private: + Function m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + ReturnType (*callback)(A0, Arg0, Arg1, Arg2), + A0 a0) { + return new FunctionCallback1_3< + SingleUseCallback3, + ReturnType, + A0, + Arg0, + Arg1, + Arg2>( + callback, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + ReturnType (*callback)(A0, Arg0, Arg1, Arg2), + A0 a0) { + return new FunctionCallback1_3< + Callback3, + ReturnType, + A0, + Arg0, + Arg1, + Arg2>( + callback, + a0); +} + + +// A Method callback with 1 create-time args and 3 exec time args +template +class MethodCallback1_3: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, Arg0, Arg1, Arg2); + MethodCallback1_3(Class *object, Method callback, A0 a0): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return (m_object->*m_callback)(m_a0, arg0, arg1, arg2); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2), + A0 a0) { + return new MethodCallback1_3, + ReturnType, + A0, + Arg0, + Arg1, + Arg2>( + object, + method, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2), + A0 a0) { + return new MethodCallback1_3, + ReturnType, + A0, + Arg0, + Arg1, + Arg2>( + object, + method, + a0); +} + + +// A Function callback with 2 create-time args and 3 exec time args +template +class FunctionCallback2_3: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, Arg0, Arg1, Arg2); + FunctionCallback2_3(Function callback, A0 a0, A1 a1): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return m_callback(m_a0, m_a1, arg0, arg1, arg2); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2), + A0 a0, + A1 a1) { + return new FunctionCallback2_3< + SingleUseCallback3, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2>( + callback, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2), + A0 a0, + A1 a1) { + return new FunctionCallback2_3< + Callback3, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2>( + callback, + a0, + a1); +} + + +// A Method callback with 2 create-time args and 3 exec time args +template +class MethodCallback2_3: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1, Arg2); + MethodCallback2_3(Class *object, Method callback, A0 a0, A1 a1): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1, arg2); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2), + A0 a0, + A1 a1) { + return new MethodCallback2_3, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2>( + object, + method, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2), + A0 a0, + A1 a1) { + return new MethodCallback2_3, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2>( + object, + method, + a0, + a1); +} + + +// A Function callback with 3 create-time args and 3 exec time args +template +class FunctionCallback3_3: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1, Arg2); + FunctionCallback3_3(Function callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return m_callback(m_a0, m_a1, m_a2, arg0, arg1, arg2); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_3< + SingleUseCallback3, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2>( + callback, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_3< + Callback3, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2>( + callback, + a0, + a1, + a2); +} + + +// A Method callback with 3 create-time args and 3 exec time args +template +class MethodCallback3_3: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1, Arg2); + MethodCallback3_3(Class *object, Method callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2) { + return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1, arg2); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback3* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_3, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2>( + object, + method, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback3* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_3, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2>( + object, + method, + a0, + a1, + a2); +} + + +// 4 argument callbacks +template +class BaseCallback4 { + public: + virtual ~BaseCallback4() {} + virtual ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0; + virtual ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) = 0; +}; + + +// A callback, this can be called multiple times +template +class Callback4: public BaseCallback4 { + public: + virtual ~Callback4() {} + ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { return DoRun(arg0, arg1, arg2, arg3); } +}; + + +// A single use callback, this deletes itself after it's run. +template +class SingleUseCallback4: public BaseCallback4 { + public: + virtual ~SingleUseCallback4() {} + ReturnType Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + ReturnType ret = DoRun(arg0, arg1, arg2, arg3); + delete this; + return ret; + } +}; + + +// A single use callback returning void. +template +class SingleUseCallback4: public BaseCallback4 { + public: + virtual ~SingleUseCallback4() {} + void Run(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + DoRun(arg0, arg1, arg2, arg3); + delete this; + } +}; + + +// A Function callback with 0 create-time args and 4 exec time args +template +class FunctionCallback0_4: public Parent { + public: + typedef ReturnType (*Function)(Arg0, Arg1, Arg2, Arg3); + FunctionCallback0_4(Function callback): + Parent(), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return m_callback(arg0, arg1, arg2, arg3); + } + private: + Function m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + ReturnType (*callback)(Arg0, Arg1, Arg2, Arg3)) { + return new FunctionCallback0_4< + SingleUseCallback4, + ReturnType, + Arg0, + Arg1, + Arg2, + Arg3>( + callback); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + ReturnType (*callback)(Arg0, Arg1, Arg2, Arg3)) { + return new FunctionCallback0_4< + Callback4, + ReturnType, + Arg0, + Arg1, + Arg2, + Arg3>( + callback); +} + + +// A Method callback with 0 create-time args and 4 exec time args +template +class MethodCallback0_4: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg0, Arg1, Arg2, Arg3); + MethodCallback0_4(Class *object, Method callback): + Parent(), + m_object(object), + m_callback(callback) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return (m_object->*m_callback)(arg0, arg1, arg2, arg3); + } + private: + Class *m_object; + Method m_callback; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1, Arg2, Arg3)) { + return new MethodCallback0_4, + ReturnType, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + Class* object, + ReturnType (Class::*method)(Arg0, Arg1, Arg2, Arg3)) { + return new MethodCallback0_4, + ReturnType, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method); +} + + +// A Function callback with 1 create-time args and 4 exec time args +template +class FunctionCallback1_4: public Parent { + public: + typedef ReturnType (*Function)(A0, Arg0, Arg1, Arg2, Arg3); + FunctionCallback1_4(Function callback, A0 a0): + Parent(), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return m_callback(m_a0, arg0, arg1, arg2, arg3); + } + private: + Function m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + ReturnType (*callback)(A0, Arg0, Arg1, Arg2, Arg3), + A0 a0) { + return new FunctionCallback1_4< + SingleUseCallback4, + ReturnType, + A0, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + ReturnType (*callback)(A0, Arg0, Arg1, Arg2, Arg3), + A0 a0) { + return new FunctionCallback1_4< + Callback4, + ReturnType, + A0, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0); +} + + +// A Method callback with 1 create-time args and 4 exec time args +template +class MethodCallback1_4: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, Arg0, Arg1, Arg2, Arg3); + MethodCallback1_4(Class *object, Method callback, A0 a0): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return (m_object->*m_callback)(m_a0, arg0, arg1, arg2, arg3); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2, Arg3), + A0 a0) { + return new MethodCallback1_4, + ReturnType, + A0, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, Arg0, Arg1, Arg2, Arg3), + A0 a0) { + return new MethodCallback1_4, + ReturnType, + A0, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0); +} + + +// A Function callback with 2 create-time args and 4 exec time args +template +class FunctionCallback2_4: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, Arg0, Arg1, Arg2, Arg3); + FunctionCallback2_4(Function callback, A0 a0, A1 a1): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return m_callback(m_a0, m_a1, arg0, arg1, arg2, arg3); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1) { + return new FunctionCallback2_4< + SingleUseCallback4, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + ReturnType (*callback)(A0, A1, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1) { + return new FunctionCallback2_4< + Callback4, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0, + a1); +} + + +// A Method callback with 2 create-time args and 4 exec time args +template +class MethodCallback2_4: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, Arg0, Arg1, Arg2, Arg3); + MethodCallback2_4(Class *object, Method callback, A0 a0, A1 a1): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return (m_object->*m_callback)(m_a0, m_a1, arg0, arg1, arg2, arg3); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1) { + return new MethodCallback2_4, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0, + a1); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1) { + return new MethodCallback2_4, + ReturnType, + A0, + A1, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0, + a1); +} + + +// A Function callback with 3 create-time args and 4 exec time args +template +class FunctionCallback3_4: public Parent { + public: + typedef ReturnType (*Function)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3); + FunctionCallback3_4(Function callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return m_callback(m_a0, m_a1, m_a2, arg0, arg1, arg2, arg3); + } + private: + Function m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_4< + SingleUseCallback4, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + ReturnType (*callback)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1, + A2 a2) { + return new FunctionCallback3_4< + Callback4, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2, + Arg3>( + callback, + a0, + a1, + a2); +} + + +// A Method callback with 3 create-time args and 4 exec time args +template +class MethodCallback3_4: public Parent { + public: + typedef ReturnType (Class::*Method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3); + MethodCallback3_4(Class *object, Method callback, A0 a0, A1 a1, A2 a2): + Parent(), + m_object(object), + m_callback(callback), + m_a0(a0), + m_a1(a1), + m_a2(a2) {} + ReturnType DoRun(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3) { + return (m_object->*m_callback)(m_a0, m_a1, m_a2, arg0, arg1, arg2, arg3); + } + private: + Class *m_object; + Method m_callback; + A0 m_a0; + A1 m_a1; + A2 m_a2; +}; + + +// Helper method to create a new SingleUseCallback. +template +inline SingleUseCallback4* NewSingleCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_4, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0, + a1, + a2); +} + + +// Helper method to create a new Callback. +template +inline Callback4* NewCallback( + Class* object, + ReturnType (Class::*method)(A0, A1, A2, Arg0, Arg1, Arg2, Arg3), + A0 a0, + A1 a1, + A2 a2) { + return new MethodCallback3_4, + ReturnType, + A0, + A1, + A2, + Arg0, + Arg1, + Arg2, + Arg3>( + object, + method, + a0, + a1, + a2); +} + + +} // ola +#endif // INCLUDE_OLA_CALLBACK_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Clock.h b/open-lighting-architecture/ola-0.8.4/include/ola/Clock.h new file mode 100644 index 0000000..e459306 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Clock.h @@ -0,0 +1,242 @@ +/* + * 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 Library 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. + * + * Timing.h + * Interface for the Clock & TimeStamp classes + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_CLOCK_H_ +#define INCLUDE_OLA_CLOCK_H_ + +#include +#include +#include +#include +#include +#include + +namespace ola { + + +using std::ostream; + +static const int USEC_IN_SECONDS = 1000000; + + +/* + * A time interval, with usecond accuracy + */ +class TimeInterval { + public: + TimeInterval() { + Set(0); + } + + explicit TimeInterval(int64_t interval_useconds) { + Set(interval_useconds); + } + + TimeInterval(const TimeInterval &other) { + m_interval = other.m_interval; + } + + TimeInterval(unsigned int sec, unsigned int usec) { + m_interval.tv_sec = sec; + m_interval.tv_usec = usec; + } + + TimeInterval& operator=(int64_t interval_useconds) { + Set(interval_useconds); + return *this; + } + + TimeInterval& operator=(const TimeInterval& other) { + if (this != &other) { + m_interval = other.m_interval; + } + return *this; + } + + bool operator==(const TimeInterval &other) const { + return timercmp(&m_interval, &other.m_interval, ==); + } + + bool operator!=(const TimeInterval &other) const { + return !(*this == other); + } + + bool operator<(const TimeInterval &other) const { + return timercmp(&m_interval, &other.m_interval, <); + } + + std::string ToString() const { + std::stringstream str; + str << m_interval.tv_sec << "." << std::setfill('0') << std::setw(6) << + m_interval.tv_usec; + return str.str(); + } + + int64_t AsInt() const { + return (m_interval.tv_sec * static_cast(USEC_IN_SECONDS) + + m_interval.tv_usec); + } + + time_t Seconds() const { + return m_interval.tv_sec; + } + + void AsTimeval(struct timeval *tv) const { + *tv = m_interval; + } + + friend ostream& operator<< (ostream &out, const TimeInterval &interval) { + return out << interval.ToString(); + } + + private: + void Set(uint64_t interval_useconds) { + m_interval.tv_sec = static_cast( + interval_useconds / USEC_IN_SECONDS); + m_interval.tv_usec = static_cast( + interval_useconds % USEC_IN_SECONDS); + } + struct timeval m_interval; + + friend class TimeStamp; +}; + + +/* + * Represents a point in time with usecond accuracy + */ +class TimeStamp { + public: + TimeStamp() { + timerclear(&m_tv); + } + + TimeStamp(const TimeStamp &other) { + m_tv = other.m_tv; + } + + explicit TimeStamp(const struct timeval ×tamp) { + m_tv = timestamp; + } + + TimeStamp& operator=(const TimeStamp& other) { + if (this != &other) { + m_tv = other.m_tv; + } + return *this; + } + + TimeStamp& operator=(const struct timeval &tv) { + m_tv = tv; + return *this; + } + + bool operator==(const TimeStamp &other) const { + return timercmp(&m_tv, &other.m_tv, ==); + } + + bool operator!=(const TimeStamp &other) const { + return !(*this == other); + } + + bool operator>(const TimeStamp &other) const { + return timercmp(&m_tv, &other.m_tv, >); + } + + bool operator<(const TimeStamp &other) const { + return timercmp(&m_tv, &other.m_tv, <); + } + + TimeStamp &operator+=(const TimeInterval &interval) { + m_tv.tv_sec = m_tv.tv_sec + interval.m_interval.tv_sec; + m_tv.tv_usec = m_tv.tv_usec + interval.m_interval.tv_usec; + if (m_tv.tv_usec >= USEC_IN_SECONDS) { + m_tv.tv_sec++; + m_tv.tv_usec -= USEC_IN_SECONDS; + } + return *this; + } + + TimeStamp &operator-=(const TimeInterval &interval) { + TimerSub(m_tv, interval.m_interval, &m_tv); + return *this; + } + + const TimeStamp operator+(const TimeInterval &interval) const { + TimeStamp result = *this; + result += interval; + return result; + } + + const TimeInterval operator-(const TimeStamp &other) const { + TimeInterval result; + TimerSub(m_tv, other.m_tv, &result.m_interval); + return result; + } + + const TimeStamp operator-(const TimeInterval &interval) const { + TimeStamp result; + TimerSub(m_tv, interval.m_interval, &result.m_tv); + return result; + } + + bool IsSet() const { + return timerisset(&m_tv); + } + + std::string ToString() const { + std::stringstream str; + str << m_tv.tv_sec << "." << std::setfill('0') << std::setw(6) << + m_tv.tv_usec; + return str.str(); + } + + friend ostream& operator<< (ostream &out, const TimeStamp ×tamp) { + return out << timestamp.ToString(); + } + + private: + struct timeval m_tv; + + void TimerSub(const struct timeval &tv1, const struct timeval &tv2, + struct timeval *result) const { + result->tv_sec = tv1.tv_sec - tv2.tv_sec; + result->tv_usec = tv1.tv_usec - tv2.tv_usec; + if (result->tv_usec < 0) { + result->tv_sec--; + result->tv_usec += USEC_IN_SECONDS; + } + } +}; + + +/* + * Used to get the current time + */ +class Clock { + public: + static void CurrentTime(TimeStamp *timestamp) { + struct timeval tv; + gettimeofday(&tv, NULL); + *timestamp = tv; + } +}; +} // ola +#endif // INCLUDE_OLA_CLOCK_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Closure.h b/open-lighting-architecture/ola-0.8.4/include/ola/Closure.h new file mode 100644 index 0000000..478a580 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Closure.h @@ -0,0 +1,543 @@ +/* + * 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 Library 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. + * + * Closure.h + * Closure classes. + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLA_CLOSURE_H_ +#define INCLUDE_OLA_CLOSURE_H_ + +#include + +namespace ola { + + +template +class BaseClosure { + public: + virtual ~BaseClosure() {} + virtual ReturnType Run() = 0; + virtual ReturnType DoRun() = 0; +}; + + +/* + * Closure, this is a closure that can be called multiple times + */ +template +class Closure: public BaseClosure { + public: + virtual ~Closure() {} + ReturnType Run() { return this->DoRun(); } +}; + + +/* + * A single use closure, this deletes itself after it's run. + */ +template +class SingleUseClosure: public BaseClosure { + public: + virtual ~SingleUseClosure() {} + ReturnType Run() { + ReturnType ret = this->DoRun(); + delete this; + return ret; + } +}; + + +/* + * A single use closure returning void, this deletes itself after it's run. + */ +template <> +class SingleUseClosure: public BaseClosure { + public: + virtual ~SingleUseClosure() {} + void Run() { + DoRun(); + delete this; + return; + } +}; + + +/* + * A function closure, with no arguments + */ +template +class FunctionClosure: public Parent { + public: + typedef ReturnType (*Function)(); + + explicit FunctionClosure(Function callback): + Parent(), + m_callback(callback) {} + ReturnType DoRun() { return m_callback(); } + + private: + Function m_callback; +}; + + +/* + * Create a new single use function closure. + */ +template +inline SingleUseClosure* NewSingleClosure( + ReturnType (*callback)()) { + return new FunctionClosure, ReturnType>( + callback); +} + + +/* + * Create a new function closure. + */ +template +inline Closure* NewClosure(ReturnType (*callback)()) { + return new FunctionClosure, ReturnType>(callback); +} + + +/* + * A function closure, with one argument + */ +template +class FunctionArgClosure: public Parent { + public: + typedef ReturnType (*Function)(Arg arg); + + /* + * @param callback the function to call + */ + FunctionArgClosure(Function callback, Arg arg): + Parent(), + m_callback(callback), + m_arg(arg) {} + ReturnType DoRun() { return m_callback(m_arg); } + + private: + Function m_callback; + Arg m_arg; +}; + + +/* + * Create a new single use function closure. + */ +template +inline SingleUseClosure* NewSingleClosure( + ReturnType (*callback)(Arg arg), + Arg arg) { + return new FunctionArgClosure, ReturnType, Arg>( + callback, + arg); +} + + +/* + * Create a new function closure. + */ +template +inline Closure* NewClosure(ReturnType (*callback)(Arg arg), + Arg arg) { + return new FunctionArgClosure, ReturnType, Arg>( + callback, + arg); +} + +/* + * An method closure with no arguments + */ +template +class MethodClosure: public Parent { + public: + typedef ReturnType (Class::*Method)(); + + /* + * @param object the object to use in the method call + * @param callback the method to call + */ + MethodClosure(Class *object, + Method callback): + Parent(), + m_object(object), + m_callback(callback) {} + ReturnType DoRun() { return (m_object->*m_callback)(); } + + private: + Class *m_object; + Method m_callback; +}; + + +/* + * Create a new single use method closure. + */ +template +inline SingleUseClosure* NewSingleClosure( + Class* object, + ReturnType (Class::*method)()) { + return new MethodClosure, ReturnType>( + object, + method); +} + + +/* + * Create a new method closure. + */ +template +inline Closure* NewClosure(Class* object, + ReturnType (Class::*method)()) { + return new MethodClosure, ReturnType>(object, + method); +} + + +/* + * A method closure that takes one argument + */ +template +class MethodArgClosure: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg arg); + + /* + * @param object the object to use in the method call + * @param handle the method to call + * @param arg the argument to pass to the method + */ + MethodArgClosure(Class *object, + Method callback, + Arg arg): + Parent(), + m_object(object), + m_callback(callback), + m_arg(arg) {} + ReturnType DoRun() { return (m_object->*m_callback)(m_arg); } + + private: + Class *m_object; + Method m_callback; + Arg m_arg; +}; + + +/* + * Create a new single use one-arg method closure + */ +template +inline SingleUseClosure* NewSingleClosure( + Class* object, + ReturnType (Class::*method)(Arg arg), + Arg arg) { + return new MethodArgClosure, + ReturnType, + Arg>( + object, + method, + arg); +} + + +/* + * Create a new one-arg method closure + */ +template +inline Closure* NewClosure(Class* object, + ReturnType (Class::*method)(Arg arg), + Arg arg) { + return new MethodArgClosure, ReturnType, Arg>( + object, + method, + arg); +} + + +/* + * A method closure that takes two arguments + */ +template +class MethodTwoArgClosure: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg arg, Arg2 arg2); + + /* + * @param object the object to use in the method call + * @param method the method to call + * @param arg the argument to pass to the method + * @param arg2 the second argument to pass to the method + */ + MethodTwoArgClosure(Class *object, + Method callback, + Arg arg, + Arg2 arg2): + Parent(), + m_object(object), + m_callback(callback), + m_arg(arg), + m_arg2(arg2) {} + ReturnType DoRun() { return (m_object->*m_callback)(m_arg, m_arg2); } + + private: + Class *m_object; + Method m_callback; + Arg m_arg; + Arg2 m_arg2; +}; + + +/* + * Create a new single use two-arg method closure + */ +template +inline SingleUseClosure* NewSingleClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2), + Arg arg, + Arg2 arg2) { + return new MethodTwoArgClosure, + ReturnType, + Arg, + Arg2>( + object, + method, + arg, + arg2); +} + + +/* + * Create a new two-arg method closure + */ +template +inline Closure* NewClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2), + Arg arg, Arg2 arg2) { + return new MethodTwoArgClosure, + ReturnType, + Arg, + Arg2>( + object, + method, + arg, + arg2); +} + + +/* + * A method closure that takes three arguments + */ +template +class MethodThreeArgClosure: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg arg, Arg2 arg2, Arg3 arg3); + + /* + * @param object the object to use in the method call + * @param method the method to call + * @param arg the argument to pass to the method + * @param arg2 the second argument to pass to the method + */ + MethodThreeArgClosure(Class *object, + Method callback, + Arg arg, + Arg2 arg2, + Arg3 arg3): + Parent(), + m_object(object), + m_callback(callback), + m_arg(arg), + m_arg2(arg2), + m_arg3(arg3) {} + ReturnType DoRun() { + return (m_object->*m_callback)(m_arg, m_arg2, m_arg3); + } + + private: + Class *m_object; + Method m_callback; + Arg m_arg; + Arg2 m_arg2; + Arg3 m_arg3; +}; + + +/* + * Create a new single use three-arg method closure + */ +template +inline SingleUseClosure* NewSingleClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2, Arg3 arg3), + Arg arg, + Arg2 arg2, + Arg3 arg3) { + return new MethodThreeArgClosure, + ReturnType, + Arg, + Arg2, + Arg3>( + object, + method, + arg, + arg2, + arg3); +} + + +/* + * Create a new three-arg method closure + */ +template +inline Closure* NewClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2, Arg3 arg3), + Arg arg, Arg2 arg2, Arg3 arg3) { + return new MethodThreeArgClosure, + ReturnType, + Arg, + Arg2, + Arg3>( + object, + method, + arg, + arg2, + arg3); +} + + +/* + * A method closure that takes four arguments + */ +template +class MethodFourArgClosure: public Parent { + public: + typedef ReturnType (Class::*Method)(Arg arg, Arg2 arg2, Arg3 arg3, + Arg4 arg4); + + /* + * @param object the object to use in the method call + * @param method the method to call + * @param arg the argument to pass to the method + * @param arg2 the second argument to pass to the method + */ + MethodFourArgClosure(Class *object, + Method callback, + Arg arg, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4): + Parent(), + m_object(object), + m_callback(callback), + m_arg(arg), + m_arg2(arg2), + m_arg3(arg3), + m_arg4(arg4) {} + ReturnType DoRun() { + return (m_object->*m_callback)(m_arg, m_arg2, m_arg3, m_arg4); + } + + private: + Class *m_object; + Method m_callback; + Arg m_arg; + Arg2 m_arg2; + Arg3 m_arg3; + Arg4 m_arg4; +}; + + +/* + * Create a new single use four-arg method closure + */ +template +inline SingleUseClosure* NewSingleClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2, Arg3 arg3, Arg4 arg4), + Arg arg, + Arg2 arg2, + Arg3 arg3, + Arg4 arg4) { + return new MethodFourArgClosure, + ReturnType, + Arg, + Arg2, + Arg3, + Arg4>( + object, + method, + arg, + arg2, + arg3, + arg4); +} + + +/* + * Create a new three-arg method closure + */ +template +inline Closure* NewClosure( + Class* object, + ReturnType (Class::*method)(Arg arg, Arg2 arg2, Arg3 arg3, Arg4 arg4), + Arg arg, Arg2 arg2, Arg3 arg3, Arg4 arg4) { + return new MethodFourArgClosure, + ReturnType, + Arg, + Arg2, + Arg3, + Arg4>( + object, + method, + arg, + arg2, + arg3, + arg4); +} +} // ola +#endif // INCLUDE_OLA_CLOSURE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/DmxBuffer.h b/open-lighting-architecture/ola-0.8.4/include/ola/DmxBuffer.h new file mode 100644 index 0000000..226c2f5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/DmxBuffer.h @@ -0,0 +1,75 @@ +/* + * 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 Library 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. + * + * DmxBuffer.h + * Interface for the DmxBuffer + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLA_DMXBUFFER_H_ +#define INCLUDE_OLA_DMXBUFFER_H_ + +#include +#include + +namespace ola { + +using std::string; + +/* + * The DmxBuffer class + */ +class DmxBuffer { + public: + DmxBuffer(); + DmxBuffer(const DmxBuffer &other); + DmxBuffer(const uint8_t *data, unsigned int length); + explicit DmxBuffer(const string &data); + ~DmxBuffer(); + DmxBuffer& operator=(const DmxBuffer &other); + + bool operator==(const DmxBuffer &other) const; + unsigned int Size() const { return m_length; } + + bool HTPMerge(const DmxBuffer &other); + bool Set(const uint8_t *data, unsigned int length); + bool Set(const string &data); + bool Set(const DmxBuffer &other); + bool SetFromString(const string &data); + bool SetRangeToValue(unsigned int offset, uint8_t data, + unsigned int length); + bool SetRange(unsigned int offset, const uint8_t *data, + unsigned int length); + void SetChannel(unsigned int channel, uint8_t data); + void Get(uint8_t *data, unsigned int *length) const; + uint8_t Get(unsigned int channel) const; + const uint8_t *GetRaw() const { return m_data; } + string Get() const; + bool Blackout(); + void Reset(); + string ToString() const; + + private: + bool Init(); + bool DuplicateIfNeeded(); + void CopyFromOther(const DmxBuffer &other); + void CleanupMemory(); + unsigned int *m_ref_count; + mutable bool m_copy_on_write; + uint8_t *m_data; + unsigned int m_length; +}; +} // ola +#endif // INCLUDE_OLA_DMXBUFFER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/ExportMap.h b/open-lighting-architecture/ola-0.8.4/include/ola/ExportMap.h new file mode 100644 index 0000000..90790f4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/ExportMap.h @@ -0,0 +1,226 @@ +/* + * 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 Library 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. + * + * ExportMap.h + * Interface the ExportMap and ExportedVariables + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLA_EXPORTMAP_H_ +#define INCLUDE_OLA_EXPORTMAP_H_ + +#include +#include +#include +#include +#include +#include + +namespace ola { + +using std::string; +using std::stringstream; +using std::map; +using std::vector; + + +/* + * Base Variable + */ +class BaseVariable { + public: + explicit BaseVariable(const string &name): m_name(name) {} + virtual ~BaseVariable() {} + + const string Name() const { return m_name; } + virtual const string Value() const = 0; + + private: + string m_name; +}; + +struct VariableLessThan: public std::binary_function { + bool operator()(BaseVariable *x, BaseVariable *y) { + return x->Name() < y->Name(); + } +}; + + + +/* + * Represents a string variable + */ +class StringVariable: public BaseVariable { + public: + explicit StringVariable(const string &name) + : BaseVariable(name), + m_value("") {} + ~StringVariable() {} + + void Set(const string &value) { m_value = value; } + const string Get() const { return m_value; } + const string Value() const { return m_value; } + + private: + string m_value; +}; + + +/* + * Represents a integer variable + */ +class IntegerVariable: public BaseVariable { + public: + explicit IntegerVariable(const string &name) + : BaseVariable(name), + m_value(0) {} + ~IntegerVariable() {} + + void Set(int value) { m_value = value; } + void operator++(int) { m_value++; } + void operator--(int) { m_value--; } + void Reset() { m_value = 0; } + int Get() const { return m_value; } + const string Value() const { + stringstream out; + out << m_value; + return out.str(); + } + + private: + int m_value; +}; + + +/* + * Represents a counter which can only be added to. + */ +class CounterVariable: public BaseVariable { + public: + explicit CounterVariable(const string &name) + : BaseVariable(name), + m_value(0) {} + ~CounterVariable() {} + + void operator++(int) { m_value++; } + void operator+=(unsigned int value) { m_value += value; } + void Reset() { m_value = 0; } + unsigned int Get() const { return m_value; } + const string Value() const { + stringstream out; + out << m_value; + return out.str(); + } + + private: + unsigned int m_value; +}; + + +/* + * A Map variable holds string -> type mappings + */ +template +class MapVariable: public BaseVariable { + public: + MapVariable(const string &name, const string &label): + BaseVariable(name), + m_label(label) {} + ~MapVariable() {} + + void Remove(const string &key); + Type &operator[](const string &key); + const string Value() const; + const string Label() const { return m_label; } + private: + map m_variables; + string m_label; +}; + +typedef MapVariable StringMap; +typedef MapVariable IntMap; +typedef MapVariable UIntMap; + + +/* + * Return a value from the Map Variable, this will create an entry in the map + * if the variable doesn't exist. + */ +template +Type &MapVariable::operator[](const string &key) { + return m_variables[key]; +} + + +/* + * Remove a value from the map + * @param key the key to remove + */ +template +void MapVariable::Remove(const string &key) { + typename map::iterator iter = m_variables.find(key); + + if (iter != m_variables.end()) + m_variables.erase(iter); +} + + +/* + * Holds all the exported variables + */ +class ExportMap { + public: + ExportMap() {} + ~ExportMap(); + vector AllVariables() const; + + IntegerVariable *GetIntegerVar(const string &name); + CounterVariable *GetCounterVar(const string &name); + StringVariable *GetStringVar(const string &name); + + StringMap *GetStringMapVar(const string &name, const string &label=""); + IntMap *GetIntMapVar(const string &name, const string &label=""); + UIntMap *GetUIntMapVar(const string &name, const string &label=""); + + private : + ExportMap(const ExportMap&); + ExportMap& operator=(const ExportMap&); + + template + Type *GetVar(map *var_map, const string &name); + + template + Type *GetMapVar(map *var_map, + const string &name, + const string &label); + + template + void AddVariablesToVector(vector *variables, + const Type &var_map) const; + + template + void DeleteVariables(Type *var_map) const; + + map m_string_variables; + map m_int_variables; + map m_counter_variables; + + map m_str_map_variables; + map m_int_map_variables; + map m_uint_map_variables; +}; +} // ola +#endif // INCLUDE_OLA_EXPORTMAP_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Logging.h b/open-lighting-architecture/ola-0.8.4/include/ola/Logging.h new file mode 100644 index 0000000..cfef43a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Logging.h @@ -0,0 +1,126 @@ +/* + * 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 Library 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. + * + * logging.h + * Header file for the logging + * Copyright (C) 2005-2009 Simon Newton + * + * How to use: + * + * #include + * + * // Call this once + * ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + * + * OLA_FATAL << "foo"; + * OLA_WARN << "foo"; + * OLA_INFO << "foo"; + * OLA_DEBUG << "foo"; + */ + +#ifndef INCLUDE_OLA_LOGGING_H_ +#define INCLUDE_OLA_LOGGING_H_ + +#ifdef WIN32 +#include // for HANDLE +#endif + +#include +#include +#include + +#define OLA_LOG(level) ola::LogLine(__FILE__, __LINE__, level).stream() +#define OLA_FATAL OLA_LOG(ola::OLA_LOG_FATAL) +#define OLA_WARN OLA_LOG(ola::OLA_LOG_WARN) +#define OLA_INFO OLA_LOG(ola::OLA_LOG_INFO) +#define OLA_DEBUG OLA_LOG(ola::OLA_LOG_DEBUG) + +namespace ola { + +using std::string; + +/* + * The log levels + */ +enum log_level { + OLA_LOG_NONE, + OLA_LOG_FATAL, + OLA_LOG_WARN, + OLA_LOG_INFO, + OLA_LOG_DEBUG, + OLA_LOG_MAX, +}; + +/* + * The log outputs + */ +typedef enum { + OLA_LOG_STDERR, + OLA_LOG_SYSLOG, + OLA_LOG_NULL, +} log_output; + +/* + * The base class for log destinations. + */ +class LogDestination { + public: + virtual ~LogDestination() {} + virtual void Write(log_level level, const string &log_line) = 0; +}; + +/* + * A LogDestination that writes to stderr + */ +class StdErrorLogDestination: public LogDestination { + public: + void Write(log_level level, const string &log_line); +}; + +/* + * A LogDestination that writes to syslog + */ +class SyslogDestination: public LogDestination { + public: + bool Init(); + void Write(log_level level, const string &log_line); + private: +#ifdef WIN32 + HANDLE m_eventlog; +#endif +}; + +/* + * A LogLine, this represents a single log message. + */ +class LogLine { + public: + LogLine(const char *file, int line, log_level level); + ~LogLine(); + void Write(); + + std::ostream &stream() { return m_stream; } + private: + log_level m_level; + std::ostringstream m_stream; + unsigned int m_prefix_length; +}; + +void SetLogLevel(log_level level); +void IncrementLogLevel(); +bool InitLogging(log_level level, log_output output); +void InitLogging(log_level level, LogDestination *destination); +} // ola +#endif // INCLUDE_OLA_LOGGING_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.am new file mode 100644 index 0000000..0f2b3e8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS = network rdm web + +SOURCES = ActionQueue.h BaseTypes.h Callback.h Clock.h Closure.h DmxBuffer.h \ + ExportMap.h Logging.h OlaThread.h RunLengthEncoder.h StringUtils.h + +BUILT_SOURCES = plugin_id.h + +EXTRA_DIST = $(SOURCES) gen_callbacks.py make_plugin_id.sh +pkgincludedir = $(includedir)/ola +pkginclude_HEADERS = $(SOURCES) $(BUILT_SOURCES) + +plugin_id.h: + sh ./make_plugin_id.sh + +clean-local: + rm -f plugin_id.h diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.in new file mode 100644 index 0000000..84eaa80 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/Makefile.in @@ -0,0 +1,555 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/ola +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +SUBDIRS = network rdm web +SOURCES = ActionQueue.h BaseTypes.h Callback.h Clock.h Closure.h DmxBuffer.h \ + ExportMap.h Logging.h OlaThread.h RunLengthEncoder.h StringUtils.h + +BUILT_SOURCES = plugin_id.h +EXTRA_DIST = $(SOURCES) gen_callbacks.py make_plugin_id.sh +pkginclude_HEADERS = $(SOURCES) $(BUILT_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/ola/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/ola/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile $(HEADERS) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-local ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-pkgincludeHEADERS + + +plugin_id.h: + sh ./make_plugin_id.sh + +clean-local: + rm -f plugin_id.h +# 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/open-lighting-architecture/ola-0.8.4/include/ola/OlaThread.h b/open-lighting-architecture/ola-0.8.4/include/ola/OlaThread.h new file mode 100644 index 0000000..31ad872 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/OlaThread.h @@ -0,0 +1,42 @@ +/* + * 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 Library 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. + * + * OlaThread.h + * A thread object. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_OLATHREAD_H_ +#define INCLUDE_OLA_OLATHREAD_H_ + +#include + +namespace ola { + +class OlaThread { + public: + OlaThread(): m_thread_id(0) {} + virtual ~OlaThread() {} + + bool Start(); + bool Join(void *ptr = NULL); + bool IsRunning() const { return m_thread_id != 0; } + virtual void *Run() = 0; + + private: + pthread_t m_thread_id; +}; +} // ola +#endif // INCLUDE_OLA_OLATHREAD_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/RunLengthEncoder.h b/open-lighting-architecture/ola-0.8.4/include/ola/RunLengthEncoder.h new file mode 100644 index 0000000..45e839b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/RunLengthEncoder.h @@ -0,0 +1,44 @@ +/* + * 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 Library 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. + * + * RunLengthEncoder.h + * Header file for the RunLengthEncoder class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLA_RUNLENGTHENCODER_H_ +#define INCLUDE_OLA_RUNLENGTHENCODER_H_ + +#include + +namespace ola { + +class RunLengthEncoder { + public : + RunLengthEncoder() {} + ~RunLengthEncoder() {} + + bool Encode(const DmxBuffer &src, + uint8_t *data, + unsigned int &size); + bool Decode(DmxBuffer *dst, + unsigned int start_channel, + const uint8_t *data, + unsigned int length); + private: + static const uint8_t REPEAT_FLAG = 0x80; +}; +} // ola +#endif // INCLUDE_OLA_RUNLENGTHENCODER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/StringUtils.h b/open-lighting-architecture/ola-0.8.4/include/ola/StringUtils.h new file mode 100644 index 0000000..aad5a18 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/StringUtils.h @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * StringUtils..h + * Random String functions. + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLA_STRINGUTILS_H_ +#define INCLUDE_OLA_STRINGUTILS_H_ + +#include +#include +#include + +namespace ola { + +using std::string; + +void StringSplit(const string &input, + std::vector &tokens, + const string &delimiters=" "); +void StringTrim(string *input); +void ShortenString(string *input); +string IntToString(int i); +string IntToString(unsigned int i); +void Escape(string *original); +string EscapeString(const string &original); +bool StringToUInt(const string &value, unsigned int *output); +bool StringToUInt16(const string &value, uint16_t *output); +bool StringToUInt8(const string &value, uint8_t *output); +bool HexStringToUInt(const string &value, unsigned int *output); +bool HexStringToUInt16(const string &value, uint16_t *output); +void ToLower(string *s); +} // ola + +#endif // INCLUDE_OLA_STRINGUTILS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/gen_callbacks.py b/open-lighting-architecture/ola-0.8.4/include/ola/gen_callbacks.py new file mode 100755 index 0000000..53611ae --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/gen_callbacks.py @@ -0,0 +1,307 @@ +#!/usr/bin/python +# 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 Library 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. +# +# gen_callbacks.py +# Copyright (C) 2010 Simon Newton + + +import textwrap + + +def Header(): + print textwrap.dedent("""\ + /* + * 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 Library 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. + * + * Callback.h + * Callback classes, these are similar to closures but can take arguments at + * exec time. + * Copyright (C) 2005-2010 Simon Newton + * + * THIS FILE IS AUTOGENERATED! + * Please run edit & run gen_callbacks.py if you need to add more types. + */ + + #ifndef INCLUDE_OLA_CALLBACK_H_ + #define INCLUDE_OLA_CALLBACK_H_ + + namespace ola { + """) + +def Footer(): + print textwrap.dedent("""\ + } // ola + #endif // INCLUDE_OLA_CALLBACK_H_""") + +def GenerateBase(number_of_args): + """Generate the base Callback classes.""" + typenames = ', '.join('typename Arg%d' % i for i in xrange(number_of_args)) + arg_list = ', '.join('Arg%d arg%d' % (i, i) for i in xrange(number_of_args)) + args = ', '.join('arg%d' % i for i in xrange(number_of_args)) + arg_types = ', '.join('Arg%d' % i for i in xrange(number_of_args)) + + # generate the base callback class + print '// %d argument callbacks' % number_of_args + print 'template ' % typenames + print 'class BaseCallback%d {' % number_of_args + print ' public:' + print ' virtual ~BaseCallback%d() {}' % number_of_args + print ' virtual ReturnType Run(%s) = 0;' % arg_list + print ' virtual ReturnType DoRun(%s) = 0;' % arg_list + print '};' + print '' + print '' + + # generate the multi-use version of the callback + print '// A callback, this can be called multiple times' + print 'template ' % typenames + print ('class Callback%d: public BaseCallback%d {' % + (number_of_args, number_of_args, arg_types)) + print ' public:' + print ' virtual ~Callback%d() {}' % number_of_args + print (' ReturnType Run(%s) { return DoRun(%s); }' % + (arg_list, args)) + print '};' + print '' + print '' + + # generate the single-use version of the callback + print "// A single use callback, this deletes itself after it's run." + print 'template ' % typenames + print ('class SingleUseCallback%d: public BaseCallback%d {' % + (number_of_args, number_of_args, arg_types)) + print ' public:' + print ' virtual ~SingleUseCallback%d() {}' % number_of_args + print ' ReturnType Run(%s) {' % arg_list + print ' ReturnType ret = DoRun(%s);' % args + print ' delete this;' + print ' return ret;' + print ' }' + print '};' + print '' + print '' + + # the void specialization + print "// A single use callback returning void." + print 'template <%s>' % typenames + print ('class SingleUseCallback%d: public BaseCallback%d {' % + (number_of_args, arg_types, number_of_args, arg_types)) + print ' public:' + print ' virtual ~SingleUseCallback%d() {}' % number_of_args + print ' void Run(%s) {' % arg_list + print ' DoRun(%s);' % args + print ' delete this;' + print ' }' + print '};' + print '' + print '' + + +def GenerateHelperFunction(bind_count, + exec_count, + function_name, + parent_class, + is_method=True): + """Generate the helper functions which create callbacks. + + Args: + bind_count the number of args supplied at create time. + exec_count the number of args supplied at exec time. + function_name what to call the helper function + parent_class the parent class to use + is_method True if this is a method callback, False if this is a function + callback. + """ + typenames = (['typename A%d' % i for i in xrange(bind_count)] + + ['typename Arg%d' % i for i in xrange(exec_count)]) + bind_types = ['A%d' % i for i in xrange(bind_count)] + exec_types = ['Arg%d' % i for i in xrange(exec_count)] + method_types = ', '.join(bind_types + exec_types) + optional_class, ptr_name, signature = '', 'callback', '*callback' + if is_method: + optional_class, ptr_name, signature = ( + 'typename Class, ', 'method', 'Class::*method') + + # The single use helper function + print '// Helper method to create a new %s.' % parent_class + print ('template <%stypename ReturnType, %s>' % + (optional_class, ', '.join(typenames))) + print ('inline %s%d* %s(' % + (parent_class, exec_count, ', '.join(exec_types), function_name)) + if is_method: + print ' Class* object,' + if bind_count: + print ' ReturnType (%s)(%s),' % (signature, method_types) + for i in xrange(bind_count): + suffix = ',' + if i == bind_count - 1: + suffix = ') {' + print ' A%d a%d%s' % (i, i, suffix) + else: + print ' ReturnType (%s)(%s)) {' % (signature, method_types) + + if is_method: + print ' return new MethodCallback%d_%d,' + % (parent_class, exec_count, ', '.join(exec_types))) + print ' ReturnType,' + for i in xrange(bind_count): + print ' A%d,' % i + for i in xrange(exec_count): + suffix = ',' + if i == exec_count - 1: + suffix = '>(' + print ' Arg%d%s' % (i, suffix) + if is_method: + print ' object,' + if bind_count: + print ' %s,' % ptr_name + else: + print ' %s);' % ptr_name + for i in xrange(bind_count): + suffix = ',' + if i == bind_count - 1: + suffix = ');' + print ' a%d%s' % (i, suffix) + print '}' + print '' + print '' + + +def GenerateMethodCallback(bind_count, + exec_count, + is_method=True): + """Generate the specific function callback & helper methods. + bind_count the number of args supplied at create time. + exec_count the number of args supplied at exec time. + is_method True if this is a method callback, False if this is a function + callback. + """ + typenames = (['typename A%d' % i for i in xrange(bind_count)] + + ['typename Arg%d' % i for i in xrange(exec_count)]) + + bind_types = ['A%d' % i for i in xrange(bind_count)] + exec_types = ['Arg%d' % i for i in xrange(exec_count)] + + method_types = ', '.join(bind_types + exec_types) + method_args = (['m_a%d' % i for i in xrange(bind_count)] + + ['arg%d' % i for i in xrange(exec_count)]) + + exec_args = ', '.join(['Arg%d arg%d' % (i, i) for i in xrange(exec_count)]) + bind_args = ', '.join(['A%d a%d' % (i, i) for i in xrange(bind_count)]) + + optional_class, method_or_function, class_name = ( + '', 'Function', 'FunctionCallback') + class_param, signature = '', '*callback'; + if is_method: + optional_class, method_or_function, class_name = ( + 'typename Class, ', 'Method', 'MethodCallback') + class_param, signature = 'Class *object, ', 'Class::*Method' + + print ('// A %s callback with %d create-time args and %d exec time ' + 'args' % (method_or_function, bind_count, exec_count)) + print ('template <%stypename Parent, typename ReturnType, %s>' % + (optional_class, ', '.join(typenames))) + + print 'class %s%d_%d: public Parent {' % (class_name, bind_count, exec_count) + print ' public:' + if is_method: + print ' typedef ReturnType (%s)(%s);' % (signature, method_types) + else: + print ' typedef ReturnType (*Function)(%s);' % (method_types) + + if bind_count: + print (' %s%d_%d(%s%s callback, %s):' % + (class_name, bind_count, exec_count, class_param, + method_or_function, bind_args)) + else: + print (' %s%d_%d(%s%s callback):' % + (class_name, bind_count, exec_count, class_param, + method_or_function)) + print ' Parent(),' + if is_method: + print ' m_object(object),' + if bind_count: + print ' m_callback(callback),' + for i in xrange(bind_count): + suffix = ',' + if i == bind_count - 1: + suffix = ' {}' + print ' m_a%d(a%d)%s' % (i, i, suffix) + else: + print ' m_callback(callback) {}' + print ' ReturnType DoRun(%s) {' % exec_args + if is_method: + print ' return (m_object->*m_callback)(%s);' % ', '.join(method_args) + else: + print ' return m_callback(%s);' % ', '.join(method_args) + print ' }' + + print ' private:' + if is_method: + print ' Class *m_object;' + print ' %s m_callback;' % method_or_function + for i in xrange(bind_count): + print ' A%d m_a%d;' % (i, i) + print '};' + print '' + print '' + + # generate the helper methods + GenerateHelperFunction(bind_count, + exec_count, + 'NewSingleCallback', + 'SingleUseCallback', + is_method) + GenerateHelperFunction(bind_count, + exec_count, + 'NewCallback', + 'Callback', + is_method) + + +def main(): + Header() + + # exec_time : [bind time args] + calback_types = {1: [0, 1, 2, 3], + 2: [0, 1, 2, 3, 4], + 3: [0, 1, 2, 3], + 4: [0, 1, 2, 3], + } + + for exec_time in sorted(calback_types): + GenerateBase(exec_time) + for bind_time in calback_types[exec_time]: + GenerateMethodCallback(bind_time, exec_time, is_method=False); + GenerateMethodCallback(bind_time, exec_time) + Footer() + + +main() diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/make_plugin_id.sh b/open-lighting-architecture/ola-0.8.4/include/ola/make_plugin_id.sh new file mode 100755 index 0000000..12c2052 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/make_plugin_id.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Autogenerate the plugin_id.h file from the protobuf definition. + +( +cat < plugin_id.h diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/Interface.h b/open-lighting-architecture/ola-0.8.4/include/ola/network/Interface.h new file mode 100644 index 0000000..79e9c80 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/Interface.h @@ -0,0 +1,58 @@ +/* + * 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 Library 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. + * + * Interface.h + * Represents a network interface. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_NETWORK_INTERFACE_H_ +#define INCLUDE_OLA_NETWORK_INTERFACE_H_ + +#ifdef WIN32 +#include +#else +#include +#endif + +#include +#include + +namespace ola { +namespace network { + +enum { MAC_LENGTH = 6 }; +enum { IPV4_LENGTH = 4 }; + +/* + * Represents an interface. + */ +class Interface { + public: + Interface(); + Interface(const Interface &other); + Interface& operator=(const Interface &other); + bool operator==(const Interface &other); + + std::string name; + struct in_addr ip_address; + struct in_addr bcast_address; + struct in_addr subnet_address; + uint8_t hw_address[MAC_LENGTH]; +}; +} // network +} // ola +#endif // INCLUDE_OLA_NETWORK_INTERFACE_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/InterfacePicker.h b/open-lighting-architecture/ola-0.8.4/include/ola/network/InterfacePicker.h new file mode 100644 index 0000000..564f3eb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/InterfacePicker.h @@ -0,0 +1,57 @@ +/* + * 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 Library 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. + * + * InterfacePicker.h + * Choose an interface to listen on + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLA_NETWORK_INTERFACEPICKER_H_ +#define INCLUDE_OLA_NETWORK_INTERFACEPICKER_H_ + +#ifdef WIN32 +#include +#else +#include +#endif + +#include +#include +#include + +namespace ola { +namespace network { + + +/* + * Chooses an interface + */ +class InterfacePicker { + public: + InterfacePicker() {} + virtual ~InterfacePicker() {} + + // stupid windows, 'interface' seems to be a struct so we use iface here. + bool ChooseInterface(Interface *iface, + const std::string &preferred_ip) const; + + virtual std::vector GetInterfaces() const = 0; + + static InterfacePicker *NewPicker(); +}; +} // network +} // ola +#endif // INCLUDE_OLA_NETWORK_INTERFACEPICKER_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.am new file mode 100644 index 0000000..7178b3e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.am @@ -0,0 +1,5 @@ +SOURCES = Interface.h InterfacePicker.h NetworkUtils.h Socket.h SelectServer.h + +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +pkgincludedir = $(includedir)/ola/network/ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.in new file mode 100644 index 0000000..b5e0cc8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/Makefile.in @@ -0,0 +1,427 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/ola/network +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/network/ +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +SOURCES = Interface.h InterfacePicker.h NetworkUtils.h Socket.h SelectServer.h +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/ola/network/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/ola/network/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/ola-0.8.4/include/ola/network/NetworkUtils.h b/open-lighting-architecture/ola-0.8.4/include/ola/network/NetworkUtils.h new file mode 100644 index 0000000..caef317 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/NetworkUtils.h @@ -0,0 +1,63 @@ +/* + * 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 Library 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. + * + * NetworkUtils.h + * Abstract various network functions. + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLA_NETWORK_NETWORKUTILS_H_ +#define INCLUDE_OLA_NETWORK_NETWORKUTILS_H_ + +#ifdef WIN32 +#include +#else +#include +#endif + +#include +#include + + +namespace ola { +namespace network { + +bool StringToAddress(const std::string &address, struct in_addr &addr); +std::string AddressToString(const struct in_addr &addr); + +std::string HardwareAddressToString(uint8_t hw_address[MAC_LENGTH]); + +// we define uint8_t versions of these so we can call them with any type. +uint8_t NetworkToHost(uint8_t value); +uint16_t NetworkToHost(uint16_t value); +uint32_t NetworkToHost(uint32_t value); +int8_t NetworkToHost(int8_t value); +int16_t NetworkToHost(int16_t value); +int32_t NetworkToHost(int32_t value); +uint8_t HostToNetwork(uint8_t value); +uint16_t HostToNetwork(uint16_t value); +uint32_t HostToNetwork(uint32_t value); + +uint8_t HostToLittleEndian(uint8_t value); +uint16_t HostToLittleEndian(uint16_t value); +uint8_t LittleEndianToHost(uint8_t value); +uint16_t LittleEndianToHost(uint16_t value); + +std::string FullHostname(); +std::string Hostname(); +} // network +} // ola +#endif // INCLUDE_OLA_NETWORK_NETWORKUTILS_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/SelectServer.h b/open-lighting-architecture/ola-0.8.4/include/ola/network/SelectServer.h new file mode 100644 index 0000000..4a30f87 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/SelectServer.h @@ -0,0 +1,215 @@ +/* + * 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 Library 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. + * + * SelectServer.h + * The select server interface + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLA_NETWORK_SELECTSERVER_H_ +#define INCLUDE_OLA_NETWORK_SELECTSERVER_H_ + +#include +#include +#include +#include + +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT + +namespace ola { +namespace network { + +using std::string; +using std::priority_queue; +using ola::ExportMap; + + +/* + * These are timer events, they are used inside the SelectServer class + */ +class Event { + public: + explicit Event(unsigned int ms): + m_interval(ms * 1000) { + TimeStamp now; + Clock::CurrentTime(&now); + m_next = now + m_interval; + } + virtual ~Event() {} + virtual bool Trigger() = 0; + + void UpdateTime(const TimeStamp &now) { + m_next = now + m_interval; + } + + TimeStamp NextTime() const { return m_next; } + + private: + TimeInterval m_interval; + TimeStamp m_next; +}; + + +// An event that only happens once +class SingleEvent: public Event { + public: + SingleEvent(unsigned int ms, ola::BaseClosure *closure): + Event(ms), + m_closure(closure) { + } + + virtual ~SingleEvent() { + if (m_closure) + delete m_closure; + } + + bool Trigger() { + if (m_closure) { + m_closure->Run(); + // it's deleted itself at this point + m_closure = NULL; + } + return false; + } + + private: + ola::BaseClosure *m_closure; +}; + + +/* + * An event that occurs more than once. The closure can return false to + * indicate that it should not be called again. + */ +class RepeatingEvent: public Event { + public: + RepeatingEvent(unsigned int ms, ola::BaseClosure *closure): + Event(ms), + m_closure(closure) { + } + ~RepeatingEvent() { + delete m_closure; + } + bool Trigger() { + if (!m_closure) + return false; + return m_closure->Run(); + } + + private: + ola::BaseClosure *m_closure; +}; + + +typedef Event* timeout_id; +static const timeout_id INVALID_TIMEOUT = 0; + + +struct ltevent { + bool operator()(Event *e1, Event *e2) const { + return e1->NextTime() > e2->NextTime(); + } +}; + + +class SelectServer { + public : + enum Direction {READ, WRITE}; + + SelectServer(ExportMap *export_map = NULL, + TimeStamp *wake_up_time = NULL); + ~SelectServer(); + + void SetDefaultInterval(const TimeInterval &poll_interval); + void Run(); + void RunOnce(unsigned int delay_sec = POLL_INTERVAL_SECOND, + unsigned int delay_usec = POLL_INTERVAL_USECOND); + void Terminate() { m_terminate = true; } + void Restart() { m_terminate = false; } + + bool AddSocket(class Socket *socket); + bool AddSocket(class ConnectedSocket *socket, + bool delete_on_close = false); + bool RemoveSocket(class Socket *socket); + bool RemoveSocket(class ConnectedSocket *socket); + + bool RegisterWriteSocket(class BidirectionalSocket *socket); + bool UnRegisterWriteSocket(class BidirectionalSocket *socket); + + timeout_id RegisterRepeatingTimeout(unsigned int ms, + ola::Closure *closure); + timeout_id RegisterSingleTimeout(unsigned int ms, + ola::SingleUseClosure *closure); + void RemoveTimeout(timeout_id id); + const TimeStamp *WakeUpTime() const { return m_wake_up_time; } + + void RunInLoop(ola::Closure *closure); + + static const char K_SOCKET_VAR[]; + static const char K_WRITE_SOCKET_VAR[]; + static const char K_CONNECTED_SOCKET_VAR[]; + static const char K_TIMER_VAR[]; + static const char K_LOOP_TIME[]; + static const char K_LOOP_COUNT[]; + + private : + typedef struct { + ConnectedSocket *socket; + bool delete_on_close; + } connected_socket_t; + + struct connected_socket_t_lt { + bool operator()(const connected_socket_t &c1, + const connected_socket_t &c2) const { + return c1.socket->ReadDescriptor() < c2.socket->ReadDescriptor(); + } + }; + + SelectServer(const SelectServer&); + SelectServer operator=(const SelectServer&); + bool CheckForEvents(const TimeInterval &poll_interval); + void CheckSockets(fd_set *r_set, fd_set *w_set); + void AddSocketsToSet(fd_set *r_set, fd_set *w_set, int *max_sd); + TimeStamp CheckTimeouts(const TimeStamp &now); + void UnregisterAll(); + + static const int K_MS_IN_SECOND = 1000; + static const int K_US_IN_SECOND = 1000000; + static const unsigned int POLL_INTERVAL_SECOND = 1; + static const unsigned int POLL_INTERVAL_USECOND = 0; + + bool m_terminate; + bool m_free_wake_up_time; + TimeInterval m_poll_interval; + unsigned int m_next_id; + std::set m_sockets; + std::set m_connected_sockets; + std::set m_write_sockets; + std::set m_removed_timeouts; + ExportMap *m_export_map; + + typedef priority_queue, ltevent> event_queue_t; + event_queue_t m_events; + CounterVariable *m_loop_iterations; + CounterVariable *m_loop_time; + TimeStamp *m_wake_up_time; + std::set*> m_loop_closures; +}; +} // network +} // ola +#endif // INCLUDE_OLA_NETWORK_SELECTSERVER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/network/Socket.h b/open-lighting-architecture/ola-0.8.4/include/ola/network/Socket.h new file mode 100644 index 0000000..cd5a83a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/network/Socket.h @@ -0,0 +1,419 @@ +/* + * 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 Library 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. + * + * Socket.h + * The Socket interface + * Copyright (C) 2005-2009 Simon Newton + * + * This defines all the different types of sockets that can be used by the + * SelectServer. At the top level, the Socket interface provides the minimum + * functionality needed to register a socket with the SelectServer to handle + * read events. The BidirectionalSocket extends this interface to handle + * ready-to-write events as well. + * + * The UnmanagedSocket allows socket descriptors controller by other libraries + * to be used with the SelectServer. + * + * ConnectedSocket is a socket with tighter intergration with the SelectServer. + * This allows the SelectServer to detect when the socket is closed and call + * the OnClose() handler. It also provides methods to disable SIGPIPE, control + * the blocking attributes and check how much data remains to be read. + * ConnectedSocket has the following sub-classes: + * + * - LoopbackSocket this socket is just a pipe(). Data written to the socket + * is available to be read + * - PipeSocket allows a pair of sockets to be created. Data written to socket + * A is available at Socket B and visa versa. + * - TcpSocket, this represents a TCP connection to a remote endpoint + * - DeviceSocket, this is a generic ConnectedSocket. It can be used with file + * descriptors to handle local devices. + * + * AcceptingSocket is the interface that defines sockets which can spawn new + * Socket. TcpAcceptingSocket is the only subclass and provides the accept() + * functionality. + */ + +#ifndef INCLUDE_OLA_NETWORK_SOCKET_H_ +#define INCLUDE_OLA_NETWORK_SOCKET_H_ + +#include + +#ifdef WIN32 +#include +#else +#include +#include +#endif + +#include +#include // NOLINT + + +namespace ola { +namespace network { + + +/* + * The base Socket Interface with the functionality required by the select + * server. This provides just enough functionality to be registered with the + * SelectServer, and a callback to be invoked when data is available. + * All other sockets inherit from this one. + */ +class Socket { + public : + Socket(): m_on_read(NULL) {} + virtual ~Socket() { + if (m_on_read) + delete m_on_read; + } + + /* + * Returns the read descriptor for this socket + */ + virtual int ReadDescriptor() const = 0; + + /* + * Close this socket + */ + virtual bool Close() = 0; + + /* + * Set the OnData closure + */ + void SetOnData(ola::Closure *on_read) { + if (m_on_read) + delete m_on_read; + m_on_read = on_read; + } + + ola::Closure *OnData() const { return m_on_read; } + + static const int INVALID_SOCKET = -1; + + private: + ola::Closure *m_on_read; +}; + + +/* + * A bi-directional socket. This can be registered with the SelectServer for + * both Read and Write events. + */ +class BidirectionalSocket: public Socket { + public : + BidirectionalSocket(): Socket(), m_on_write(NULL) {} + virtual ~BidirectionalSocket() { + if (m_on_write) + delete m_on_write; + } + + virtual int WriteDescriptor() const = 0; + + /* + * Set the OnWrite closure + */ + void SetOnWritable(ola::Closure *on_write) { + if (m_on_write) + delete m_on_write; + m_on_write = on_write; + } + + /* + * This is called when the socket is ready to be written to + */ + ola::Closure *PerformWrite() const { return m_on_write; } + + private: + ola::Closure *m_on_write; +}; + + +/* + * An unmanaged socket is used to glue sockets from other software into the + * SelectServer. This class doesn't define any read/write methods, it simply + * allows a third-party sd to be registered with a callback. + */ +class UnmanagedSocket: public BidirectionalSocket { + public : + explicit UnmanagedSocket(int sd): BidirectionalSocket(), m_sd(sd) {} + ~UnmanagedSocket() {} + int ReadDescriptor() const { return m_sd; } + int WriteDescriptor() const { return m_sd; } + // Closing is left to something else + bool Close() { return true; } + private: + int m_sd; + UnmanagedSocket(const UnmanagedSocket &other); + UnmanagedSocket& operator=(const UnmanagedSocket &other); +}; + + + +/* + * A connected socket can be read from / written to. + */ +class ConnectedSocket: public BidirectionalSocket { + public: + ConnectedSocket(): BidirectionalSocket(), m_on_close(NULL) {} + virtual ~ConnectedSocket() { + if (m_on_close) + delete m_on_close; + } + + virtual ssize_t Send(const uint8_t *buffer, unsigned int size) const { + return FDSend(WriteDescriptor(), buffer, size); + } + + virtual int Receive(uint8_t *buffer, + unsigned int size, + unsigned int &data_read) { + return FDReceive(ReadDescriptor(), buffer, size, data_read); + } + + virtual bool SetReadNonBlocking() { + return SetNonBlocking(ReadDescriptor()); + } + + virtual bool Close() = 0; + + int DataRemaining() const; + + /* + * Used to check if the socket has been closed + */ + bool CheckIfClosed() { + if (IsClosed()) { + if (m_on_close) { + m_on_close->Run(); + m_on_close = NULL; + } + return true; + } + return false; + } + + /* + * Set the OnClose closure + */ + void SetOnClose(ola::SingleUseClosure *on_close) { + if (m_on_close) + delete m_on_close; + m_on_close = on_close; + } + + protected: + virtual bool IsClosed() const; + bool SetNonBlocking(int fd); + bool SetNoSigPipe(int fd); + ssize_t FDSend(int fd, const uint8_t *buffer, unsigned int size) const; + int FDReceive(int fd, + uint8_t *buffer, + unsigned int size, + unsigned int &data_read); + + ConnectedSocket(const ConnectedSocket &other); + ConnectedSocket& operator=(const ConnectedSocket &other); + private: + ola::SingleUseClosure *m_on_close; +}; + + +/* + * A loopback socket. + * Everything written is available for reading. + */ +class LoopbackSocket: public ConnectedSocket { + public: + LoopbackSocket() { + m_fd_pair[0] = INVALID_SOCKET; + m_fd_pair[1] = INVALID_SOCKET; + } + ~LoopbackSocket() { Close(); } + bool Init(); + int ReadDescriptor() const { return m_fd_pair[0]; } + int WriteDescriptor() const { return m_fd_pair[1]; } + bool Close(); + bool CloseClient(); + + private: + int m_fd_pair[2]; + LoopbackSocket(const LoopbackSocket &other); + LoopbackSocket& operator=(const LoopbackSocket &other); +}; + + +/* + * A pipe socket. You can get the 'other end' of the Socket with OppositeEnd() + */ +class PipeSocket: public ConnectedSocket { + public: + PipeSocket(): + m_other_end(NULL) { + m_in_pair[0] = m_in_pair[1] = INVALID_SOCKET; + m_out_pair[0] = m_out_pair[1] = INVALID_SOCKET; + } + ~PipeSocket() { Close(); } + + bool Init(); + PipeSocket *OppositeEnd(); + int ReadDescriptor() const { return m_in_pair[0]; } + int WriteDescriptor() const { return m_out_pair[1]; } + bool Close(); + bool CloseClient(); + + private: + int m_in_pair[2]; + int m_out_pair[2]; + PipeSocket *m_other_end; + PipeSocket(int in_pair[2], int out_pair[2], PipeSocket *other_end) { + m_in_pair[0] = in_pair[0]; + m_in_pair[1] = in_pair[1]; + m_out_pair[0] = out_pair[0]; + m_out_pair[1] = out_pair[1]; + m_other_end = other_end; + } + PipeSocket(const PipeSocket &other); + PipeSocket& operator=(const PipeSocket &other); +}; + + +/* + * A TcpSocket + */ +class TcpSocket: public ConnectedSocket { + public: + explicit TcpSocket(int sd): m_sd(sd) { + SetNoSigPipe(sd); + } + ~TcpSocket() { Close(); } + + int ReadDescriptor() const { return m_sd; } + int WriteDescriptor() const { return m_sd; } + bool Close(); + + static TcpSocket* Connect(const std::string &ip_address, + unsigned short port); + private: + int m_sd; + TcpSocket(const TcpSocket &other); + TcpSocket& operator=(const TcpSocket &other); +}; + + +/* + * A socket which represents a connection to a device + */ +class DeviceSocket: public ConnectedSocket { + public: + explicit DeviceSocket(int fd): m_fd(fd) {} + ~DeviceSocket() { Close(); } + + int ReadDescriptor() const { return m_fd; } + int WriteDescriptor() const { return m_fd; } + bool Close(); + private: + int m_fd; + DeviceSocket(const DeviceSocket &other); + DeviceSocket& operator=(const DeviceSocket &other); +}; + + +/* + * A UdpSocket (non connected) + */ +class UdpSocket: public BidirectionalSocket { + public: + UdpSocket(): BidirectionalSocket(), + m_fd(INVALID_SOCKET), + m_bound_to_port(false) {} + ~UdpSocket() { Close(); } + bool Init(); + bool Bind(unsigned short port = INADDR_ANY); + bool Close(); + int ReadDescriptor() const { return m_fd; } + int WriteDescriptor() const { return m_fd; } + ssize_t SendTo(const uint8_t *buffer, + unsigned int size, + const struct sockaddr_in &destination) const; + ssize_t SendTo(const uint8_t *buffer, + unsigned int size, + const std::string &ip, + unsigned short port) const; + bool RecvFrom(uint8_t *buffer, + ssize_t *data_read, + struct sockaddr_in &source, + socklen_t &src_size) const; + bool RecvFrom(uint8_t *buffer, ssize_t *data_read) const; + bool EnableBroadcast(); + bool JoinMulticast(const struct in_addr &interface, + const struct in_addr &group, + bool loop = false); + bool JoinMulticast(const struct in_addr &interface, + const std::string &address, + bool loop = false); + bool LeaveMulticast(const struct in_addr &interface, + const struct in_addr &group); + bool LeaveMulticast(const struct in_addr &interface, + const std::string &address); + + bool SetTos(uint8_t tos); + + private: + int m_fd; + bool m_bound_to_port; + UdpSocket(const UdpSocket &other); + UdpSocket& operator=(const UdpSocket &other); + bool _RecvFrom(uint8_t *buffer, + ssize_t *data_read, + struct sockaddr_in *source, + socklen_t *src_size) const; +}; + + +/* + * A Socket creates new Sockets when clients connect. + */ +class AcceptingSocket: public Socket { + public: + AcceptingSocket() {} + virtual bool Listen() = 0; + virtual bool Close() = 0; + virtual ConnectedSocket* Accept() = 0; +}; + + +/* + * A TCP accepting socket + */ +class TcpAcceptingSocket: public AcceptingSocket { + public: + TcpAcceptingSocket(const std::string &address, unsigned short port, + int backlog = 10); + ~TcpAcceptingSocket() { Close(); } + bool Listen(); + int ReadDescriptor() const { return m_sd; } + bool Close(); + ConnectedSocket *Accept(); + private: + std::string m_address; + uint16_t m_port; + int m_sd, m_backlog; + TcpAcceptingSocket(const TcpAcceptingSocket &other); + TcpAcceptingSocket& operator=(const TcpAcceptingSocket &other); +}; +} // network +} // ola +#endif // INCLUDE_OLA_NETWORK_SOCKET_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/plugin_id.h b/open-lighting-architecture/ola-0.8.4/include/ola/plugin_id.h new file mode 100644 index 0000000..b3a0889 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/plugin_id.h @@ -0,0 +1,44 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * plugin_id.h + * Contains the plugin ids. + * Copyright (C) 2005-2009 Simon Newton + * + * This file has been autogenerated by make_plugin_id.sh, DO NOT EDIT. + */ + +#ifndef INCLUDE_OLA_PLUGIN_ID_H_ +#define INCLUDE_OLA_PLUGIN_ID_H_ + +namespace ola { + +typedef enum { + OLA_PLUGIN_ALL = 0, + OLA_PLUGIN_DUMMY = 1, + OLA_PLUGIN_ARTNET = 2, + OLA_PLUGIN_SHOWNET = 3, + OLA_PLUGIN_ESPNET = 4, + OLA_PLUGIN_USBPRO = 5, + OLA_PLUGIN_OPENDMX = 6, + OLA_PLUGIN_SANDNET = 7, + OLA_PLUGIN_STAGEPROFI = 8, + OLA_PLUGIN_PATHPORT = 9, + OLA_PLUGIN_DMX4LINUX = 10, + OLA_PLUGIN_E131 = 11, + OLA_PLUGIN_USBDMX = 12, +} ola_plugin_id; +} +#endif // INCLUDE_OLA_PLUGIN_ID_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.am new file mode 100644 index 0000000..7908d49 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.am @@ -0,0 +1,6 @@ +SOURCES = RDMAPI.h RDMAPIImplInterface.h RDMCommand.h RDMEnums.h RDMHelper.h \ + UID.h UIDSet.h + +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +pkgincludedir = $(includedir)/ola/rdm/ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.in new file mode 100644 index 0000000..85b168f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/Makefile.in @@ -0,0 +1,429 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/ola/rdm +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/rdm/ +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +SOURCES = RDMAPI.h RDMAPIImplInterface.h RDMCommand.h RDMEnums.h RDMHelper.h \ + UID.h UIDSet.h + +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/ola/rdm/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/ola/rdm/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPI.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPI.h new file mode 100644 index 0000000..c5e172a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPI.h @@ -0,0 +1,1246 @@ +/* + * 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 Library 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. + * + * RDMAPI.h + * Provide a generic RDM API that can use different implementations. + * Copyright (C) 2010 Simon Newton + * + * This class provides a high level C++ RDM API for PIDs defined in + * E1.20. It includes errors checking for out-of-range arguments. Each RDM + * method takes a pointer to a string, which will be populated with an english + * error message if the command fails. + */ + +#ifndef INCLUDE_OLA_RDM_RDMAPI_H_ +#define INCLUDE_OLA_RDM_RDMAPI_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ola { +namespace rdm { + +using std::string; +using std::vector; +using ola::SingleUseCallback1; +using ola::SingleUseCallback2; +using ola::SingleUseCallback3; +using ola::SingleUseCallback4; + + +/* + * Represents the state of a response. + * RDM requests can fail in a number of ways: + * - transport error talking to the OLA server + * - no response received (time out) + * - response was NACKED + * - the param data wasn't what we expected + * This object describes the response state. ResponseType() type should be + * checked first, and for anything other than NACK_REASON & VALID_RESPONSE, + * there will be a human readable error in Error(). In the event of a + * NACK_REASON, NackReason() contains the error code (unless it itself was + * malformed, in which case MALFORMED_RESPONSE is used). + */ +class ResponseStatus { + public: + ResponseStatus(const RDMAPIImplResponseStatus &status, + const string &data); + + typedef enum { + TRANSPORT_ERROR, + BROADCAST_REQUEST, + REQUEST_NACKED, + MALFORMED_RESPONSE, + VALID_RESPONSE, + } response_type; + + // This indicates this result of the command + response_type ResponseType() const { return m_response_type; } + // The NACK reason if the type was NACK_REASON + uint16_t NackReason() const { return m_nack_reason; } + // Provides an error string for the user + const string& Error() const { return m_error; } + + // Used to change the response type to malformed, with an error string + void MalformedResponse(const string &error) { + m_response_type = MALFORMED_RESPONSE; + m_error = error; + } + + private: + response_type m_response_type; + uint16_t m_nack_reason; + string m_error; +}; + + +/* + * Represents a Status Message + */ +typedef struct { + uint16_t sub_device; + uint16_t status_message_id; + int16_t value1; + int16_t value2; + uint8_t status_type; +} StatusMessage; + + +/* + * Represents the description for a parameter + */ +typedef struct { + uint16_t pid; + uint8_t pdl_size; + uint8_t data_type; + uint8_t command_class; + uint8_t unit; + uint8_t prefix; + uint32_t min_value; + uint32_t default_value; + uint32_t max_value; + string description; +} ParameterDescriptor; + + +/* + * Represents a DeviceDescriptor reply + */ +struct device_info_s { + uint8_t protocol_version_high; + uint8_t protocol_version_low; + uint16_t device_model; + uint16_t product_category; + uint32_t software_version; + uint16_t dmx_footprint; + uint8_t current_personality; + uint8_t personaility_count; + uint16_t dmx_start_address; + uint16_t sub_device_count; + uint8_t sensor_count; +} __attribute__((packed)); + +typedef struct device_info_s DeviceDescriptor; + + +/* + * Information about a DMX slot + */ +struct slot_info_s { + uint16_t slot_offset; + uint8_t slot_type; + uint16_t slot_label; +} __attribute__((packed)); + +typedef struct slot_info_s SlotDescriptor; + +/* + * The default values for a slot + */ +struct slot_default_s { + uint16_t slot_offset; + uint8_t default_value; +} __attribute__((packed)); + +typedef struct slot_default_s SlotDefault; + + +/* + * Sensor definition + */ +typedef struct { + uint8_t sensor_number; + uint8_t type; + uint8_t unit; + uint8_t prefix; + int16_t range_min; + int16_t range_max; + int16_t normal_min; + int16_t normal_max; + uint8_t recorded_value_support; + string description; +} SensorDescriptor; + + +/* + * Sensor values + */ +struct sensor_values_s { + uint8_t sensor_number; + int16_t present_value; + int16_t lowest; + int16_t highest; + int16_t recorded; +} __attribute__((packed)); + +typedef struct sensor_values_s SensorValueDescriptor; + +/* + * Clock structure + */ +struct clock_value_s { + uint16_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; +} __attribute__((packed)); + +typedef struct clock_value_s ClockValue; + +/* + * The interface for objects which deal with queued messages + */ +class QueuedMessageHandler { + public: + virtual ~QueuedMessageHandler() {} + + virtual void ProxiedDeviceCount(const ResponseStatus &status, + uint16_t device_count, + bool list_changed) = 0; + virtual void ProxiedDevices(const ResponseStatus &status, + const vector &uids) = 0; + virtual void CommStatus(const ResponseStatus &status, + uint16_t short_message, + uint16_t length_mismatch, + uint16_t checksum_fail) = 0; + virtual void StatusMessages(const ResponseStatus &status, + const vector &messages) = 0; + virtual void StatusIdDescription(const ResponseStatus &status, + const string &status_id) = 0; + virtual void SubDeviceReporting(const ResponseStatus &status, + uint8_t status_type) = 0; + virtual void SupportedParameters(const ResponseStatus &status, + const vector ¶meters) = 0; + virtual void ParameterDescription( + const ResponseStatus &status, + const ParameterDescriptor &description) = 0; + virtual void DeviceInfo(const ResponseStatus &status, + const DeviceDescriptor &device_info) = 0; + virtual void ProductDetailIdList(const ResponseStatus &status, + const vector &ids) = 0; + virtual void DeviceModelDescription(const ResponseStatus &status, + const string &description) = 0; + virtual void ManufacturerLabel(const ResponseStatus &status, + const string &label) = 0; + virtual void DeviceLabel(const ResponseStatus &status, + const string &label) = 0; + virtual void FactoryDefaults(const ResponseStatus &status, + bool using_defaults) = 0; + virtual void LanguageCapabilities(const ResponseStatus &status, + const vector &langs) = 0; + virtual void Language(const ResponseStatus &status, + const string &language) = 0; + virtual void SoftwareVersionLabel(const ResponseStatus &status, + const string &label) = 0; + virtual void BootSoftwareVersion(const ResponseStatus &status, + uint32_t version) = 0; + virtual void BootSoftwareVersionLabel(const ResponseStatus &status, + const string &label) = 0; + virtual void DMXPersonality(const ResponseStatus &status, + uint8_t current_personality, + uint8_t personality_count) = 0; + virtual void DMXPersonalityDescription(const ResponseStatus &status, + uint8_t personality, + uint16_t slots_requires, + const string &label) = 0; + virtual void DMXAddress(const ResponseStatus &status, + uint16_t start_address) = 0; + virtual void SlotInfo(const ResponseStatus &status, + const vector &slots) = 0; + virtual void SlotDescription(const ResponseStatus &status, + uint16_t slot_offset, + const string &description) = 0; + virtual void SlotDefaultValues(const ResponseStatus &status, + const vector &defaults) = 0; + virtual void SensorDefinition(const ResponseStatus &status, + const SensorDescriptor &descriptor) = 0; + virtual void SensorValue(const ResponseStatus &status, + const SensorValueDescriptor &descriptor) = 0; + virtual void DeviceHours(const ResponseStatus &status, + uint32_t hours) = 0; + virtual void LampHours(const ResponseStatus &status, + uint32_t hours) = 0; + virtual void LampStrikes(const ResponseStatus &status, + uint32_t hours) = 0; + virtual void LampState(const ResponseStatus &status, + uint8_t state) = 0; + virtual void LampMode(const ResponseStatus &status, + uint8_t mode) = 0; + virtual void DevicePowerCycles(const ResponseStatus &status, + uint32_t hours) = 0; + virtual void DisplayInvert(const ResponseStatus &status, + uint8_t invert_mode) = 0; + virtual void DisplayLevel(const ResponseStatus &status, + uint8_t level) = 0; + virtual void PanInvert(const ResponseStatus &status, + uint8_t inverted) = 0; + virtual void TiltInvert(const ResponseStatus &status, + uint8_t inverted) = 0; + virtual void PanTiltSwap(const ResponseStatus &status, + uint8_t inverted) = 0; + virtual void IdentifyMode(const ResponseStatus &status, + bool mode) = 0; + virtual void Clock(const ResponseStatus &status, + const ClockValue &clock) = 0; + virtual void PowerState(const ResponseStatus &status, + uint8_t power_state) = 0; + virtual void SelfTestEnabled(const ResponseStatus &status, + bool is_enabled) = 0; + virtual void SelfTestDescription(const ResponseStatus &status, + uint8_t self_test_number, + const string &description) = 0; + virtual void PresetPlaybackMode(const ResponseStatus&, + uint16_t preset_mode, + uint8_t level) = 0; + + // TODO(simon): add a default handler here +}; + + +/* + * The high level RDM API. + */ +class RDMAPI { + public: + explicit RDMAPI(class RDMAPIImplInterface *impl): + m_impl(impl) { + } + ~RDMAPI() {} + + // This is used to check for queued messages + uint8_t OutstandingMessagesCount(const UID &uid); + + // Proxy methods + bool GetProxiedDeviceCount( + unsigned int universe, + const UID &uid, + SingleUseCallback3 *callback, + string *error); + + bool GetProxiedDevices( + unsigned int universe, + const UID &uid, + SingleUseCallback2&> *callback, + string *error); + + // Network Managment Methods + bool GetCommStatus( + unsigned int universe, + const UID &uid, + SingleUseCallback4 *callback, + string *error); + + bool ClearCommStatus( + unsigned int universe, + const UID &uid, + SingleUseCallback1 *callback, + string *error); + + /* + bool GetQueuedMessage( + const UID &uid, + rdm_status_type status_type, + QueuedMessageHandler *message_handler); + */ + + bool GetStatusMessage( + unsigned int universe, + const UID &uid, + rdm_status_type status_type, + SingleUseCallback2&> *callback, + string *error); + + bool GetStatusIdDescription( + unsigned int universe, + const UID &uid, + uint16_t status_id, + SingleUseCallback2 *callback, + string *error); + + bool ClearStatusId( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback1 *callback, + string *error); + + bool GetSubDeviceReporting( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetSubDeviceReporting( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + rdm_status_type status_type, + SingleUseCallback1 *callback, + string *error); + + // Information Methods + bool GetSupportedParameters( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 &> *callback, + string *error); + + bool GetParameterDescription( + unsigned int universe, + const UID &uid, + uint16_t pid, + SingleUseCallback2 *callback, + string *error); + + bool GetDeviceInfo( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetProductDetailIdList( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 &> *callback, + string *error); + + bool GetDeviceModelDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetManufacturerLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetDeviceLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDeviceLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const string &label, + SingleUseCallback1 *callback, + string *error); + + bool GetFactoryDefaults( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool ResetToFactoryDefaults( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback1 *callback, + string *error); + + bool GetLanguageCapabilities( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error); + + bool GetLanguage( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetLanguage( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const string &language, + SingleUseCallback1 *callback, + string *error); + + bool GetSoftwareVersionLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetBootSoftwareVersion( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetBootSoftwareVersionLabel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool GetDMXPersonality( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback3 *callback, + string *error); + + bool SetDMXPersonality( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t personality, + SingleUseCallback1 *callback, + string *error); + + bool GetDMXPersonalityDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t personality, + SingleUseCallback4 *callback, + string *error); + + bool GetDMXAddress( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDMXAddress( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t start_address, + SingleUseCallback1 *callback, + string *error); + + bool GetSlotInfo( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error); + + bool GetSlotDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t slot_offset, + SingleUseCallback3 *callback, + string *error); + + bool GetSlotDefaultValues( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2&> *callback, + string *error); + + bool GetSensorDefinition( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error); + + bool GetSensorValue( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error); + + bool SetSensorValue( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback2 *callback, + string *error); + + bool RecordSensors( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t sensor_number, + SingleUseCallback1 *callback, + string *error); + + bool GetDeviceHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDeviceHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t device_hours, + SingleUseCallback1 *callback, + string *error); + + bool GetLampHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetLampHours( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t lamp_hours, + SingleUseCallback1 *callback, + string *error); + + bool GetLampStrikes( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetLampStrikes( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t lamp_strikes, + SingleUseCallback1 *callback, + string *error); + + bool GetLampState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetLampState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t lamp_state, + SingleUseCallback1 *callback, + string *error); + + bool GetLampMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetLampMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t lamp_mode, + SingleUseCallback1 *callback, + string *error); + + bool GetDevicePowerCycles( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDevicePowerCycles( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t power_cycles, + SingleUseCallback1 *callback, + string *error); + + bool GetDisplayInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDisplayInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t display_invert, + SingleUseCallback1 *callback, + string *error); + + bool GetDisplayLevel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetDisplayLevel( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t display_level, + SingleUseCallback1 *callback, + string *error); + + bool GetPanInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetPanInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t invert, + SingleUseCallback1 *callback, + string *error); + + bool GetTiltInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetTiltInvert( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t invert, + SingleUseCallback1 *callback, + string *error); + + bool GetPanTiltSwap( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetPanTiltSwap( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t swap, + SingleUseCallback1 *callback, + string *error); + + bool GetClock( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetClock( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + const ClockValue &clock, + SingleUseCallback1 *callback, + string *error); + + bool GetIdentifyMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool IdentifyDevice( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + bool mode, + SingleUseCallback1 *callback, + string *error); + + bool ResetDevice( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + bool warm_reset, + SingleUseCallback1 *callback, + string *error); + + bool GetPowerState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool SetPowerState( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + rdm_power_state power_state, + SingleUseCallback1 *callback, + string *error); + + bool SelfTestEnabled( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + string *error); + + bool PerformSelfTest( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t self_test_number, + SingleUseCallback1 *callback, + string *error); + + bool SelfTestDescription( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t self_test_number, + SingleUseCallback3 *callback, + string *error); + + bool CapturePreset( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t scene, + uint16_t fade_up_time, + uint16_t fade_down_time, + uint16_t wait_time, + SingleUseCallback1 *callback, + string *error); + + bool PresetPlaybackMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback3 *callback, + string *error); + + bool SetPresetPlaybackMode( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t playback_mode, + uint8_t level, + SingleUseCallback1 *callback, + string *error); + + // Handlers, these are called by the RDMAPIImpl. + + // Generic handlers + void _HandleLabelResponse( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleBoolResponse( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleU8Response( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleU32Response( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleEmptyResponse( + SingleUseCallback1 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + // specific handlers follow + void _HandleGetProxiedDeviceCount( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetProxiedDevices( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetCommStatus( + SingleUseCallback4 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetStatusMessage( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSubDeviceReporting( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSupportedParameters( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetParameterDescriptor( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetDeviceDescriptor( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetProductDetailIdList( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetLanguageCapabilities( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetLanguage( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetBootSoftwareVersion( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetDMXPersonality( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetDMXPersonalityDescription( + SingleUseCallback4 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetDMXAddress( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSlotInfo( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSlotDescription( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSlotDefaultValues( + SingleUseCallback2&> *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleGetSensorDefinition( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleSensorValue( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleClock( + SingleUseCallback2 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandleSelfTestDescription( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + void _HandlePlaybackMode( + SingleUseCallback3 *callback, + const RDMAPIImplResponseStatus &status, + const string &data); + + private: + class RDMAPIImplInterface *m_impl; + std::map m_outstanding_messages; + + enum {LABEL_SIZE = 32}; + + bool GenericGetU8( + unsigned int universe, + const UID &uid, + uint8_t sub_device, + SingleUseCallback2 *callback, + uint16_t pid, + string *error); + + bool GenericSetU8( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint8_t value, + SingleUseCallback1 *callback, + uint16_t pid, + string *error); + + bool GenericGetU32( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + SingleUseCallback2 *callback, + uint16_t pid, + string *error); + + bool GenericSetU32( + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint32_t value, + SingleUseCallback1 *callback, + uint16_t pid, + string *error); + + // Check that a callback is not null + template + bool CheckCallback(string *error, const callback_type *cb) { + if (cb == NULL) { + if (error) + *error = "Callback is null, this is a programming error"; + return true; + } + return false; + } + + // Check that a UID is not a broadcast address + template + bool CheckNotBroadcast(const UID &uid, string *error, + const callback_type *cb) { + if (uid.IsBroadcast()) { + if (error) + *error = "Cannot send to broadcast address"; + delete cb; + return true; + } + return false; + } + + // Check the subdevice value is valid + template + bool CheckValidSubDevice(uint16_t sub_device, + bool broadcast_allowed, + string *error, + const callback_type *cb) { + if (sub_device <= 0x0200) + return false; + + if (broadcast_allowed && sub_device == ALL_RDM_SUBDEVICES) + return false; + + if (error) { + *error = "Sub device must be <= 0x0200"; + if (broadcast_allowed) + *error += " or 0xffff"; + } + delete cb; + return true; + } + + bool CheckReturnStatus(bool status, string *error); + void SetIncorrectPDL(ResponseStatus *status, + unsigned int actual, + unsigned int expected); +}; +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_RDMAPI_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPIImplInterface.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPIImplInterface.h new file mode 100644 index 0000000..154574e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMAPIImplInterface.h @@ -0,0 +1,82 @@ +/* + * 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 Library 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. + * + * RDMAPIImplInterface.h + * The interface for an RDM API Implementation + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_RDMAPIIMPLINTERFACE_H_ +#define INCLUDE_OLA_RDM_RDMAPIIMPLINTERFACE_H_ + +#include +#include +#include +#include + +namespace ola { +namespace rdm { + +using std::string; + + +/* + * Represents the state of a response (ack, nack etc.) and the reason if there + * is one. + * + * RDM Handles should first check for rpc_error being non-empty as this + * represents an underlying transport error. Then was_broadcast should be + * checked, as we don't get any response for broadcast messages. Finally, the + * value of response_type should be checked against the rdm_response_type + * codes. + */ +struct RDMAPIImplResponseStatus { + bool was_broadcast; // true if this was a broadcast request + uint8_t response_type; // The RDM response type + uint8_t message_count; // Number of queued messages + string error; // Non empty if the RPC failed +}; + + +/* + * This is the interface for an RDMAPI implementation + */ +class RDMAPIImplInterface { + public: + virtual ~RDMAPIImplInterface() {} + + // args are the response type the param data + typedef ola::SingleUseCallback2 rdm_callback; + + virtual bool RDMGet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) = 0; + virtual bool RDMSet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0) = 0; +}; +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_RDMAPIIMPLINTERFACE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMCommand.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMCommand.h new file mode 100644 index 0000000..c43e462 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMCommand.h @@ -0,0 +1,286 @@ +/* + * 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 Library 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. + * + * RDMCommand.h + * Representation of an RDM RDMCommand + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_RDMCOMMAND_H_ +#define INCLUDE_OLA_RDM_RDMCOMMAND_H_ + +#include +#include +#include +#include +#include + +namespace ola { +namespace rdm { + + +/* + * Represents a RDMCommand. + */ +class RDMCommand { + public: + typedef enum { + DISCOVER_COMMAND = 0x10, + DISCOVER_COMMAND_RESPONSE = 0x11, + GET_COMMAND = 0x20, + GET_COMMAND_RESPONSE = 0x21, + SET_COMMAND = 0x30, + SET_COMMAND_RESPONSE = 0x31, + INVALID_COMMAND = 0xff, + } RDMCommandClass; + + virtual ~RDMCommand(); + bool operator==(const RDMCommand &other) const; + + std::string ToString() const; + + friend ostream& operator<< (ostream &out, const RDMCommand &command) { + return out << command.ToString(); + } + + // subclasses provide this + virtual RDMCommandClass CommandClass() const = 0; + + // Accessors + const UID& SourceUID() const { return m_source; } + const UID& DestinationUID() const { return m_destination; } + uint8_t TransactionNumber() const { return m_transaction_number; } + uint8_t MessageCount() const { return m_message_count; } + uint16_t SubDevice() const { return m_sub_device; } + uint16_t ParamId() const { return m_param_id; } + uint8_t *ParamData() const { return m_data; } + unsigned int ParamDataSize() const { return m_data_length; } + + // Pack this RDMCommand into memory + unsigned int Size() const; + bool Pack(uint8_t *buffer, unsigned int *size) const; + + static const uint8_t START_CODE = 0xcc; + enum { MAX_PARAM_DATA_LENGTH = 231 }; + + protected: + RDMCommand(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t port_id, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length); + + // don't use anything other than uint8_t here otherwise we can get + // alignment issues. + typedef struct { + uint8_t sub_start_code; + uint8_t message_length; + uint8_t destination_uid[UID::UID_SIZE]; + uint8_t source_uid[UID::UID_SIZE]; + uint8_t transaction_number; + uint8_t port_id; + uint8_t message_count; + uint8_t sub_device[2]; + uint8_t command_class; + uint8_t param_id[2]; + uint8_t param_data_length; + } rdm_command_message; + + static const rdm_command_message* VerifyData(const uint8_t *data, + unsigned int length); + static RDMCommandClass ConvertCommandClass(uint8_t command_type); + + uint8_t m_port_id; + + private: + UID m_source; + UID m_destination; + uint8_t m_transaction_number; + uint8_t m_message_count; + uint16_t m_sub_device; + uint16_t m_param_id; + uint8_t *m_data; + unsigned int m_data_length; + + static const uint8_t SUB_START_CODE = 0x01; + static const unsigned int CHECKSUM_LENGTH = 2; + + RDMCommand(const RDMCommand &other); + bool operator=(const RDMCommand &other) const; + RDMCommand& operator=(const RDMCommand &other); + static uint16_t CalculateChecksum(const uint8_t *data, + unsigned int packet_length); +}; + + +/* + * The subset of RDM Commands that represent requests + */ +class RDMRequest: public RDMCommand { + public: + RDMRequest(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t port_id, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length): + RDMCommand(source, + destination, + transaction_number, + port_id, + message_count, + sub_device, + param_id, + data, + length) { + } + + uint8_t PortId() const { return m_port_id; } + + virtual RDMRequest *Duplicate() const = 0; + + // Convert a block of data to an RDMCommand object + static RDMRequest* InflateFromData(const uint8_t *data, + unsigned int length); +}; + + +template +class BaseRDMRequest: public RDMRequest { + public: + BaseRDMRequest(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t port_id, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length): + RDMRequest(source, + destination, + transaction_number, + port_id, + message_count, + sub_device, + param_id, + data, + length) { + } + RDMCommandClass CommandClass() const { return command_class; } + BaseRDMRequest *Duplicate() + const { + return new BaseRDMRequest( + SourceUID(), + DestinationUID(), + TransactionNumber(), + PortId(), + MessageCount(), + SubDevice(), + ParamId(), + ParamData(), + ParamDataSize()); + } +}; + +typedef BaseRDMRequest RDMGetRequest; +typedef BaseRDMRequest RDMSetRequest; + + +/* + * The subset of RDM Commands that represent requests + */ +class RDMResponse: public RDMCommand { + public: + RDMResponse(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t response_type, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length): + RDMCommand(source, + destination, + transaction_number, + response_type, + message_count, + sub_device, + param_id, + data, + length) { + } + + uint8_t ResponseType() const { return m_port_id; } + + // The maximum size of an ACK_OVERFLOW session that we'll buffer + // 4k should be big enough for everyone ;) + static const unsigned int MAX_OVERFLOW_SIZE = 4 << 10; + + // Convert a block of data to an RDMCommand object + static RDMResponse* InflateFromData(const uint8_t *data, + unsigned int length); + + // Combine two responses into one. + static RDMResponse* CombineResponses(const RDMResponse *response1, + const RDMResponse *response2); +}; + + +template +class BaseRDMResponse: public RDMResponse { + public: + BaseRDMResponse(const UID &source, + const UID &destination, + uint8_t transaction_number, + uint8_t response_type, + uint8_t message_count, + uint16_t sub_device, + uint16_t param_id, + const uint8_t *data, + unsigned int length): + RDMResponse(source, + destination, + transaction_number, + response_type, + message_count, + sub_device, + param_id, + data, + length) { + } + RDMCommandClass CommandClass() const { return command_class; } +}; + +typedef BaseRDMResponse RDMGetResponse; +typedef BaseRDMResponse RDMSetResponse; + +// Helper functions for dealing with RDMCommands +RDMResponse *NackWithReason(const RDMRequest *request, + rdm_nack_reason reason); +RDMResponse *GetResponseWithData(const RDMRequest *request, + const uint8_t *data, + unsigned int length); +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_RDMCOMMAND_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMEnums.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMEnums.h new file mode 100644 index 0000000..462975c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMEnums.h @@ -0,0 +1,514 @@ +/* + * 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 Library 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. + * + * RDMENUMS.h + * Provide a generic RDM ENUMS that can use different implementations. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_RDMENUMS_H_ +#define INCLUDE_OLA_RDM_RDMENUMS_H_ + +#include + +namespace ola { +namespace rdm { + +static const uint16_t ROOT_RDM_DEVICE = 0; +static const uint16_t ALL_RDM_SUBDEVICES = 0xffff; +static const uint16_t MAX_SUBDEVICE_NUMBER = 0x0200; + +typedef enum { + ACK = 0x00, + ACK_TIMER = 0x01, + NACK_REASON = 0x02, + ACK_OVERFLOW = 0x03, +} rdm_response_type; + + +typedef enum { + // network managment + PID_PROXIED_DEVICES = 0x0010, + PID_PROXIED_DEVICE_COUNT = 0x0011, + PID_COMMS_STATUS = 0x0015, + // status collection + PID_QUEUED_MESSAGE = 0x0020, + PID_STATUS_MESSAGES = 0x0030, + PID_STATUS_ID_DESCRIPTION = 0x0031, + PID_CLEAR_STATUS_ID = 0x0032, + PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD = 0x0033, + // RDM information + PID_SUPPORTED_PARAMETERS = 0x0050, + PID_PARAMETER_DESCRIPTION = 0x0051, + // production information + PID_DEVICE_INFO = 0x0060, + PID_PRODUCT_DETAIL_ID_LIST = 0x0070, + PID_DEVICE_MODEL_DESCRIPTION = 0x0080, + PID_MANUFACTURER_LABEL = 0x0081, + PID_DEVICE_LABEL = 0x0082, + PID_FACTORY_DEFAULTS = 0x0090, + PID_LANGUAGE_CAPABILITIES = 0x00A0, + PID_LANGUAGE = 0x00B0, + PID_SOFTWARE_VERSION_LABEL = 0x00C0, + PID_BOOT_SOFTWARE_VERSION_ID = 0x00C1, + PID_BOOT_SOFTWARE_VERSION_LABEL = 0x00C2, + // dmx512 + PID_DMX_PERSONALITY = 0x00E0, + PID_DMX_PERSONALITY_DESCRIPTION = 0x00E1, + PID_DMX_START_ADDRESS = 0x00F0, + PID_SLOT_INFO = 0x0120, + PID_SLOT_DESCRIPTION = 0x0121, + PID_DEFAULT_SLOT_VALUE = 0x0122, + // sensors + PID_SENSOR_DEFINITION = 0x0200, + PID_SENSOR_VALUE = 0x0201, + PID_RECORD_SENSORS = 0x0202, + // power/lamp settings + PID_DEVICE_HOURS = 0x0400, + PID_LAMP_HOURS = 0x0401, + PID_LAMP_STRIKES = 0x0402, + PID_LAMP_STATE = 0x0403, + PID_LAMP_ON_MODE = 0x0404, + PID_DEVICE_POWER_CYCLES = 0x0405, + // display settings + PID_DISPLAY_INVERT = 0x0500, + PID_DISPLAY_LEVEL = 0x0501, + // configuration + PID_PAN_INVERT = 0x0600, + PID_TILT_INVERT = 0x0601, + PID_PAN_TILT_SWAP = 0x0602, + PID_REAL_TIME_CLOCK = 0x0603, + // control + PID_IDENTIFY_DEVICE = 0x1000, + PID_RESET_DEVICE = 0x1001, + PID_POWER_STATE = 0x1010, + PID_PERFORM_SELFTEST = 0x1020, + PID_SELF_TEST_DESCRIPTION = 0x1021, + PID_CAPTURE_PRESET = 0x1030, + PID_PRESET_PLAYBACK = 0x1031, +} rdm_pid; + + +typedef enum { + STATUS_NONE = 0x0, + STATUS_GET_LAST_MESSAGE = 0x1, + STATUS_ADVISORY = 0x2, + STATUS_WARNING = 0x3, + STATUS_ERROR = 0x4, + STATUS_ADVISORY_CLEARED = 0x12, + STATUS_WARNING_CLEARED = 0x13, + STATUS_ERROR_CLEARED = 0x14, +} rdm_status_type; + + +typedef enum { + SENSOR_TEMPERATURE = 0x00, + SENSOR_VOLTAGE = 0x01, + SENSOR_CURRENT = 0x02, + SENSOR_FREQUENCY = 0x03, + SENSOR_RESISTANCE = 0x04, + SENSOR_POWER = 0x05, + SENSOR_MASS = 0x06, + SENSOR_LENGTH = 0x07, + SENSOR_AREA = 0x08, + SENSOR_VOLUME = 0x09, + SENSOR_DENSITY = 0x0A, + SENSOR_VELOCITY = 0x0B, + SENSOR_ACCELERATION = 0x0C, + SENSOR_FORCE = 0x0D, + SENSOR_ENERGY = 0x0E, + SENSOR_PRESSURE = 0x0F, + SENSOR_TIME = 0x10, + SENSOR_ANGLE = 0x11, + SENSOR_POSITION_X = 0x12, + SENSOR_POSITION_Y = 0x13, + SENSOR_POSITION_Z = 0x14, + SENSOR_ANGULAR_VELOCITY = 0x15, + SENSOR_LUMINOUS_INTENSITY = 0x16, + SENSOR_LUMINOUS_FLUX = 0x17, + SENSOR_ILLUMINANCE = 0x18, + SENSOR_CHROMINANCE_RED = 0x19, + SENSOR_CHROMINANCE_GREEN = 0x1A, + SENSOR_CHROMINANCE_BLUE = 0x1B, + SENSOR_CONTACTS = 0x1C, + SENSOR_MEMORY = 0x1D, + SENSOR_ITEMS = 0x1E, + SENSOR_HUMIDITY = 0x1F, + SENSOR_COUNTER_16BIT = 0x20, + SENSOR_OTHER = 0x7F, +} rdm_sensor_type; + +typedef enum { + UNITS_NONE = 0x00, + UNITS_CENTIGRADE = 0x01, + UNITS_VOLTS_DC = 0x02, + UNITS_VOLTS_AC_PEAK = 0x03, + UNITS_VOLTS_AC_RMS = 0x04, + UNITS_AMPERE_DC = 0x05, + UNITS_AMPERE_AC_PEAK = 0x06, + UNITS_AMPERE_AC_RMS = 0x07, + UNITS_HERTZ = 0x08, + UNITS_OHM = 0x09, + UNITS_WATT = 0x0A, + UNITS_KILOGRAM = 0x0B, + UNITS_METERS = 0x0C, + UNITS_METERS_SQUARED = 0x0D, + UNITS_METERS_CUBED = 0x0E, + UNITS_KILOGRAMMES_PER_METER_CUBED = 0x0F, + UNITS_METERS_PER_SECOND = 0x10, + UNITS_METERS_PER_SECOND_SQUARED = 0x11, + UNITS_NEWTON = 0x12, + UNITS_JOULE = 0x13, + UNITS_PASCAL = 0x14, + UNITS_SECOND = 0x15, + UNITS_DEGREE = 0x16, + UNITS_STERADIAN = 0x17, + UNITS_CANDELA = 0x18, + UNITS_LUMEN = 0x19, + UNITS_LUX = 0x1A, + UNITS_IRE = 0x1B, + UNITS_BYTE = 0x1C, +} rdm_pid_unit; + + +typedef enum { + PREFIX_NONE = 0x00, + PREFIX_DECI = 0x01, + PREFIX_CENTI = 0x02, + PREFIX_MILLI = 0x03, + PREFIX_MICRO = 0x04, + PREFIX_NANO = 0x05, + PREFIX_PICO = 0x06, + PREFIX_FEMPTO = 0x07, + PREFIX_ATTO = 0x08, + PREFIX_ZEPTO = 0x09, + PREFIX_YOCTO = 0x0A, + PREFIX_DECA = 0x11, + PREFIX_HECTO = 0x12, + PREFIX_KILO = 0x13, + PREFIX_MEGA = 0x14, + PREFIX_GIGA = 0x15, + PREFIX_TERRA = 0x16, + PREFIX_PETA = 0x17, + PREFIX_EXA = 0x18, + PREFIX_ZETTA = 0x19, + PREFIX_YOTTA = 0x1A, +} rdm_pid_prefix; + + +typedef enum { + CC_GET = 0x01, + CC_SET = 0x02, + CC_GET_SET = 0x03, +} rdm_command_class; + + +typedef enum { + DS_NOT_DEFINED = 0x0, + DS_BIT_FIELD = 0x01, + DS_ASCII = 0x02, + DS_UNSIGNED_BYTE = 0x03, + DS_SIGNED_BYTE = 0x04, + DS_UNSIGNED_WORD = 0x05, + DS_SIGNED_WORD = 0x06, + DS_UNSIGNED_DWORD = 0x07, + DS_SIGNED_DWORD = 0x08, +} rdm_data_type; + + +typedef enum { + NR_UNKNOWN_PID = 0x0000, + NR_FORMAT_ERROR = 0x0001, + NR_HARDWARE_FAULT = 0x0002, + NR_PROXY_REJECT = 0x0003, + NR_WRITE_PROTECT = 0x0004, + NR_UNSUPPORTED_COMMAND_CLASS = 0x0005, + NR_DATA_OUT_OF_RANGE = 0x0006, + NR_BUFFER_FULL = 0x0007, + NR_PACKET_SIZE_UNSUPPORTED = 0x0008, + NR_SUB_DEVICE_OUT_OF_RANGE = 0x0009, + NR_PROXY_BUFFER_FULL = 0x000A, +} rdm_nack_reason; + + +typedef enum { + PRODUCT_CATEGORY_NOT_DECLARED = 0x0000, + PRODUCT_CATEGORY_FIXTURE = 0x0100, + PRODUCT_CATEGORY_FIXTURE_FIXED = 0x0101, + PRODUCT_CATEGORY_FIXTURE_MOVING_YOKE = 0x0102, + PRODUCT_CATEGORY_FIXTURE_MOVING_MIRROR = 0x0103, + PRODUCT_CATEGORY_FIXTURE_OTHER = 0x01FF, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY = 0x0200, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_COLOR = 0x0201, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_YOKE = 0x0202, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_MIRROR = 0x0203, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_EFFECT = 0x0204, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_BEAM = 0x0205, + PRODUCT_CATEGORY_FIXTURE_ACCESSORY_OTHER = 0x02FF, + PRODUCT_CATEGORY_PROJECTOR = 0x0300, + PRODUCT_CATEGORY_PROJECTOR_FIXED = 0x0301, + PRODUCT_CATEGORY_PROJECTOR_MOVING_YOKE = 0x0302, + PRODUCT_CATEGORY_PROJECTOR_MOVING_MIRROR = 0x0303, + PRODUCT_CATEGORY_PROJECTOR_OTHER = 0x03FF, + PRODUCT_CATEGORY_ATMOSPHERIC = 0x0400, + PRODUCT_CATEGORY_ATMOSPHERIC_EFFECT = 0x0401, + PRODUCT_CATEGORY_ATMOSPHERIC_PYRO = 0x0402, + PRODUCT_CATEGORY_ATMOSPHERIC_OTHER = 0x04FF, + PRODUCT_CATEGORY_DIMMER = 0x0500, + PRODUCT_CATEGORY_DIMMER_AC_INCANDESCENT = 0x0501, + PRODUCT_CATEGORY_DIMMER_AC_FLUORESCENT = 0x0502, + PRODUCT_CATEGORY_DIMMER_AC_COLDCATHODE = 0x0503, + PRODUCT_CATEGORY_DIMMER_AC_NONDIM = 0x0504, + PRODUCT_CATEGORY_DIMMER_AC_ELV = 0x0505, + PRODUCT_CATEGORY_DIMMER_AC_OTHER = 0x0506, + PRODUCT_CATEGORY_DIMMER_DC_LEVEL = 0x0507, + PRODUCT_CATEGORY_DIMMER_DC_PWM = 0x0508, + PRODUCT_CATEGORY_DIMMER_CS_LED = 0x0509, + PRODUCT_CATEGORY_DIMMER_OTHER = 0x05FF, + PRODUCT_CATEGORY_POWER = 0x0600, + PRODUCT_CATEGORY_POWER_CONTROL = 0x0601, + PRODUCT_CATEGORY_POWER_SOURCE = 0x0602, + PRODUCT_CATEGORY_POWER_OTHER = 0x06FF, + PRODUCT_CATEGORY_SCENIC = 0x0700, + PRODUCT_CATEGORY_SCENIC_DRIVE = 0x0701, + PRODUCT_CATEGORY_SCENIC_OTHER = 0x07FF, + PRODUCT_CATEGORY_DATA = 0x0800, + PRODUCT_CATEGORY_DATA_DISTRIBUTION = 0x0801, + PRODUCT_CATEGORY_DATA_CONVERSION = 0x0802, + PRODUCT_CATEGORY_DATA_OTHER = 0x08FF, + PRODUCT_CATEGORY_AV = 0x0900, + PRODUCT_CATEGORY_AV_AUDIO = 0x0901, + PRODUCT_CATEGORY_AV_VIDEO = 0x0902, + PRODUCT_CATEGORY_AV_OTHER = 0x09FF, + PRODUCT_CATEGORY_MONITOR = 0x0A00, + PRODUCT_CATEGORY_MONITOR_ACLINEPOWER = 0x0A01, + PRODUCT_CATEGORY_MONITOR_DCPOWER = 0x0A02, + PRODUCT_CATEGORY_MONITOR_ENVIRONMENTAL = 0x0A03, + PRODUCT_CATEGORY_MONITOR_OTHER = 0x0AFF, + PRODUCT_CATEGORY_CONTROL = 0x7000, + PRODUCT_CATEGORY_CONTROL_CONTROLLER = 0x7001, + PRODUCT_CATEGORY_CONTROL_BACKUPDEVICE = 0x7002, + PRODUCT_CATEGORY_CONTROL_OTHER = 0x70FF, + PRODUCT_CATEGORY_TEST = 0x7100, + PRODUCT_CATEGORY_TEST_EQUIPMENT = 0x7101, + PRODUCT_CATEGORY_TEST_EQUIPMENT_OTHER = 0x71FF, + PRODUCT_CATEGORY_OTHER = 0x7FFF, +} rdm_product_category; + + +// product details +typedef enum { + PRODUCT_DETAIL_NOT_DECLARED = 0x0000, + PRODUCT_DETAIL_ARC = 0x0001, + PRODUCT_DETAIL_METAL_HALIDE = 0x0002, + PRODUCT_DETAIL_INCANDESCENT = 0x0003, + PRODUCT_DETAIL_LED = 0x0004, + PRODUCT_DETAIL_FLUROESCENT = 0x0005, + PRODUCT_DETAIL_COLDCATHODE = 0x0006, + PRODUCT_DETAIL_ELECTROLUMINESCENT = 0x0007, + PRODUCT_DETAIL_LASER = 0x0008, + PRODUCT_DETAIL_FLASHTUBE = 0x0009, + PRODUCT_DETAIL_COLORSCROLLER = 0x0100, + PRODUCT_DETAIL_COLORWHEEL = 0x0101, + PRODUCT_DETAIL_COLORCHANGE = 0x0102, + PRODUCT_DETAIL_IRIS_DOUSER = 0x0103, + PRODUCT_DETAIL_DIMMING_SHUTTER = 0x0104, + PRODUCT_DETAIL_PROFILE_SHUTTER = 0x0105, + PRODUCT_DETAIL_BARNDOOR_SHUTTER = 0x0106, + PRODUCT_DETAIL_EFFECTS_DISC = 0x0107, + PRODUCT_DETAIL_GOBO_ROTATOR = 0x0108, + PRODUCT_DETAIL_VIDEO = 0x0200, + PRODUCT_DETAIL_SLIDE = 0x0201, + PRODUCT_DETAIL_FILM = 0x0202, + PRODUCT_DETAIL_OILWHEEL = 0x0203, + PRODUCT_DETAIL_LCDGATE = 0x0204, + PRODUCT_DETAIL_FOGGER_GLYCOL = 0x0300, + PRODUCT_DETAIL_FOGGER_MINERALOIL = 0x0301, + PRODUCT_DETAIL_FOGGER_WATER = 0x0302, + PRODUCT_DETAIL_CO2 = 0x0303, + PRODUCT_DETAIL_LN2 = 0x0304, + PRODUCT_DETAIL_BUBBLE = 0x0305, + PRODUCT_DETAIL_FLAME_PROPANE = 0x0306, + PRODUCT_DETAIL_FLAME_OTHER = 0x0307, + PRODUCT_DETAIL_OLEFACTORY_STIMULATOR = 0x0308, + PRODUCT_DETAIL_SNOW = 0x0309, + PRODUCT_DETAIL_WATER_JET = 0x030A, + PRODUCT_DETAIL_WIND = 0x030B, + PRODUCT_DETAIL_CONFETTI = 0x030C, + PRODUCT_DETAIL_HAZARD = 0x030D, + PRODUCT_DETAIL_PHASE_CONTROL = 0x0400, + PRODUCT_DETAIL_REVERSE_PHASE_CONTROL = 0x0401, + PRODUCT_DETAIL_SINE = 0x0402, + PRODUCT_DETAIL_PWM = 0x0403, + PRODUCT_DETAIL_DC = 0x0404, + PRODUCT_DETAIL_HFBALLAST = 0x0405, + PRODUCT_DETAIL_HFHV_NEONBALLAST = 0x0406, + PRODUCT_DETAIL_HFHV_EL = 0x0407, + PRODUCT_DETAIL_MHR_BALLAST = 0x0408, + PRODUCT_DETAIL_BITANGLE_MODULATION = 0x0409, + PRODUCT_DETAIL_FREQUENCY_MODULATION = 0x040A, + PRODUCT_DETAIL_HIGHFREQUENCY_12V = 0x040B, + PRODUCT_DETAIL_RELAY_MECHANICAL = 0x040C, + PRODUCT_DETAIL_RELAY_ELECTRONIC = 0x040D, + PRODUCT_DETAIL_SWITCH_ELECTRONIC = 0x040E, + PRODUCT_DETAIL_CONTACTOR = 0x040F, + PRODUCT_DETAIL_MIRRORBALL_ROTATOR = 0x0500, + PRODUCT_DETAIL_OTHER_ROTATOR = 0x0501, + PRODUCT_DETAIL_KABUKI_DROP = 0x0502, + PRODUCT_DETAIL_CURTAIN = 0x0503, + PRODUCT_DETAIL_LINESET = 0x0504, + PRODUCT_DETAIL_MOTOR_CONTROL = 0x0505, + PRODUCT_DETAIL_DAMPER_CONTROL = 0x0506, + PRODUCT_DETAIL_SPLITTER = 0x0600, + PRODUCT_DETAIL_ETHERNET_NODE = 0x0601, + PRODUCT_DETAIL_MERGE = 0x0602, + PRODUCT_DETAIL_DATAPATCH = 0x0603, + PRODUCT_DETAIL_WIRELESS_LINK = 0x0604, + PRODUCT_DETAIL_PROTOCOL_CONVERTOR = 0x0701, + PRODUCT_DETAIL_ANALOG_DEMULTIPLEX = 0x0702, + PRODUCT_DETAIL_ANALOG_MULTIPLEX = 0x0703, + PRODUCT_DETAIL_SWITCH_PANEL = 0x0704, + PRODUCT_DETAIL_ROUTER = 0x0800, + PRODUCT_DETAIL_FADER = 0x0801, + PRODUCT_DETAIL_MIXER = 0x0802, + PRODUCT_DETAIL_CHANGEOVER_MANUAL = 0x0900, + PRODUCT_DETAIL_CHANGEOVER_AUTO = 0x0901, + PRODUCT_DETAIL_TEST = 0x0902, + PRODUCT_DETAIL_GFI_RCD = 0x0A00, + PRODUCT_DETAIL_BATTERY = 0x0A01, + PRODUCT_DETAIL_CONTROLLABLE_BREAKER = 0x0A02, + PRODUCT_DETAIL_OTHER = 0x7FFF, +} rdm_product_detail; + + +// slot types +typedef enum { + ST_PRIMARY = 0x00, + ST_SEC_FINE = 0x01, + ST_SEC_TIMING = 0x02, + ST_SEC_SPEED = 0x03, + ST_SEC_CONTROL = 0x04, + ST_SEC_INDEX = 0x05, + ST_SEC_ROTATION = 0x06, + ST_SEC_INDEX_ROTATE = 0x07, + ST_SEC_UNDEFINED = 0xFF, +} rdm_slot_type; + + +// slot definitions +typedef enum { + SD_INTENSITY = 0x0001, + SD_INTENSITY_MASTER = 0x0002, + SD_PAN = 0x0101, + SD_TILT = 0x0102, + SD_COLOR_WHEEL = 0x0201, + SD_COLOR_SUB_CYAN = 0x0202, + SD_COLOR_SUB_YELLOW = 0x0203, + SD_COLOR_SUB_MAGENTA = 0x0204, + SD_COLOR_ADD_RED = 0x0205, + SD_COLOR_ADD_GREEN = 0x0206, + SD_COLOR_ADD_BLUE = 0x0207, + SD_COLOR_CORRECTION = 0x0208, + SD_COLOR_SCROLL = 0x0209, + SD_COLOR_SEMAPHORE = 0x0210, + SD_STATIC_GOBO_WHEEL = 0x0301, + SD_ROTO_GOBO_WHEEL = 0x0302, + SD_PRISM_WHEEL = 0x0303, + SD_EFFECTS_WHEEL = 0x0304, + SD_BEAM_SIZE_IRIS = 0x0401, + SD_EDGE = 0x0402, + SD_FROST = 0x0403, + SD_STROBE = 0x0404, + SD_ZOOM = 0x0405, + SD_FRAMING_SHUTTER = 0x0406, + SD_SHUTTER_ROTATE = 0x0407, + SD_DOUSER = 0x0408, + SD_BARN_DOOR = 0x0409, + SD_LAMP_CONTROL = 0x0501, + SD_FIXTURE_CONTROL = 0x0502, + SD_FIXTURE_SPEED = 0x0503, + SD_MACRO = 0x0504, + SD_UNDEFINED = 0xFFFF, +} rdm_slot_definition; + + +typedef enum { + STS_CAL_FAIL = 0x0001, + STS_SENS_NOT_FOUND = 0x0002, + STS_SENS_ALWAYS_ON = 0x0003, + STS_LAMP_DOUSED = 0x0011, + STS_LAMP_STRIKE = 0x0012, + STS_OVERTEMP = 0x0021, + STS_UNDERTEMP = 0x0022, + STS_SENS_OUT_RANGE = 0x0023, + STS_OVERVOLTAGE_PHASE = 0x0031, + STS_UNDERVOLTAGE_PHASE = 0x0032, + STS_OVERCURRENT = 0x0033, + STS_UNDERCURRENT = 0x0034, + STS_PHASE = 0x0035, + STS_PHASE_ERROR = 0x0036, + STS_AMPS = 0x0037, + STS_VOLTS = 0x0038, + STS_DIMSLOT_OCCUPIED = 0x0041, + STS_BREAKER_TRIP = 0x0042, + STS_WATTS = 0x0043, + STS_DIM_FAILURE = 0x0044, + STS_DIM_PANIC = 0x0045, + STS_READY = 0x0050, + STS_NOT_READY = 0x0051, + STS_LOW_FLUID = 0x0052, +} rdm_status_message_id; + + +typedef enum { + LAMP_OFF = 0x00, + LAMP_ON = 0x01, + LAMP_STRIKE = 0x02, + LAMP_STANDBY = 0x03, + LAMP_NOT_PRESENT = 0x04, + LAMP_ERROR = 0x7F, +} rdm_lamp_state; + +typedef enum { + LAMP_ON_MODE_OFF = 0x00, + LAMP_ON_MODE_DMX = 0x01, + LAMP_ON_MODE_ON = 0x02, + LAMP_ON_MODE_AFTER_CAL = 0x03, +} rdm_lamp_mode; + + +typedef enum { + POWER_STATE_FULL_OFF = 0x00, + POWER_STATE_SHUTDOWN = 0x01, + POWER_STATE_STANDBY = 0x02, + POWER_STATE_NORMAL = 0xFF, +} rdm_power_state; + +typedef enum { + DISPLAY_INVERT_OFF = 0x00, + DISPLAY_INVERT_ON = 0x01, + DISPLAY_INVERT_AUTO = 0x02, +} rdm_display_invert; + +// the two special presets +static const uint16_t PRESET_PLAYBACK_OFF = 0x0000; +static const uint16_t PRESET_PLAYBACK_ALL = 0xffff; + +// bit masks for sensor values +static const uint8_t SENSOR_RECORDED_VALUE = 0x01; +static const uint8_t SENSOR_RECORDED_RANGE_VALUES = 0x02; +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_RDMENUMS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMHelper.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMHelper.h new file mode 100644 index 0000000..7bd662f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/RDMHelper.h @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * RDMHelper.h + * Various misc RDM functions. + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_RDMHELPER_H_ +#define INCLUDE_OLA_RDM_RDMHELPER_H_ + +#include +#include +#include + +namespace ola { +namespace rdm { + +using std::string; + +string DataTypeToString(uint8_t type); +string LampModeToString(uint8_t lamp_mode); +string LampStateToString(uint8_t lamp_state); +string NackReasonToString(uint16_t reason); +string PowerStateToString(uint8_t power_state); +bool UIntToPowerState(uint8_t state, rdm_power_state *power_state); +string PrefixToString(uint8_t prefix); +string ProductCategoryToString(uint16_t category); +string ProductDetailToString(uint16_t detail); +string SensorTypeToString(uint8_t type); +string SlotInfoToString(uint8_t slot_type, uint16_t slot_label); +string StatusMessageIdToString(uint16_t message_id); +string StatusTypeToString(uint8_t status_type); +string UnitToString(uint8_t unit); +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_RDMHELPER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UID.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UID.h new file mode 100644 index 0000000..3e67953 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UID.h @@ -0,0 +1,159 @@ +/* + * 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 Library 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. + * + * UID.h + * Representation of an RDM UID + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_UID_H_ +#define INCLUDE_OLA_RDM_UID_H_ + +#include +#include +#include +#include +#include +#include + +namespace ola { +namespace rdm { + +using std::ostream; + + +/* + * Represents a RDM UID. + */ +class UID { + public: + UID(uint16_t esta_id, uint32_t device_id) { + m_uid.esta_id = esta_id; + m_uid.device_id = device_id; + } + + UID& operator=(const UID& other) { + if (this != &other) { + m_uid.esta_id = other.m_uid.esta_id; + m_uid.device_id = other.m_uid.device_id; + } + return *this; + } + + explicit UID(const uint8_t *data) { + m_uid.esta_id = (data[0] << 8) + data[1]; + m_uid.device_id = ((data[2] << 24) + (data[3] << 16) + (data[4] << 8) + + data[5]); + } + + bool operator==(const UID &other) const { + return 0 == cmp(*this, other); + } + + bool operator!=(const UID &other) const { + return 0 != cmp(*this, other); + } + + bool operator>(const UID &other) const { + return cmp(*this, other) > 0; + } + + bool operator<(const UID &other) const { + return cmp(*this, other) < 0; + } + + uint16_t ManufacturerId() const { return m_uid.esta_id; } + + uint32_t DeviceId() const { return m_uid.device_id; } + + bool IsBroadcast() const { return m_uid.device_id == ALL_DEVICES; } + + std::string ToString() const { + std::stringstream str; + str << std::setfill('0') << std::setw(4) << std::hex << m_uid.esta_id + << ":" << std::setw(8) << m_uid.device_id; + return str.str(); + } + + friend ostream& operator<< (ostream &out, const UID &uid) { + return out << uid.ToString(); + } + + bool Pack(uint8_t *buffer, unsigned int length) const { + if (length < UID_SIZE) + return false; + buffer[0] = m_uid.esta_id >> 8; + buffer[1] = m_uid.esta_id & 0xff; + buffer[2] = m_uid.device_id >> 24; + buffer[3] = m_uid.device_id >> 16; + buffer[4] = m_uid.device_id >> 8; + buffer[5] = m_uid.device_id & 0xff; + return true; + } + + static UID AllDevices() { + UID uid(ALL_MANUFACTURERS, ALL_DEVICES); + return uid; + } + + static UID AllManufactureDevices(uint16_t esta_id) { + UID uid(esta_id, ALL_DEVICES); + return uid; + } + + static UID* FromString(const string &uid) { + std::vector tokens; + ola::StringSplit(uid, tokens, ":"); + + if (tokens.size() != 2 || tokens[0].size() != 4 || tokens[1].size() != 8) + return NULL; + + unsigned int esta_id, device_id; + if (!ola::HexStringToUInt(tokens[0], &esta_id)) + return NULL; + if (!ola::HexStringToUInt(tokens[1], &device_id)) + return NULL; + + return new UID(esta_id, device_id); + } + + enum { UID_SIZE = 6 }; + + static const uint16_t ALL_MANUFACTURERS = 0xffff; + static const uint32_t ALL_DEVICES = 0xffffffff; + + private: + struct rdm_uid { + uint16_t esta_id; + uint32_t device_id; + }; + + struct rdm_uid m_uid; + + int cmp(const UID &a, const UID &b) const { + if (a.m_uid.esta_id == b.m_uid.esta_id) + return cmp(a.m_uid.device_id, b.m_uid.device_id); + return cmp(a.m_uid.esta_id, b.m_uid.esta_id); + } + + int cmp(int a, int b) const { + if (a == b) + return 0; + return a < b ? -1 : 1; + } +}; +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_UID_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UIDSet.h b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UIDSet.h new file mode 100644 index 0000000..27fccdb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/rdm/UIDSet.h @@ -0,0 +1,130 @@ +/* + * 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 Library 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. + * + * UIDSet.h + * A Set of UIDs + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_RDM_UIDSET_H_ +#define INCLUDE_OLA_RDM_UIDSET_H_ + +#include +#include +#include +#include +#include + +namespace ola { +namespace rdm { + +using std::ostream; +using std::set; + + +/* + * Represents a set of RDM UIDs. + */ +class UIDSet { + public: + + typedef set::const_iterator Iterator; + + UIDSet() { + } + + UIDSet(const UIDSet &other): + m_uids(other.m_uids) { + } + + UIDSet& operator=(const UIDSet &other) { + if (this != &other) { + m_uids = other.m_uids; + } + return *this; + } + + // Number of UIDs in the set + unsigned int Size() const { + return m_uids.size(); + } + + // Add this UID to the set + void AddUID(const UID &uid) { + m_uids.insert(uid); + } + + // Remove this UID from the set + void RemoveUID(const UID &uid) { + m_uids.erase(uid); + } + + // Return true if the set contains this UID + bool Contains(const UID &uid) const { + return m_uids.find(uid) != m_uids.end(); + } + + Iterator Begin() const { + return m_uids.begin(); + } + + Iterator End() const { + return m_uids.end(); + } + + // Return the UIDs in this set that don't exist in other + UIDSet SetDifference(const UIDSet &other) { + set difference; + std::set_difference(m_uids.begin(), + m_uids.end(), + other.m_uids.begin(), + other.m_uids.end(), + std::inserter(difference, difference.begin())); + return UIDSet(difference); + } + + bool operator==(const UIDSet &other) const { + return m_uids == other.m_uids; + } + + bool operator!=(const UIDSet &other) const { + return !(*this == other); + } + + std::string ToString() const { + std::stringstream str; + set::const_iterator iter; + for (iter = m_uids.begin(); iter != m_uids.end(); ++iter) { + if (iter != m_uids.begin()) + str << ","; + str << *iter; + } + return str.str(); + } + + friend ostream& operator<< (ostream &out, const UIDSet &uid_set) { + return out << uid_set.ToString(); + } + + private: + set m_uids; + + explicit UIDSet(const set uids) { + m_uids = uids; + } +}; +} // rdm +} // ola +#endif // INCLUDE_OLA_RDM_UIDSET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/web/JsonSections.h b/open-lighting-architecture/ola-0.8.4/include/ola/web/JsonSections.h new file mode 100644 index 0000000..d9c540f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/web/JsonSections.h @@ -0,0 +1,208 @@ +/* + * 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 Library 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. + * + * JsonSections.h + * This builds the json string for the web UI. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLA_WEB_JSONSECTIONS_H_ +#define INCLUDE_OLA_WEB_JSONSECTIONS_H_ + +#include +#include +#include + +#include "ola/StringUtils.h" + +namespace ola { +namespace web { + +using std::string; + +/** + * This is the base item class. Items are composed into sections. + * Each item has the following: + * - A text description + * - A type, which controls how the item is renders + * - The value. + * - Optional id. A non-empty id makes this item editable + * - Optional button text. Non-empty means this item get's it own button. + */ +class GenericItem { + public: + GenericItem(const string &description, const string &id): + m_description(description), + m_id(id), + m_button_text("") { + } + virtual ~GenericItem() {} + + // Sets the text for the button associated + void SetButtonText(const string &text) { + m_button_text = text; + } + + string AsString() const; + protected: + virtual string ExtraProperties() const { return ""; } + virtual string Type() const = 0; + virtual string Value() const = 0; + + private: + string m_description; + string m_id; + string m_button_text; +}; + + +/* + * This is a item that contains a string value + */ +class StringItem: public GenericItem { + public: + StringItem(const string &description, + const string &value, + const string &id = ""): + GenericItem(description, id), + m_value(value) { + } + + protected: + string Type() const { return "string"; } + string Value() const; + + private: + string m_value; +}; + + +/* + * An item that contains a unsigned int + */ +class UIntItem: public GenericItem { + public: + UIntItem(const string &description, + unsigned int value, + const string &id = ""): + GenericItem(description, id), + m_value(value), + m_min_set(false), + m_max_set(false) { + } + + void SetMin(unsigned int min) { + m_min_set = true; + m_min = min; + } + void SetMax(unsigned int max) { + m_max_set = true; + m_max = max; + } + + protected: + string ExtraProperties() const; + string Type() const { return "uint"; } + string Value() const { return ola::IntToString(m_value); } + + private: + unsigned int m_value; + bool m_min_set, m_max_set; + unsigned int m_min; + unsigned int m_max; +}; + + +class BoolItem: public GenericItem { + public: + BoolItem(const string &description, + bool value, + const string &id): + GenericItem(description, id), + m_value(value) { + } + + protected: + string Type() const { return "bool"; } + string Value() const; + + private: + bool m_value; +}; + + +class HiddenItem: public GenericItem { + public: + HiddenItem(const string &value, const string &id): + GenericItem("", id), + m_value(value) { + } + + protected: + string Type() const { return "hidden"; } + string Value() const; + + private: + string m_value; +}; + + +/* + * An item which is a select list + */ +class SelectItem: public GenericItem { + public: + SelectItem(const string &description, + const string &id = ""): + GenericItem(description, id), + m_selected_offset(0) { + } + + void SetSelectedOffset(unsigned int offset) { m_selected_offset = offset; } + void AddItem(const string &label, const string &value); + // helper method which converts ints to strings + void AddItem(const string &label, unsigned int value); + + protected: + string ExtraProperties() const; + string Type() const { return "select"; } + string Value() const; + + private: + std::vector > m_values; + unsigned int m_selected_offset; +}; + + +class JsonSection { + public: + explicit JsonSection(bool allow_refresh = true); + ~JsonSection(); + + void SetSaveButton(const string &text) { m_save_button_text = text; } + void SetError(const string &error) { m_error = error; } + + void AddItem(const GenericItem *item); + string AsString() const; + + private: + bool m_allow_refresh; + string m_error; + string m_save_button_text; + std::vector m_items; +}; +} // web +} // ola +#endif // INCLUDE_OLA_WEB_JSONSECTIONS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.am new file mode 100644 index 0000000..0c6f6d4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.am @@ -0,0 +1,5 @@ +SOURCES = JsonSections.h + +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +pkgincludedir = $(includedir)/ola/web/ diff --git a/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.in new file mode 100644 index 0000000..0d98f18 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/ola/web/Makefile.in @@ -0,0 +1,427 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/ola/web +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/web/ +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +SOURCES = JsonSections.h +EXTRA_DIST = $(SOURCES) +pkginclude_HEADERS = $(SOURCES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/ola/web/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/ola/web/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/ola-0.8.4/include/olad/Device.h b/open-lighting-architecture/ola-0.8.4/include/olad/Device.h new file mode 100644 index 0000000..fbb5942 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Device.h @@ -0,0 +1,163 @@ +/* + * 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 Library 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. + * + * Device.h + * Header file for the Device class + * Copyright (C) 2005 Simon Newton + */ + +#ifndef INCLUDE_OLAD_DEVICE_H_ +#define INCLUDE_OLAD_DEVICE_H_ + +#include +#include +#include +#include +#include + +namespace google { +namespace protobuf { + class Closure; + class RpcController; +} +} + +namespace ola { + +class AbstractPlugin; + +using std::map; +using std::pair; +using std::string; +using std::vector; + +/* + * The interface for a Device + */ +class AbstractDevice { + public: + AbstractDevice() {} + virtual ~AbstractDevice() {} + + // return the name of this device + virtual const string Name() const = 0; + // return the plugin that owns this device + virtual AbstractPlugin *Owner() const = 0; + + // return the a unique id of this device, this is guaranteed to be unique + // and persist across restarts. + virtual string UniqueId() const = 0; + + // stop the device + virtual bool Stop() = 0; + + // allow input and output ports to be patched to the same univese + virtual bool AllowLooping() const = 0; + + // allow multiple ports of the same type to be patched to the same + // universe. + virtual bool AllowMultiPortPatching() const = 0; + + // Fetch a list of all ports in this device + virtual void InputPorts(vector *ports) const = 0; + virtual void OutputPorts(vector *ports) const = 0; + + // Lookup a particular port in this device + virtual InputPort *GetInputPort(unsigned int port_id) const = 0; + virtual OutputPort *GetOutputPort(unsigned int port_id) const = 0; + + // configure this device + virtual void Configure(google::protobuf::RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done) = 0; +}; + + +/* + * A partial implementation of a Device. + */ +class Device: public AbstractDevice { + public: + Device(AbstractPlugin *owner, const string &name); + virtual ~Device(); + + const string Name() const { return m_name; } + void SetName(const string &name) { m_name = name; } + + AbstractPlugin *Owner() const { return m_owner; } + string UniqueId() const; + + // Returns an id which is unique within the plugin + virtual string DeviceId() const = 0; + + bool IsEnabled() const { return m_enabled; } + + bool Start(); + bool Stop(); + + // sane defaults + bool AllowLooping() const { return false; } + bool AllowMultiPortPatching() const { return false; } + + bool AddPort(InputPort *port); + bool AddPort(OutputPort *port); + void InputPorts(vector *ports) const; + void OutputPorts(vector *ports) const; + + InputPort *GetInputPort(unsigned int port_id) const; + OutputPort *GetOutputPort(unsigned int port_id) const; + + // Free all ports + void DeleteAllPorts(); + + // Handle a Configure request + virtual void Configure(class google::protobuf::RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done); + protected: + virtual bool StartHook() { return true; } + virtual void PrePortStop() {} + virtual void PostPortStop() {} + + private: + typedef map input_port_map; + typedef map output_port_map; + + bool m_enabled; + AbstractPlugin *m_owner; // which plugin owns this device + string m_name; // device name + mutable string m_unique_id; // device id + input_port_map m_input_ports; + output_port_map m_output_ports; + + Device(const Device&); + Device& operator=(const Device&); + + template + bool GenericAddPort(PortClass *port, + map *ports); + + template + void GenericFetchPortsVector( + vector *ports, + const map &port_map) const; + + template + void GenericDeletePort(PortClass *p); +}; +} // ola +#endif // INCLUDE_OLAD_DEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/DmxSource.h b/open-lighting-architecture/ola-0.8.4/include/olad/DmxSource.h new file mode 100644 index 0000000..cae4b2d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/DmxSource.h @@ -0,0 +1,138 @@ +/* + * 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 Library 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. + * + * DmxSource.h + * Interface for the DmxSource class. + * A DmxSource contains a DmxSource as well as a priority & timestamp. + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLAD_DMXSOURCE_H_ +#define INCLUDE_OLAD_DMXSOURCE_H_ + +#include +#include +#include + +namespace ola { + + +/* + * The DmxSource class + */ +class DmxSource { + public: + DmxSource(): + m_buffer(), + m_timestamp(), + m_priority(PRIORITY_MIN) { + } + + DmxSource(const DmxBuffer &buffer, + const TimeStamp ×tamp, + uint8_t priority): + m_buffer(buffer), + m_timestamp(timestamp), + m_priority(priority) { + } + + DmxSource(const DmxSource &other) { + m_buffer = other.m_buffer; + m_timestamp = other.m_timestamp; + m_priority = other.m_priority; + } + + + /* + * Assignment operator + */ + DmxSource& operator=(const DmxSource& other) { + if (this != &other) { + m_buffer = other.m_buffer; + m_timestamp = other.m_timestamp; + m_priority = other.m_priority; + } + return *this; + } + + + /* + * Equality check + */ + bool operator==(const DmxSource &other) const { + return (m_buffer == other.m_buffer && + m_timestamp == other.m_timestamp && + m_priority == other.m_priority); + } + + + /* + * Update the DmxSource with new data + */ + void UpdateData(const DmxBuffer &buffer, const TimeStamp ×tamp, + uint8_t priority) { + m_buffer = buffer; + m_timestamp = timestamp; + m_priority = priority; + } + + + /* + * Get the DmxBuffer in this source + */ + const DmxBuffer &Data() const { return m_buffer; } + + + /* + * Get the timestamp + */ + const TimeStamp &Timestamp() const { return m_timestamp; } + + + /* + * Check if this source has timed out + */ + bool IsActive(const TimeStamp &now) const { + TimeStamp timeout = m_timestamp + TIMEOUT_INTERVAL; + return now < timeout; + } + + + /* + * Check if this source has ever got data + */ + bool IsSet() const { + return m_timestamp.IsSet(); + } + + + /* + * Get the priority for this source + */ + uint8_t Priority() const { return m_priority; } + + static const uint8_t PRIORITY_MIN; + static const uint8_t PRIORITY_MAX; + static const uint8_t PRIORITY_DEFAULT; + + private: + DmxBuffer m_buffer; + TimeStamp m_timestamp; + uint8_t m_priority; + + static const TimeInterval TIMEOUT_INTERVAL; +}; +} // ola +#endif // INCLUDE_OLAD_DMXSOURCE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.am b/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.am new file mode 100644 index 0000000..6ba4a4f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.am @@ -0,0 +1,7 @@ +OLAD_INCLUDES = Device.h DmxSource.h PluginAdaptor.h Plugin.h \ + Port.h PortConstants.h PortDecorators.h Preferences.h \ + TokenBucket.h Universe.h + +EXTRA_DIST = $(OLAD_INCLUDES) +pkginclude_HEADERS = $(OLAD_INCLUDES) +pkgincludedir = $(includedir)/olad diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.in b/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.in new file mode 100644 index 0000000..7b2c146 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Makefile.in @@ -0,0 +1,431 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = include/olad +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgincludedir)" +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/olad +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +OLAD_INCLUDES = Device.h DmxSource.h PluginAdaptor.h Plugin.h \ + Port.h PortConstants.h PortDecorators.h Preferences.h \ + TokenBucket.h Universe.h + +EXTRA_DIST = $(OLAD_INCLUDES) +pkginclude_HEADERS = $(OLAD_INCLUDES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/olad/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/olad/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgincludeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/ola-0.8.4/include/olad/Plugin.h b/open-lighting-architecture/ola-0.8.4/include/olad/Plugin.h new file mode 100644 index 0000000..10a3009 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Plugin.h @@ -0,0 +1,109 @@ +/* + * 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 Library 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. + * + * Plugin.h + * Header file for plugin class - plugins inherit from this. + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PLUGIN_H_ +#define INCLUDE_OLAD_PLUGIN_H_ + +#include +#include +#include // NOLINT + +namespace ola { + +using std::string; +class PluginAdaptor; + +/* + * The interface for a plugin + */ +class AbstractPlugin { + public : + AbstractPlugin() {} + virtual ~AbstractPlugin() {} + + // true if we should try to start this plugin + virtual bool ShouldStart() = 0; + // start the plugin + virtual bool Start() = 0; + // stop the plugin + virtual bool Stop() = 0; + // return the plugin_id of this plugin + virtual ola_plugin_id Id() const = 0; + // return the name of this plugin + virtual string Name() const = 0; + // return the description of this plugin + virtual string Description() const = 0; + + // used to sort plugins + virtual bool operator<(const AbstractPlugin &other) const = 0; +}; + + +struct PluginLessThan: public std::binary_function { + bool operator()(AbstractPlugin *x, AbstractPlugin *y) { + return x->Id() < y->Id(); + } +}; + + +class Plugin: public AbstractPlugin { + public : + explicit Plugin(const PluginAdaptor *plugin_adaptor): + AbstractPlugin(), + m_plugin_adaptor(plugin_adaptor), + m_preferences(NULL), + m_enabled(false) { + } + virtual ~Plugin() {} + + virtual bool ShouldStart(); + virtual bool Start(); + virtual bool Stop(); + virtual ola_plugin_id Id() const = 0; + + // return the prefix used to identify this plugin + virtual string PluginPrefix() const = 0; + + bool operator<(const AbstractPlugin &other) const { + return Id() < other.Id(); + } + + protected: + virtual bool StartHook() { return 0; } + virtual bool StopHook() { return 0; } + virtual bool SetDefaultPreferences() { return true; } + + const PluginAdaptor *m_plugin_adaptor; + class Preferences *m_preferences; // preferences container + static const char ENABLED_KEY[]; + + private: + bool m_enabled; // are we running + bool LoadPreferences(); + Plugin(const Plugin&); + Plugin& operator=(const Plugin&); +}; +} // ola + +// interface functions +typedef ola::AbstractPlugin* create_t(const ola::PluginAdaptor *plugin_adaptor); + +#endif // INCLUDE_OLAD_PLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/PluginAdaptor.h b/open-lighting-architecture/ola-0.8.4/include/olad/PluginAdaptor.h new file mode 100644 index 0000000..119cf60 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/PluginAdaptor.h @@ -0,0 +1,79 @@ +/* + * 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 Library 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. + * + * PluginAdaptor.h + * The provides operations on a ola_device. + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PLUGINADAPTOR_H_ +#define INCLUDE_OLAD_PLUGINADAPTOR_H_ + +#include +#include +#include // NOLINT +#include // NOLINT +#include // NOLINT + +namespace ola { + +namespace network { + class Socket; + class ConnectedSocket; + class SocketManager; +} + + +using std::string; +using ola::network::Socket; +using ola::network::ConnectedSocket; +using ola::network::SocketManager; +using ola::network::SelectServer; +using ola::network::timeout_id; + +class PluginAdaptor { + public : + PluginAdaptor(class DeviceManager *device_manager, + SelectServer *select_server, + class PreferencesFactory *preferences_factory); + + bool AddSocket(class Socket *socket) const; + bool AddSocket(class ConnectedSocket *socket, + bool delete_on_close = false) const; + bool RemoveSocket(class Socket *socket) const; + bool RemoveSocket(class ConnectedSocket *socket) const; + timeout_id RegisterRepeatingTimeout(unsigned int ms, + Closure *closure) const; + timeout_id RegisterSingleTimeout(unsigned int ms, + SingleUseClosure *closure) const; + void RemoveTimeout(timeout_id id) const; + + bool RegisterDevice(class AbstractDevice *device) const; + bool UnregisterDevice(class AbstractDevice *device) const; + + class Preferences *NewPreference(const string &name) const; + + const TimeStamp *WakeUpTime() const; + + private: + PluginAdaptor(const PluginAdaptor&); + PluginAdaptor& operator=(const PluginAdaptor&); + + DeviceManager *m_device_manager; + class ola::network::SelectServer *m_ss; + class PreferencesFactory *m_preferences_factory; +}; +} // ola +#endif // INCLUDE_OLAD_PLUGINADAPTOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/Port.h b/open-lighting-architecture/ola-0.8.4/include/olad/Port.h new file mode 100644 index 0000000..4821ee7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Port.h @@ -0,0 +1,349 @@ +/* + * 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 Library 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. + * + * Port.h + * Header file for the Port classes + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PORT_H_ +#define INCLUDE_OLAD_PORT_H_ + +#include +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT + +namespace ola { + +class AbstractDevice; + +/* + * The base port class, all ports inherit from this. + */ +class Port { + public: + virtual ~Port() {} + + // return the id of the port within this deivce + virtual unsigned int PortId() const = 0; + + // Return the device which owns this port + virtual AbstractDevice *GetDevice() const = 0; + + // return a short description of this port + virtual string Description() const = 0; + + // bind this port to a universe + virtual bool SetUniverse(Universe *universe) = 0; + + // return the universe that this port is bound to or NULL + virtual Universe *GetUniverse() const = 0; + + // Return a globally unique id of this port. This is used to preserve port + // universe bindings. An empty string means we don't preserve settings. + virtual string UniqueId() const = 0; + + // this tells us what sort of priority capabilities this port has + virtual port_priority_capability PriorityCapability() const = 0; + + virtual bool SetPriority(uint8_t priority) = 0; + virtual uint8_t GetPriority() const = 0; + + virtual void SetPriorityMode(port_priority_mode mode) = 0; + virtual port_priority_mode GetPriorityMode() const = 0; +}; + + +/* + * The Input Port interface, for ports that provide push data into the OLA + * system. + */ +class InputPort: public Port { + public: + virtual ~InputPort() {} + + // signal the port that the DMX data has changed + virtual void DmxChanged() = 0; + + // Get the current data + virtual const DmxSource &SourceData() const = 0; + + // Handle RDMRequests, ownership of the request object is transferred + virtual bool HandleRDMRequest(const ola::rdm::RDMRequest *request) = 0; + virtual bool HandleRDMResponse(const ola::rdm::RDMResponse *response) = 0; +}; + + +/* + * The Output Port interface, for ports that send data from the OLA system. + */ +class OutputPort: public Port { + public: + virtual ~OutputPort() {} + + // Write dmx data to this port + virtual bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) = 0; + + // Called if the universe name changes + virtual void UniverseNameChanged(const string &new_name) = 0; + + // Handle RDMRequests, ownership of the request object is transferred + virtual bool HandleRDMRequest(const ola::rdm::RDMRequest *request) = 0; + virtual bool HandleRDMResponse(const ola::rdm::RDMResponse *response) = 0; + virtual void RunRDMDiscovery() = 0; + virtual void NewUIDList(const ola::rdm::UIDSet &uids) = 0; +}; + + +/* + * A Implementation of InputPort, provides the basic functionality which saves + * the plugin implementations from having to do it. + */ +class BasicInputPort: public InputPort { + public: + BasicInputPort(AbstractDevice *parent, + unsigned int port_id, + const TimeStamp *wake_time); + + unsigned int PortId() const { return m_port_id; } + AbstractDevice *GetDevice() const { return m_device; } + bool SetUniverse(Universe *universe); + Universe *GetUniverse() const { return m_universe; } + virtual string UniqueId() const; + bool SetPriority(uint8_t priority); + uint8_t GetPriority() const { return m_priority; } + void SetPriorityMode(port_priority_mode mode) { m_priority_mode = mode; } + port_priority_mode GetPriorityMode() const { return m_priority_mode; } + void DmxChanged(); + const DmxSource &SourceData() const { return m_dmx_source; } + + // rdm methods, the child class provides HandleRDMResponse + bool HandleRDMRequest(const ola::rdm::RDMRequest *request); + virtual bool HandleRDMResponse(const ola::rdm::RDMResponse *response); + void TriggerRDMDiscovery(); + + port_priority_capability PriorityCapability() const { + return SupportsPriorities() ? CAPABILITY_FULL : CAPABILITY_STATIC; + } + + // subclasses override these + // Read the dmx data. + virtual const DmxBuffer &ReadDMX() const = 0; + + // Get the inherited priority + virtual uint8_t InheritedPriority() const { + return DmxSource::PRIORITY_MIN; + } + + // override this to cancel the SetUniverse operation. + virtual bool PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + return true; + } + + virtual void PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + } + + protected: + // indicates whether this port supports priorities, default to no + virtual bool SupportsPriorities() const { return false; } + + private: + const unsigned int m_port_id; + uint8_t m_priority; + port_priority_mode m_priority_mode; + mutable string m_port_string; + Universe *m_universe; // the universe this port belongs to + AbstractDevice *m_device; + DmxSource m_dmx_source; + const TimeStamp *m_wakeup_time; + + BasicInputPort(const BasicInputPort&); + BasicInputPort& operator=(const BasicInputPort&); +}; + + +/* + * An implementation of an OutputPort. + */ +class BasicOutputPort: public OutputPort { + public: + BasicOutputPort(AbstractDevice *parent, + unsigned int port_id, + bool start_rdm_discovery_on_patch = false); + + unsigned int PortId() const { return m_port_id; } + AbstractDevice *GetDevice() const { return m_device; } + bool SetUniverse(Universe *universe); + Universe *GetUniverse() const { return m_universe; } + string UniqueId() const; + bool SetPriority(uint8_t priority); + uint8_t GetPriority() const { return m_priority; } + void SetPriorityMode(port_priority_mode mode) { m_priority_mode = mode; } + port_priority_mode GetPriorityMode() const { return m_priority_mode; } + + // rdm methods, the child class provides HandleRDMRequest and + // RunRDMDiscovery + virtual bool HandleRDMRequest(const ola::rdm::RDMRequest *request); + // This is virtual so that we can override it in unittests + virtual bool HandleRDMResponse(const ola::rdm::RDMResponse *response); + virtual void RunRDMDiscovery(); + virtual void NewUIDList(const ola::rdm::UIDSet &uids); + + virtual void UniverseNameChanged(const string &new_name) { + (void) new_name; + } + + port_priority_capability PriorityCapability() const { + return SupportsPriorities() ? CAPABILITY_FULL : CAPABILITY_NONE; + } + + // Subclasses can override this to cancel the SetUniverse operation. + virtual bool PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + return true; + } + + virtual void PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + } + + protected: + // indicates whether this port supports priorities, default to no + virtual bool SupportsPriorities() const { return false; } + + private: + const unsigned int m_port_id; + const bool m_discover_on_patch; + uint8_t m_priority; + port_priority_mode m_priority_mode; + mutable string m_port_string; + Universe *m_universe; // the universe this port belongs to + AbstractDevice *m_device; + + BasicOutputPort(const BasicOutputPort&); + BasicOutputPort& operator=(const BasicOutputPort&); +}; + + +/* + * A Decorator for an Output Port. + */ +class OutputPortDecorator: public OutputPort { + public: + explicit OutputPortDecorator(OutputPort *port): + m_port(port) { + } + + ~OutputPortDecorator() { + delete m_port; + } + + virtual unsigned int PortId() const { + return m_port->PortId(); + } + + virtual AbstractDevice *GetDevice() const { + return m_port->GetDevice(); + } + + virtual string Description() const { + return m_port->Description(); + } + + virtual bool SetUniverse(Universe *universe) { + return m_port->SetUniverse(universe); + } + + virtual Universe *GetUniverse() const { + return m_port->GetUniverse(); + } + + virtual string UniqueId() const { + return m_port->UniqueId(); + } + + virtual port_priority_capability PriorityCapability() const { + return m_port->PriorityCapability(); + } + + virtual bool SetPriority(uint8_t priority) { + return m_port->SetPriority(priority); + } + + virtual uint8_t GetPriority() const { + return m_port->GetPriority(); + } + + virtual void SetPriorityMode(port_priority_mode mode) { + return m_port->SetPriorityMode(mode); + } + + virtual port_priority_mode GetPriorityMode() const { + return m_port->GetPriorityMode(); + } + + virtual bool HandleRDMRequest(const ola::rdm::RDMRequest *request) { + return m_port->HandleRDMRequest(request); + } + + virtual bool HandleRDMResponse(const ola::rdm::RDMResponse *response) { + return m_port->HandleRDMResponse(response); + } + + virtual void RunRDMDiscovery() { + return m_port->RunRDMDiscovery(); + } + + virtual void NewUIDList(const ola::rdm::UIDSet &uids) { + return m_port->NewUIDList(uids); + } + + virtual bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + return m_port->WriteDMX(buffer, priority); + } + + virtual void UniverseNameChanged(const string &new_name) { + return m_port->UniverseNameChanged(new_name); + } + + protected: + OutputPort *m_port; +}; + + +/* + * This allows switching based on Port type. + */ +template +bool IsInputPort(); + +template<> +bool IsInputPort(); +} // ola +#endif // INCLUDE_OLAD_PORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/PortConstants.h b/open-lighting-architecture/ola-0.8.4/include/olad/PortConstants.h new file mode 100644 index 0000000..d2d82be --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/PortConstants.h @@ -0,0 +1,37 @@ +/* + * 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 Library 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. + * + * PortConstants.h + * Header file for the Port Constants. + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PORTCONSTANTS_H_ +#define INCLUDE_OLAD_PORTCONSTANTS_H_ + +namespace ola { + typedef enum { + PRIORITY_MODE_INHERIT, + PRIORITY_MODE_OVERRIDE, + PRIORITY_MODE_END, + } port_priority_mode; + + typedef enum { + CAPABILITY_NONE, // port doesn't support priorities at all + CAPABILITY_STATIC, // port allows a static priority assignment + CAPABILITY_FULL, // port can either inherit or use a static assignment + } port_priority_capability; +} // ola +#endif // INCLUDE_OLAD_PORTCONSTANTS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/PortDecorators.h b/open-lighting-architecture/ola-0.8.4/include/olad/PortDecorators.h new file mode 100644 index 0000000..b8229bb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/PortDecorators.h @@ -0,0 +1,57 @@ +/* + * 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 Library 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. + * + * PortDecorators.h + * Header file for the Port Decorators classes + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PORTDECORATORS_H_ +#define INCLUDE_OLAD_PORTDECORATORS_H_ + +#include +#include +#include + +namespace ola { + +/* + * A Decorator for an Output Port that throttles the writes + */ +class ThrottledOutputPortDecorator: public OutputPortDecorator { + public: + explicit ThrottledOutputPortDecorator( + OutputPort *port, + const TimeStamp *wake_time, + unsigned int initial_count, + unsigned int rate): + OutputPortDecorator(port), + m_bucket(initial_count, rate, rate, *wake_time), + m_wake_time(wake_time) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + if (m_bucket.GetToken(*m_wake_time)) + return m_port->WriteDMX(buffer, priority); + else + OLA_INFO << "Port rated limited, dropping frame"; + return true; + } + + private: + TokenBucket m_bucket; + const TimeStamp *m_wake_time; +}; +} // ola +#endif // INCLUDE_OLAD_PORTDECORATORS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/Preferences.h b/open-lighting-architecture/ola-0.8.4/include/olad/Preferences.h new file mode 100644 index 0000000..2fd132d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Preferences.h @@ -0,0 +1,236 @@ +/* + * 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 Library 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. + * + * preferences.h + * Interface for the Preferences class - this allows storing user preferences / + * settings. + * Copyright (C) 2005-2006 Simon Newton + */ + +#ifndef INCLUDE_OLAD_PREFERENCES_H_ +#define INCLUDE_OLAD_PREFERENCES_H_ + +#include +#include +#include +#include + + +namespace ola { + +using std::map; +using std::multimap; +using std::set; +using std::string; +using std::vector; + +/* + * Checks the value of a variable + */ +class Validator { + public: + Validator() {} + virtual ~Validator() {} + + virtual bool IsValid(const string &value) const = 0; +}; + + +/* + * Check a value is a non-empty string + */ +class StringValidator: public Validator { + public: + StringValidator(): Validator() {} + bool IsValid(const string &value) const; +}; + + +/* + * Check that a value is one of a set of values + */ +class SetValidator: public Validator { + public: + explicit SetValidator(const set &values): + m_values(values) {} + bool IsValid(const string &value) const; + + private: + set m_values; +}; + + +/* + * Check that a value is a valid bool + */ +class BoolValidator: public Validator { + public: + BoolValidator(): Validator() {} + bool IsValid(const string &value) const; + + static const char TRUE[]; + static const char FALSE[]; +}; + + +/* + * Check that a value falls within a range + */ +class IntValidator: public Validator { + public: + IntValidator(unsigned int greater_than, unsigned int less_than): + m_gt(greater_than), + m_lt(less_than) {} + bool IsValid(const string &value) const; + + private: + unsigned int m_gt, m_lt; +}; + + +/* + * Check a IPv4 address is valid + */ +class IPv4Validator: public Validator { + public: + explicit IPv4Validator(bool empty_ok = true): + m_empty_ok(empty_ok) {} + + bool IsValid(const string &value) const; + private: + bool m_empty_ok; +}; + + +/* + * The abstract Preferences class + */ +class Preferences { + public: + explicit Preferences(const string name): m_preference_name(name) {} + virtual ~Preferences() {} + + virtual bool Load() = 0; + virtual bool Save() const = 0; + virtual void Clear() = 0; + + virtual void SetValue(const string &key, const string &value) = 0; + virtual void SetMultipleValue(const string &key, const string &value) = 0; + virtual bool SetDefaultValue(const string &key, + const Validator &validator, + const string &value) = 0; + + virtual string GetValue(const string &key) const = 0; + virtual vector GetMultipleValue(const string &key) const = 0; + + virtual void RemoveValue(const string &key) = 0; + + // bool helper methods + virtual bool GetValueAsBool(const string &key) const = 0; + virtual void SetValueAsBool(const string &key, bool value) = 0; + + protected: + string m_preference_name; + private: + Preferences(const Preferences&); + Preferences& operator=(const Preferences&); +}; + + +/* + * A PreferencesFactory creates preferences objects + */ +class PreferencesFactory { + public: + PreferencesFactory() {} + virtual ~PreferencesFactory(); + virtual Preferences *NewPreference(const string &name); + private: + virtual Preferences *Create(const string &name) = 0; + map m_preferences_map; +}; + + +/* + * MemoryPreferences just stores the preferences in memory. Useful for testing. + */ +class MemoryPreferences: public Preferences { + public: + explicit MemoryPreferences(const string name): Preferences(name) {} + virtual ~MemoryPreferences(); + virtual bool Load() { return true; } + virtual bool Save() const { return true; } + virtual void Clear(); + + virtual void SetValue(const string &key, const string &value); + virtual void SetMultipleValue(const string &key, const string &value); + virtual bool SetDefaultValue(const string &key, + const Validator &validator, + const string &value); + + virtual string GetValue(const string &key) const; + virtual vector GetMultipleValue(const string &key) const; + + virtual void RemoveValue(const string &key); + + // bool helper methods + virtual bool GetValueAsBool(const string &key) const; + virtual void SetValueAsBool(const string &key, bool value); + + bool operator==(const MemoryPreferences &other) { + return m_pref_map == other.m_pref_map; + } + + protected: + multimap m_pref_map; +}; + + +class MemoryPreferencesFactory: public PreferencesFactory { + private: + MemoryPreferences *Create(const string &name) { + return new MemoryPreferences(name); + } +}; + + +/* + * FilePreferences uses one file per namespace + */ +class FileBackedPreferences: public MemoryPreferences { + public: + explicit FileBackedPreferences(const string name) + : MemoryPreferences(name) {} + virtual bool Load(); + virtual bool Save() const; + bool LoadFromFile(const string &filename); + bool SaveToFile(const string &filename) const; + + private: + bool ChangeDir() const; + const string FileName() const; + static const char OLA_CONFIG_DIR[]; + static const char OLA_CONFIG_PREFIX[]; + static const char OLA_CONFIG_SUFFIX[]; +}; + +class FileBackedPreferencesFactory: public PreferencesFactory { + private: + FileBackedPreferences *Create(const string &name) { + return new FileBackedPreferences(name); + } +}; +} // ola +#endif // INCLUDE_OLAD_PREFERENCES_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/TokenBucket.h b/open-lighting-architecture/ola-0.8.4/include/olad/TokenBucket.h new file mode 100644 index 0000000..b3a4069 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/TokenBucket.h @@ -0,0 +1,53 @@ +/* + * 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 Library 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. + * + * TokenBucket.h + * Header file for the token bucket class + * Copyright (C) 2010 Simon Newton + */ + +#ifndef INCLUDE_OLAD_TOKENBUCKET_H_ +#define INCLUDE_OLAD_TOKENBUCKET_H_ + +#include "ola/Clock.h" + +namespace ola { + +class TokenBucket { + public: + TokenBucket(unsigned int initial, + unsigned int rate_per_second, + unsigned int max, + const TimeStamp &now): + m_count(initial), + m_rate(rate_per_second), + m_max(max), + m_last(now) { + } + + bool GetToken(const TimeStamp &now); + unsigned int Count(const TimeStamp &now); + + private: + unsigned int m_count; + unsigned int m_rate; + unsigned int m_max; + TimeStamp m_last; + + TokenBucket(const TokenBucket&); + TokenBucket& operator=(const TokenBucket&); +}; +} // ola +#endif // INCLUDE_OLAD_TOKENBUCKET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/include/olad/Universe.h b/open-lighting-architecture/ola-0.8.4/include/olad/Universe.h new file mode 100644 index 0000000..dc185a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/include/olad/Universe.h @@ -0,0 +1,165 @@ +/* + * 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 Library 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. + * + * Universe.h + * Header file for the Universe class, see Universe.cpp for details. + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef INCLUDE_OLAD_UNIVERSE_H_ +#define INCLUDE_OLAD_UNIVERSE_H_ + +#include +#include +#include +#include +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT +#include // NOLINT + +namespace ola { + +using std::set; +using ola::rdm::UID; + +class Client; +class InputPort; +class OutputPort; + +class Universe { + public: + enum merge_mode { + MERGE_HTP, + MERGE_LTP + }; + + Universe(unsigned int uid, class UniverseStore *store, + ExportMap *export_map); + ~Universe(); + + // Properties for this universe + string Name() const { return m_universe_name; } + unsigned int UniverseId() const { return m_universe_id; } + merge_mode MergeMode() const { return m_merge_mode; } + bool IsActive() const; + uint8_t ActivePriority() const { return m_active_priority; } + + // Used to adjust the properties + void SetName(const string &name); + void SetMergeMode(merge_mode merge_mode); + + // Each universe has a DMXBuffer + bool SetDMX(const DmxBuffer &buffer); + const DmxBuffer &GetDMX() const { return m_buffer; } + + // These are the ports we need to nofity when data changes + bool AddPort(InputPort *port); + bool AddPort(OutputPort *port); + bool RemovePort(InputPort *port); + bool RemovePort(OutputPort *port); + bool ContainsPort(InputPort *port) const; + bool ContainsPort(OutputPort *port) const; + unsigned int InputPortCount() const { return m_input_ports.size(); } + unsigned int OutputPortCount() const { return m_output_ports.size(); } + void InputPorts(vector *ports); + void OutputPorts(vector *ports); + + // Source clients are those that provide us with data + bool AddSourceClient(Client *client); + bool RemoveSourceClient(Client *client); + bool ContainsSourceClient(Client *client) const; + unsigned int SourceClientCount() const { return m_source_clients.size(); } + + // Sink clients are those that we need to send data + bool AddSinkClient(Client *client); + bool RemoveSinkClient(Client *client); + bool ContainsSinkClient(Client *client) const; + unsigned int SinkClientCount() const { return m_sink_clients.size(); } + + // These are called when new data arrives on a port/client + bool PortDataChanged(InputPort *port); + bool SourceClientDataChanged(Client *client); + + // RDM methods + bool HandleRDMRequest(InputPort *port, + const ola::rdm::RDMRequest *request); + bool HandleRDMResponse(OutputPort *port, + const ola::rdm::RDMResponse *response); + void RunRDMDiscovery(); + void GetUIDs(ola::rdm::UIDSet *uids) const; + unsigned int UIDCount() const; + void NewUIDList(const ola::rdm::UIDSet &uids, OutputPort *port); + + bool operator==(const Universe &other) { + return m_universe_id == other.UniverseId(); + } + + static const char K_FPS_VAR[]; + static const char K_MERGE_HTP_STR[]; + static const char K_MERGE_LTP_STR[]; + static const char K_UNIVERSE_INPUT_PORT_VAR[]; + static const char K_UNIVERSE_MODE_VAR[]; + static const char K_UNIVERSE_NAME_VAR[]; + static const char K_UNIVERSE_OUTPUT_PORT_VAR[]; + static const char K_UNIVERSE_RDM_REQUESTS[]; + static const char K_UNIVERSE_RDM_RESPONSES[]; + static const char K_UNIVERSE_SINK_CLIENTS_VAR[]; + static const char K_UNIVERSE_SOURCE_CLIENTS_VAR[]; + static const char K_UNIVERSE_UID_COUNT_VAR[]; + + private: + Universe(const Universe&); + Universe& operator=(const Universe&); + bool UpdateDependants(); + void UpdateName(); + void UpdateMode(); + bool RemoveClient(Client *client, bool is_source); + bool AddClient(Client *client, bool is_source); + void HTPMergeSources(const vector &sources); + bool MergeAll(const InputPort *port, const Client *client); + + string m_universe_name; + unsigned int m_universe_id; + string m_universe_id_str; + uint8_t m_active_priority; + enum merge_mode m_merge_mode; // merge mode + vector m_input_ports; + vector m_output_ports; + set m_sink_clients; // clients that require updates + set m_source_clients; // clients that provide data + class UniverseStore *m_universe_store; + DmxBuffer m_buffer; + ExportMap *m_export_map; + map m_input_uids; + map m_output_uids; + + template + bool GenericAddPort(PortClass *port, + vector *ports); + + template + bool GenericRemovePort(PortClass *port, + vector *ports, + map *uid_map); + + template + bool GenericContainsPort(PortClass *port, + const vector &ports) const; +}; +} // ola +#endif // INCLUDE_OLAD_UNIVERSE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/libola.pc.in b/open-lighting-architecture/ola-0.8.4/libola.pc.in new file mode 100644 index 0000000..824f4a5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/libola.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libola +Version: @VERSION@ +Description: Open Lighting Architecture Client +Requires: +Libs: -L${libdir} -lola -lolacommon -lprotobuf +Cflags: -I${includedir}/libola diff --git a/open-lighting-architecture/ola-0.8.4/libolaserver.pc.in b/open-lighting-architecture/ola-0.8.4/libolaserver.pc.in new file mode 100644 index 0000000..5f27322 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/libolaserver.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ + +Name: libolaserver +Version: @VERSION@ +Description: Open Lighting Architecture Server +Requires: +Libs: -L${libdir} -L${libdir}/olad -lola -lolacommon -lprotobuf @OLA_SERVER_LIBS@ diff --git a/open-lighting-architecture/ola-0.8.4/ola.spec b/open-lighting-architecture/ola-0.8.4/ola.spec new file mode 100644 index 0000000..191be43 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola.spec @@ -0,0 +1,101 @@ +%define name ola +%define version 0.3.1 +%define release %mkrel 1 + + +Name: %{name} +Version: %{version} +Release: %{release} +Summary: OLA - Open Lighting Architecture +Group: Other +License: GPL +URL: http://code.google.com/p/linux-lighting +# Other doc found at: +# http://www.opendmx.net/index.php/LLA_0.3 +# http://www.opendmx.net/index.php/LLA_on_Linux +Source0: %{name}/%{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildRequires: libmicrohttpd-devel >= 0.4.0, libcppunit-devel, protobuf-devel >= 2.1.0 +Requires: libmicrohttpd >= 0.4.0, libcppunit, protobuf >= 2.1.0 + +%description +The Open Lighting Architecture (OLA) consists of two parts, the daemon olad and the library, libola. + + +%package -n libola +Group: Other +Summary: OLA - Open Lighting Architecture + +%description -n libola +The OLA library + + +%package -n libola-devel +Group: Other +Summary: OLA - Open Lighting Architecture + +%description -n libola-devel +The OLA library headers + + +%prep +%setup -q -n %{name} + + +%build +%define _disable_ld_no_undefined 1 +export LDFLAGS="-Wl,-undefined -Wl,dynamic_lookup" +autoreconf -i +%configure +%make + +%check +%make check + + +%install +rm -rf %buildroot +%makeinstall DESTDIR=%buildroot + + +%clean +rm -rf %buildroot + + +%files +%defattr(-,root,root,-) +/usr/bin/olad +/usr/bin/olad_test + +%files -n libola +%defattr(-,root,root,-) +%{_libdir}/libola.so* +%{_libdir}/olad/*.so* +%{_libdir}/libola*.so* + +%files -n libola-devel +%defattr(-,root,root,-) +/usr/include/ +%{_libdir}/olad/libola*.a +%{_libdir}/olad/libola*.la +%{_libdir}/libola*.a +%{_libdir}/libola*.la +%{_libdir}/pkgconfig/libola*.pc + +%doc AUTHORS ChangeLog COPYING INSTALL NEWS README TODO + + +%changelog +* Thu Aug 27 2009 Kevin Deldycke 0.3.1.trunk.20090827-1mdv2009.1 +- Rename all project from lla to OLA +- Upgrade to the latest OLA 0.3.1 from the master branch of the git repository +- OLA now requires libmicrohttpd, libcppunit, protobuf and libctemplate +- Disable the --no-undefined option and make all undefined symbols weakly bound +- Add check step +- Rebuild RPM for Mandriva 2009.1 + +* Mon May 12 2008 Kevin Deldycke 0.2.3.200710210908-1mdv2008.1 +- Ported from Fedora Core 8 ( http://rpms.netmindz.net/FC8/SRPMS.netmindz/lla-0.2.3.200710210908-1.fc8.src.rpm ) to Mandriva 2008.1 + +* Sun Apr 29 2007 Will Tatam 0.1.3-1 +- Fist Build diff --git a/open-lighting-architecture/ola-0.8.4/ola/Makefile.am b/open-lighting-architecture/ola-0.8.4/ola/Makefile.am new file mode 100644 index 0000000..21ec6f3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/Makefile.am @@ -0,0 +1,48 @@ +include $(top_srcdir)/common.mk + +HEADER_FILES = OlaClient.h OlaCallbackClient.h OlaDevice.h \ + OlaClientWrapper.h StreamingClient.h common.h + +lib_LTLIBRARIES = libola.la +libola_la_SOURCES = OlaClient.cpp OlaCallbackClient.cpp OlaClientCore.cpp \ + OlaClientWrapper.cpp StreamingClient.cpp +libola_la_LDFLAGS = -version-info 1:1:0 +libola_la_LIBADD = $(top_builddir)/common/libolacommon.la + +pkgincludedir = $(includedir)/ola +pkginclude_HEADERS = $(HEADER_FILES) + +EXTRA_DIST = $(HEADER_FILES) OlaClientCore.h common-h.in + + +# Test Programs +TESTS = OlaClientTester +check_PROGRAMS = $(TESTS) +OlaClientTester_SOURCES = $(OLASERVER_SOURCES) OlaClientTester.cpp \ + StreamingClientTest.cpp +OlaClientTester_CXXFLAGS = $(CPPUNIT_CFLAGS) $(libusb_CFLAGS) +OlaClientTester_LDFLAGS = $(CPPUNIT_LIBS) -ldl -lprotobuf +OlaClientTester_LDADD = @LIBS@ ${PLUGIN_LIBS} \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la \ + ./libola.la + +## @end 1 +## @start 2 +# Regenerate common.h with config.status whenever common-h.in changes. +common.h: stamp-common + @: +stamp-common: $(srcdir)/common-h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=sic/common.h \ + $(SHELL) ./config.status + echo timestamp > $@ +## @end 2 + +# Don't distribute common.h, since it is build host dependent! +dist-hook: + rm -f $(distdir)/common.h + +install-exec-hook: + $(LN_S) -f $(includedir)/ola/OlaClientWrapper.h $(DESTDIR)$(includedir)/ola/SimpleClient.h + diff --git a/open-lighting-architecture/ola-0.8.4/ola/Makefile.in b/open-lighting-architecture/ola-0.8.4/ola/Makefile.in new file mode 100644 index 0000000..431349a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/Makefile.in @@ -0,0 +1,691 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/common.mk +TESTS = OlaClientTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = ola +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libola_la_DEPENDENCIES = $(top_builddir)/common/libolacommon.la +am_libola_la_OBJECTS = OlaClient.lo OlaCallbackClient.lo \ + OlaClientCore.lo OlaClientWrapper.lo StreamingClient.lo +libola_la_OBJECTS = $(am_libola_la_OBJECTS) +libola_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(libola_la_LDFLAGS) $(LDFLAGS) -o $@ +am__EXEEXT_1 = OlaClientTester$(EXEEXT) +am_OlaClientTester_OBJECTS = \ + OlaClientTester-OlaClientTester.$(OBJEXT) \ + OlaClientTester-StreamingClientTest.$(OBJEXT) +OlaClientTester_OBJECTS = $(am_OlaClientTester_OBJECTS) +am__DEPENDENCIES_1 = +OlaClientTester_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la ./libola.la +OlaClientTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) \ + $(OlaClientTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libola_la_SOURCES) $(OlaClientTester_SOURCES) +DIST_SOURCES = $(libola_la_SOURCES) $(OlaClientTester_SOURCES) +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +HEADER_FILES = OlaClient.h OlaCallbackClient.h OlaDevice.h \ + OlaClientWrapper.h StreamingClient.h common.h + +lib_LTLIBRARIES = libola.la +libola_la_SOURCES = OlaClient.cpp OlaCallbackClient.cpp OlaClientCore.cpp \ + OlaClientWrapper.cpp StreamingClient.cpp + +libola_la_LDFLAGS = -version-info 1:1:0 +libola_la_LIBADD = $(top_builddir)/common/libolacommon.la +pkginclude_HEADERS = $(HEADER_FILES) +EXTRA_DIST = $(HEADER_FILES) OlaClientCore.h common-h.in +OlaClientTester_SOURCES = $(OLASERVER_SOURCES) OlaClientTester.cpp \ + StreamingClientTest.cpp + +OlaClientTester_CXXFLAGS = $(CPPUNIT_CFLAGS) $(libusb_CFLAGS) +OlaClientTester_LDFLAGS = $(CPPUNIT_LIBS) -ldl -lprotobuf +OlaClientTester_LDADD = @LIBS@ ${PLUGIN_LIBS} \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la \ + ./libola.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ola/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu ola/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libola.la: $(libola_la_OBJECTS) $(libola_la_DEPENDENCIES) + $(libola_la_LINK) -rpath $(libdir) $(libola_la_OBJECTS) $(libola_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +OlaClientTester$(EXEEXT): $(OlaClientTester_OBJECTS) $(OlaClientTester_DEPENDENCIES) + @rm -f OlaClientTester$(EXEEXT) + $(OlaClientTester_LINK) $(OlaClientTester_OBJECTS) $(OlaClientTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaCallbackClient.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaClient.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaClientCore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaClientTester-OlaClientTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaClientTester-StreamingClientTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaClientWrapper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StreamingClient.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +OlaClientTester-OlaClientTester.o: OlaClientTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -MT OlaClientTester-OlaClientTester.o -MD -MP -MF $(DEPDIR)/OlaClientTester-OlaClientTester.Tpo -c -o OlaClientTester-OlaClientTester.o `test -f 'OlaClientTester.cpp' || echo '$(srcdir)/'`OlaClientTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaClientTester-OlaClientTester.Tpo $(DEPDIR)/OlaClientTester-OlaClientTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaClientTester.cpp' object='OlaClientTester-OlaClientTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaClientTester-OlaClientTester.o `test -f 'OlaClientTester.cpp' || echo '$(srcdir)/'`OlaClientTester.cpp + +OlaClientTester-OlaClientTester.obj: OlaClientTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -MT OlaClientTester-OlaClientTester.obj -MD -MP -MF $(DEPDIR)/OlaClientTester-OlaClientTester.Tpo -c -o OlaClientTester-OlaClientTester.obj `if test -f 'OlaClientTester.cpp'; then $(CYGPATH_W) 'OlaClientTester.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaClientTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaClientTester-OlaClientTester.Tpo $(DEPDIR)/OlaClientTester-OlaClientTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaClientTester.cpp' object='OlaClientTester-OlaClientTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaClientTester-OlaClientTester.obj `if test -f 'OlaClientTester.cpp'; then $(CYGPATH_W) 'OlaClientTester.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaClientTester.cpp'; fi` + +OlaClientTester-StreamingClientTest.o: StreamingClientTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -MT OlaClientTester-StreamingClientTest.o -MD -MP -MF $(DEPDIR)/OlaClientTester-StreamingClientTest.Tpo -c -o OlaClientTester-StreamingClientTest.o `test -f 'StreamingClientTest.cpp' || echo '$(srcdir)/'`StreamingClientTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaClientTester-StreamingClientTest.Tpo $(DEPDIR)/OlaClientTester-StreamingClientTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamingClientTest.cpp' object='OlaClientTester-StreamingClientTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaClientTester-StreamingClientTest.o `test -f 'StreamingClientTest.cpp' || echo '$(srcdir)/'`StreamingClientTest.cpp + +OlaClientTester-StreamingClientTest.obj: StreamingClientTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -MT OlaClientTester-StreamingClientTest.obj -MD -MP -MF $(DEPDIR)/OlaClientTester-StreamingClientTest.Tpo -c -o OlaClientTester-StreamingClientTest.obj `if test -f 'StreamingClientTest.cpp'; then $(CYGPATH_W) 'StreamingClientTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamingClientTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaClientTester-StreamingClientTest.Tpo $(DEPDIR)/OlaClientTester-StreamingClientTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='StreamingClientTest.cpp' object='OlaClientTester-StreamingClientTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaClientTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaClientTester-StreamingClientTest.obj `if test -f 'StreamingClientTest.cpp'; then $(CYGPATH_W) 'StreamingClientTest.cpp'; else $(CYGPATH_W) '$(srcdir)/StreamingClientTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags dist-hook distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-hook install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS + + +# Regenerate common.h with config.status whenever common-h.in changes. +common.h: stamp-common + @: +stamp-common: $(srcdir)/common-h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=sic/common.h \ + $(SHELL) ./config.status + echo timestamp > $@ + +# Don't distribute common.h, since it is build host dependent! +dist-hook: + rm -f $(distdir)/common.h + +install-exec-hook: + $(LN_S) -f $(includedir)/ola/OlaClientWrapper.h $(DESTDIR)$(includedir)/ola/SimpleClient.h +# 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/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.cpp b/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.cpp new file mode 100644 index 0000000..8a239ec --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.cpp @@ -0,0 +1,417 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaCallbackClient.cpp + * Implementation of OlaCallbackClient + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include + +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "ola/OlaCallbackClient.h" +#include "ola/OlaClientCore.h" +#include "ola/OlaDevice.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/RDMAPIImplInterface.h" +#include "ola/rdm/RDMEnums.h" + +namespace ola { + +using std::string; +using std::vector; +using ola::rdm::RDMAPIImplInterface; +using ola::network::ConnectedSocket; + +OlaCallbackClient::OlaCallbackClient(ConnectedSocket *socket) { + m_core = new OlaClientCore(socket); +} + + +OlaCallbackClient::~OlaCallbackClient() { + delete m_core; +} + + +/* + * Setup this client + * @returns true on success, false on failure + */ +bool OlaCallbackClient::Setup() { + return m_core->Setup(); +} + + +/* + * Close the ola connection. + * @return true on sucess, false on failure + */ +bool OlaCallbackClient::Stop() { + return m_core->Stop(); +} + + +/* + * Fetch the list of available plugins. + * @returns true if the request succeeded, false otherwise. + */ +bool OlaCallbackClient::FetchPluginList( + SingleUseCallback2&, + const string&> *callback) { + return m_core->FetchPluginList(callback); +} + + +/* + * Fetch the description for a plugin. + * @param plugin_id the id of the plugin to fetch. + * @returns true if the request succeeded, false otherwise. + */ +bool OlaCallbackClient::FetchPluginDescription( + ola_plugin_id plugin_id, + SingleUseCallback2 *callback) { + return m_core->FetchPluginDescription(plugin_id, callback); +} + + +/* + * Request a listing of what devices are attached. + * @param filter only fetch devices that belong to this plugin + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchDeviceInfo( + ola_plugin_id filter, + SingleUseCallback2&, + const string&> *callback) { + return m_core->FetchDeviceInfo(filter, callback); +} + + +/* + * Request a list of what ports could be patched to a universe. + * @param unique_id only fetch devices that belong to this plugin + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchCandidatePorts( + unsigned int universe_id, + SingleUseCallback2&, + const string&> *callback) { + return m_core->FetchCandidatePorts(universe_id, callback); +} + + +/* + * Request a list of what ports could be patched to a new universe. + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchCandidatePorts( + SingleUseCallback2&, + const string&> *callback) { + return m_core->FetchCandidatePorts(callback); +} + + +/* + * Sends a device config request + * @param device_alias the device_alias + * @param msg the request message + * @return true on success, false on failure + */ +bool OlaCallbackClient::ConfigureDevice( + unsigned int device_alias, + const string &msg, + SingleUseCallback2 *callback) { + return m_core->ConfigureDevice(device_alias, msg, callback); +} + + + +/* + * Set the priority for a port to inherit mode + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + * @param is_output true for an output port, false of an input port + */ +bool OlaCallbackClient::SetPortPriorityInherit( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + SingleUseCallback1 *callback) { + return m_core->SetPortPriorityInherit(device_alias, + port, + port_direction, + callback); +} + + +/* + * Set the priority for a port to override mode + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + * @param value the port priority value + */ +bool OlaCallbackClient::SetPortPriorityOverride( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value, + SingleUseCallback1 *callback) { + return m_core->SetPortPriorityOverride(device_alias, + port, + port_direction, + value, + callback); +} + + + +/* + * Request information about active universes. + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchUniverseList( + SingleUseCallback2&, + const string &> *callback) { + return m_core->FetchUniverseList(callback); +} + + +/* + * Request information about a universe. + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchUniverseInfo( + unsigned int universe_id, + SingleUseCallback2 *callback) { + return m_core->FetchUniverseInfo(universe_id, callback); +} + + +/* + * Set the name of a universe. + * @param universe the id of the universe to set. + * @param name the new universe name. + * @return true on success, false on failure + */ +bool OlaCallbackClient::SetUniverseName( + unsigned int universe, + const string &name, + SingleUseCallback1 *callback) { + return m_core->SetUniverseName(universe, name, callback); +} + + +/* + * Set the merge mode of a universe + * @param universe the id of the universe to set. + * @param mode the new universe merge mode. + * @return true on success, false on failure + */ +bool OlaCallbackClient::SetUniverseMergeMode( + unsigned int universe, + OlaUniverse::merge_mode mode, + SingleUseCallback1 *callback) { + return m_core->SetUniverseMergeMode(universe, mode, callback); +} + + +/* + * (Un)Patch a port to a universe + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + * @param action OlaClient::PATCH or OlaClient::UNPATCH + * @param uni universe id + * @return true on success, false on failure + */ +bool OlaCallbackClient::Patch( + unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + ola::PatchAction action, + unsigned int universe, + SingleUseCallback1 *callback) { + return m_core->Patch(device_alias, + port, + port_direction, + action, + universe, + callback); +} + + +/** + * Set the callback to be run whenever new DMX data is received. + */ +void OlaCallbackClient::SetDmxCallback( + Callback3 *callback) { + m_core->SetDmxCallback(callback); +} + + + +/* + * Register our interest in a universe. + * @param uni the universe id + * @param action REGISTER or UNREGISTER + * @return true on success, false on failure + */ +bool OlaCallbackClient::RegisterUniverse( + unsigned int universe, + ola::RegisterAction register_action, + SingleUseCallback1 *callback) { + return m_core->RegisterUniverse(universe, register_action, callback); +} + + +/* + * Write some dmx data. + * @param universe universe to send to + * @param data a DmxBuffer with the data + * @return true on success, false on failure + */ +bool OlaCallbackClient::SendDmx( + unsigned int universe, + const DmxBuffer &data, + SingleUseCallback1 *callback) { + return m_core->SendDmx(universe, data, callback); +} + + +/* + * Read dmx data. + * @param universe the universe id to get data for + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchDmx( + unsigned int universe, + SingleUseCallback2 *callback) { + return m_core->FetchDmx(universe, callback); +} + + +/* + * Fetch the UID list for a universe + * @param universe the universe id to get data for + * @return true on success, false on failure + */ +bool OlaCallbackClient::FetchUIDList( + unsigned int universe, + SingleUseCallback2 *callback) { + return m_core->FetchUIDList(universe, callback); +} + + +/* + * Force RDM discovery for a universe + * @param universe the universe id to run discovery on + * @return true on success, false on failure + */ +bool OlaCallbackClient::ForceDiscovery( + unsigned int universe, + ola::SingleUseCallback1 *callback) { + return m_core->ForceDiscovery(universe, callback); +} + + +/* + * Set this clients Source UID + * @param uid the new source UID. + * @return true on success, false on failure + */ +bool OlaCallbackClient::SetSourceUID( + const ola::rdm::UID &uid, + ola::SingleUseCallback1 *callback) { + return m_core->SetSourceUID(uid, callback); +} + + + +/* + * Send an RDM Get Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaCallbackClient::RDMGet(RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return m_core->RDMGet(callback, + universe, + uid, + sub_device, + pid, + data, + data_length); +} + + +/* + * Send an RDM Set Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaCallbackClient::RDMSet(RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return m_core->RDMSet(callback, + universe, + uid, + sub_device, + pid, + data, + data_length); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.h b/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.h new file mode 100644 index 0000000..63a916b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaCallbackClient.h @@ -0,0 +1,176 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaCallbackClient.h + * This is the main client API to OLA. Unlike the OlaClient class it uses + * Callbacks for all notifications. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLA_OLACALLBACKCLIENT_H_ +#define OLA_OLACALLBACKCLIENT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace ola { + +using std::string; + +class OlaCallbackClient: public ola::rdm::RDMAPIImplInterface { + public: + explicit OlaCallbackClient(ola::network::ConnectedSocket *socket); + ~OlaCallbackClient(); + + bool Setup(); + bool Stop(); + + // plugin methods + bool FetchPluginList( + SingleUseCallback2&, + const string&> *callback); + + bool FetchPluginDescription( + ola_plugin_id plugin_id, + SingleUseCallback2 *callback); + + // device methods + bool FetchDeviceInfo( + ola_plugin_id filter, + SingleUseCallback2&, + const string&> *callback); + + bool FetchCandidatePorts( + unsigned int universe_id, + SingleUseCallback2&, + const string&> *callback); + + bool FetchCandidatePorts( + SingleUseCallback2&, + const string&> *callback); + + bool ConfigureDevice( + unsigned int device_alias, + const string &msg, + SingleUseCallback2 *callback); + + // port methods + bool SetPortPriorityInherit( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + SingleUseCallback1 *callback); + bool SetPortPriorityOverride( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value, + SingleUseCallback1 *callback); + + // universe methods + bool FetchUniverseList( + SingleUseCallback2&, + const string &> *callback); + bool FetchUniverseInfo( + unsigned int universe, + SingleUseCallback2 *callback); + bool SetUniverseName( + unsigned int uni, + const string &name, + SingleUseCallback1 *callback); + bool SetUniverseMergeMode( + unsigned int uni, + OlaUniverse::merge_mode mode, + SingleUseCallback1 *callback); + + // patching + bool Patch( + unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + ola::PatchAction action, + unsigned int uni, + SingleUseCallback1 *callback); + + // dmx methods + void SetDmxCallback( + Callback3 *callback); + + bool RegisterUniverse( + unsigned int universe, + ola::RegisterAction register_action, + SingleUseCallback1 *callback); + bool SendDmx( + unsigned int universe, + const DmxBuffer &data, + SingleUseCallback1 *callback); + bool FetchDmx( + unsigned int universe, + SingleUseCallback2 *callback); + + // rdm methods + bool FetchUIDList( + unsigned int universe, + SingleUseCallback2 *callback); + bool ForceDiscovery( + unsigned int universe, + ola::SingleUseCallback1 *callback); + bool SetSourceUID(const ola::rdm::UID &uid, + ola::SingleUseCallback1 *callback); + + bool RDMGet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + bool RDMSet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + + private: + OlaCallbackClient(const OlaCallbackClient&); + OlaCallbackClient operator=(const OlaCallbackClient&); + + class OlaClientCore *m_core; +}; +} // ola +#endif // OLA_OLACALLBACKCLIENT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClient.cpp b/open-lighting-architecture/ola-0.8.4/ola/OlaClient.cpp new file mode 100644 index 0000000..9af9e3b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClient.cpp @@ -0,0 +1,447 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClient.cpp + * Implementation of OlaClient + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include "ola/OlaClient.h" +#include "ola/OlaClientCore.h" + +namespace ola { + +using ola::network::ConnectedSocket; + +OlaClient::OlaClient(ConnectedSocket *socket): + m_observer(NULL) { + m_core = new OlaClientCore(socket); +} + +OlaClient::~OlaClient() { + delete m_core; +} + + +/* + * Setup this client + * + * @returns true on success, false on failure + */ +bool OlaClient::Setup() { + return m_core->Setup(); +} + + +/* + * Close the ola connection. + * + * @return true on sucess, false on failure + */ +bool OlaClient::Stop() { + return m_core->Stop(); +} + + +/* + * Set the OlaClientObserver object + * + * @params observer the OlaClientObserver object to be used for the callbacks. + */ +void OlaClient::SetObserver(OlaClientObserver *observer) { + m_observer = observer; + m_core->SetDmxCallback(NewCallback(observer, &OlaClientObserver::NewDmx)); +} + + +/* + * Fetch info about available plugins. This results in a call to + * observer->Plugins(...) + * when the request returns. + * @returns true if the request succeeded, false otherwise. + */ +bool OlaClient::FetchPluginList() { + if (m_observer) + return m_core->FetchPluginList( + NewSingleCallback(m_observer, &OlaClientObserver::Plugins)); + else + return m_core->FetchPluginList(NULL); +} + + +/* + * Fetch the description for a plugin. This calls + * observer->PluginDescription(...) + * when the request returns. + * @returns true if the request succeeded, false otherwise. + */ +bool OlaClient::FetchPluginDescription(ola_plugin_id plugin_id) { + if (m_observer) + return m_core->FetchPluginDescription( + plugin_id, + NewSingleCallback(m_observer, + &OlaClientObserver::PluginDescription, + plugin_id)); + else + return m_core->FetchPluginDescription(plugin_id, NULL); +} + + +/* + * Write some dmx data. + * @param universe universe to send to + * @param data a DmxBuffer with the data + * @return true on success, false on failure + */ +bool OlaClient::SendDmx(unsigned int universe, const DmxBuffer &data) { + if (m_observer) + return m_core->SendDmx( + universe, + data, + NewSingleCallback(m_observer, + &OlaClientObserver::SendDmxComplete, + universe)); + else + return m_core->SendDmx(universe, data, NULL); +} + + +/* + * Read dmx data. This results in a call to + * observer->NewDmx() + * when the request returns. + * + * @param universe the universe id to get data for + * @return true on success, false on failure + */ +bool OlaClient::FetchDmx(unsigned int universe) { + if (m_observer) + return m_core->FetchDmx( + universe, + NewSingleCallback(m_observer, &OlaClientObserver::NewDmx, universe)); + else + return m_core->FetchDmx(universe, NULL); +} + + +/* + * Fetch the UID list for a universe + * @param universe the universe id to get data for + * @return true on success, false on failure + */ +bool OlaClient::FetchUIDList(unsigned int universe) { + if (m_observer) + return m_core->FetchUIDList( + universe, + NewSingleCallback(m_observer, &OlaClientObserver::UIDList, universe)); + else + return m_core->FetchUIDList(universe, NULL); +} + + +/* + * Force RDM discovery for a universe + * @param universe the universe id to run discovery on + * @return true on success, false on failure + */ +bool OlaClient::ForceDiscovery(unsigned int universe) { + if (m_observer) + return m_core->ForceDiscovery( + universe, + NewSingleCallback(m_observer, + &OlaClientObserver::ForceRDMDiscoveryComplete, + universe)); + else + return m_core->ForceDiscovery(universe, NULL); +} + + +/* + * Set this clients Source UID + */ +bool OlaClient::SetSourceUID(const UID &uid) { + if (m_observer) + return m_core->SetSourceUID( + uid, + NewSingleCallback(m_observer, + &OlaClientObserver::SetSourceUIDComplete)); + else + return m_core->SetSourceUID(uid, NULL); +} + + +/* + * Send an RDM Get Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaClient::RDMGet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return m_core->RDMGet(callback, + universe, + uid, + sub_device, + pid, + data, + data_length); +} + + +/* + * Send an RDM Set Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaClient::RDMSet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return m_core->RDMSet(callback, + universe, + uid, + sub_device, + pid, + data, + data_length); +} + + +/* + * Request a listing of what devices are attached. This results in a call to + * observer->Devices() + * when the request returns. + * @param filter only fetch devices that belong to this plugin + * @return true on success, false on failure + */ +bool OlaClient::FetchDeviceInfo(ola_plugin_id filter) { + if (m_observer) + return m_core->FetchDeviceInfo( + filter, + NewSingleCallback(m_observer, &OlaClientObserver::Devices)); + else + return m_core->FetchDeviceInfo(filter, NULL); +} + + +/* + * Request information about active universes. This results in a call to + * observer->Universes() + * when the request returns. + * @return true on success, false on failure + */ +bool OlaClient::FetchUniverseInfo() { + if (m_observer) + return m_core->FetchUniverseList( + NewSingleCallback(m_observer, &OlaClientObserver::Universes)); + else + return m_core->FetchUniverseList(NULL); +} + + +/* + * Set the name of a universe. + * @return true on success, false on failure + */ +bool OlaClient::SetUniverseName(unsigned int universe, const string &name) { + if (m_observer) + return m_core->SetUniverseName( + universe, + name, + NewSingleCallback(m_observer, + &OlaClientObserver::UniverseNameComplete, + universe)); + else + return m_core->SetUniverseName(universe, name, NULL); +} + + +/* + * Set the merge mode of a universe + * + * @return true on success, false on failure + */ +bool OlaClient::SetUniverseMergeMode(unsigned int universe, + OlaUniverse::merge_mode mode) { + if (m_observer) + return m_core->SetUniverseMergeMode( + universe, + mode, + NewSingleCallback(m_observer, + &OlaClientObserver::UniverseMergeModeComplete, + universe)); + else + return m_core->SetUniverseMergeMode(universe, mode, NULL); +} + + +/* + * Register our interest in a universe. This results in calls to + * observer->NewDmx() + * whenever the dmx values change. + * + * @param uni the universe id + * @param action REGISTER or UNREGISTER + * @return true on success, false on failure + */ +bool OlaClient::RegisterUniverse(unsigned int universe, + ola::RegisterAction register_action) { + if (m_observer) + return m_core->RegisterUniverse( + universe, + register_action, + NewSingleCallback(m_observer, + &OlaClientObserver::RegistrationComplete, + universe)); + else + return m_core->RegisterUniverse(universe, register_action, NULL); +} + + +/* + * (Un)Patch a port to a universe + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + * @param action OlaClient::PATCH or OlaClient::UNPATCH + * @param uni universe id + * @return true on success, false on failure + */ +bool OlaClient::Patch(unsigned int device_alias, + unsigned int port_id, + PortDirection port_direction, + ola::PatchAction patch_action, + unsigned int universe) { + if (m_observer) + return m_core->Patch( + device_alias, + port_id, + port_direction, + patch_action, + universe, + NewSingleCallback(m_observer, + &OlaClientObserver::PatchComplete, + device_alias, + port_id, + port_direction)); + else + return m_core->Patch( + device_alias, + port_id, + port_direction, + patch_action, + universe, + NULL); +} + + +/* + * Set the priority for a port to inherit mode + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + */ +bool OlaClient::SetPortPriorityInherit(unsigned int device_alias, + unsigned int port, + PortDirection port_direction) { + if (m_observer) + return m_core->SetPortPriorityInherit( + device_alias, + port, + port_direction, + NewSingleCallback(m_observer, + &OlaClientObserver::SetPortPriorityComplete, + device_alias, + port, + port_direction)); + else + return m_core->SetPortPriorityInherit( + device_alias, + port, + port_direction, + NULL); +} + + +/* + * Set the priority for a port to override mode + * @param dev the device id + * @param port the port id + * @param port_direction the direction of the port + * @param value the port priority value + */ +bool OlaClient::SetPortPriorityOverride(unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value) { + if (m_observer) + return m_core->SetPortPriorityOverride( + device_alias, + port, + port_direction, + value, + NewSingleCallback(m_observer, + &OlaClientObserver::SetPortPriorityComplete, + device_alias, + port, + port_direction)); + else + return m_core->SetPortPriorityOverride( + device_alias, + port, + port_direction, + value, + NULL); +} + + +/* + * Sends a device config request + * @param device_alias the device_alias + * @param msg the request message + * @return true on success, false on failure + */ +bool OlaClient::ConfigureDevice(unsigned int device_alias, const string &msg) { + if (m_observer) + return m_core->ConfigureDevice( + device_alias, + msg, + NewSingleCallback(m_observer, + &OlaClientObserver::DeviceConfig, + device_alias)); + else + return m_core->ConfigureDevice(device_alias, msg, NULL); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClient.h b/open-lighting-architecture/ola-0.8.4/ola/OlaClient.h new file mode 100644 index 0000000..587de58 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClient.h @@ -0,0 +1,225 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClient.h + * Interface to the OLA Client class + * Copyright (C) 2005-2008 Simon Newton + * + * This is the legacy client which uses an Observer object. It suffers from the + * de-multiplexing problem so it's recommended to use the OlaCallbackClient. + * instead. + */ + +#ifndef OLA_OLACLIENT_H_ +#define OLA_OLACLIENT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ola { + +namespace network { +class ConnectedSocket; +} + +using std::string; +using std::vector; +using ola::rdm::UID; + +class OlaClientCore; + + +class OlaClientObserver { + public: + virtual ~OlaClientObserver() {} + + virtual void NewDmx(unsigned int universe, + const DmxBuffer &data, + const string &error) { + (void) universe; + (void) data; + (void) error; + } + virtual void Plugins(const vector &plugins, + const string &error) { + (void) plugins; + (void) error; + } + + virtual void PluginDescription(ola_plugin_id plugin_id, + const string &description, + const string &error) { + (void) plugin_id; + (void) description; + (void) error; + } + virtual void Devices(const vector &devices, + const string &error) { + (void) devices; + (void) error; + } + virtual void Universes(const vector &universes, + const string &error) { + (void) universes; + (void) error; + } + virtual void DeviceConfig(unsigned int device_alias, + const string &reply, + const string &error) { + (void) device_alias; + (void) reply; + (void) error; + } + + virtual void PatchComplete(unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + const string &error) { + (void) device_alias; + (void) port; + (void) port_direction; + (void) error; + } + virtual void UniverseNameComplete(unsigned int universe, + const string &error) { + (void) universe; + (void) error; + } + virtual void UniverseMergeModeComplete(unsigned int universe, + const string &error) { + (void) universe; + (void) error; + } + virtual void SendDmxComplete(unsigned int universe, + const string &error) { + (void) universe; + (void) error; + } + virtual void SetPortPriorityComplete( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + const string &error) { + (void) device_alias; + (void) port; + (void) port_direction; + (void) error; + } + + // RDM methods + virtual void UIDList(unsigned int universe, + const ola::rdm::UIDSet &uids, + const string &error) { + (void) universe; + (void) uids; + (void) error; + } + virtual void ForceRDMDiscoveryComplete(unsigned int universe, + const string &error) { + (void) universe; + (void) error; + } + virtual void SetSourceUIDComplete(const string &error) { + (void) error; + } + + virtual void RegistrationComplete(unsigned int universe, + const string &error) { + (void) universe; + (void) error; + } +}; + + +/* + * OlaClient is just a wrapper around OlaClientCore + */ +class OlaClient: public ola::rdm::RDMAPIImplInterface { + public: + explicit OlaClient(ola::network::ConnectedSocket *socket); + ~OlaClient(); + + bool Setup(); + bool Stop(); + void SetObserver(OlaClientObserver *observer); + + bool FetchPluginList(); + bool FetchPluginDescription(ola_plugin_id plugin_id); + bool FetchDeviceInfo(ola_plugin_id filter = ola::OLA_PLUGIN_ALL); + bool FetchUniverseInfo(); + + // dmx methods + bool SendDmx(unsigned int universe, const DmxBuffer &data); + bool FetchDmx(unsigned int uni); + + // rdm methods + bool FetchUIDList(unsigned int universe); + bool ForceDiscovery(unsigned int universe); + bool SetSourceUID(const UID &uid); + + bool RDMGet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data = NULL, + unsigned int data_length = 0); + bool RDMSet(rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + + bool SetUniverseName(unsigned int uni, const string &name); + bool SetUniverseMergeMode(unsigned int uni, OlaUniverse::merge_mode mode); + + bool RegisterUniverse(unsigned int universe, ola::RegisterAction action); + + bool Patch(unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + ola::PatchAction action, + unsigned int uni); + + bool SetPortPriorityInherit(unsigned int device_alias, + unsigned int port, + PortDirection port_direction); + bool SetPortPriorityOverride(unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value); + + bool ConfigureDevice(unsigned int device_alias, const string &msg); + + private: + OlaClient(const OlaClient&); + OlaClient operator=(const OlaClient&); + + OlaClientCore *m_core; + OlaClientObserver *m_observer; +}; +} // ola +#endif // OLA_OLACLIENT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.cpp b/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.cpp new file mode 100644 index 0000000..a990717 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.cpp @@ -0,0 +1,1111 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClientCore.cpp + * Implementation of OlaClientCore + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "ola/OlaClientCore.h" +#include "ola/OlaDevice.h" +#include "ola/rdm/RDMEnums.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/RDMAPIImplInterface.h" + +namespace ola { + +using ola::proto::OlaServerService_Stub; +using std::string; +using std::vector; +using ola::rdm::UID; +using ola::rdm::UIDSet; + +OlaClientCore::OlaClientCore(ConnectedSocket *socket) + : m_socket(socket), + m_dmx_callback(NULL), + m_channel(NULL), + m_stub(NULL), + m_connected(false) { +} + + +OlaClientCore::~OlaClientCore() { + if (m_dmx_callback) { + delete m_dmx_callback; + m_dmx_callback = NULL; + } + if (m_connected) + Stop(); +} + + +/* + * Setup this client + * @return true on success, false on failure + */ +bool OlaClientCore::Setup() { + if (m_connected) + return false; + + m_channel = new StreamRpcChannel(this, m_socket); + + if (!m_channel) { + return false; + } + m_stub = new OlaServerService_Stub(m_channel); + + if (!m_stub) { + delete m_channel; + return false; + } + m_connected = true; + return true; +} + + +/* + * Close the ola connection. + * @return true on success, false on failure + */ +bool OlaClientCore::Stop() { + if (m_connected) { + m_socket->Close(); + delete m_channel; + delete m_stub; + } + m_connected = false; + return 0; +} + + +/* + * Fetch the list of plugins loaded. + * @return true on success, false on failure + */ +bool OlaClientCore::FetchPluginList( + SingleUseCallback2&, + const string &> *callback) { + if (!m_connected) { + delete callback; + return false; + } + + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::PluginListRequest request; + ola::proto::PluginListReply *reply = new ola::proto::PluginListReply(); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandlePluginList, + NewArgs(controller, reply, callback)); + m_stub->GetPlugins(controller, &request, reply, cb); + return true; +} + + +/* + * Fetch the description for a plugin + * @return true on success, false on failure + */ +bool OlaClientCore::FetchPluginDescription( + ola_plugin_id plugin_id, + SingleUseCallback2 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::PluginDescriptionRequest request; + ola::proto::PluginDescriptionReply *reply = new + ola::proto::PluginDescriptionReply(); + + request.set_plugin_id(plugin_id); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandlePluginDescription, + NewArgs(controller, reply, callback)); + m_stub->GetPluginDescription(controller, &request, reply, cb); + return true; +} + + +/* + * Request a listing of what devices are attached + * @param filter only fetch devices that belong to this particular plugin + * @return true on success, false on failure + */ +bool OlaClientCore::FetchDeviceInfo( + ola_plugin_id filter, + SingleUseCallback2&, + const string&> *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::DeviceInfoRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DeviceInfoReply *reply = new ola::proto::DeviceInfoReply(); + request.set_plugin_id(filter); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleDeviceInfo, + NewArgs(controller, reply, callback)); + m_stub->GetDeviceInfo(controller, &request, reply, cb); + return true; +} + + +/* + * Request a list of ports that could be patched to a universe. + * @param universe_id the universe id + * @return true on success, false on failure + */ +bool OlaClientCore::FetchCandidatePorts( + unsigned int universe_id, + SingleUseCallback2&, + const string&> *callback) { + return GenericFetchCandidatePorts(universe_id, true, callback); +} + + +/* + * Request a list of ports that could be patched to a new universe. + * @return true on success, false on failure + */ +bool OlaClientCore::FetchCandidatePorts( + SingleUseCallback2&, + const string&> *callback) { + return GenericFetchCandidatePorts(0, false, callback); +} + + +/* + * Sends a device config request + * @param device_alias the device alias + * @param msg the data to send + */ +bool OlaClientCore::ConfigureDevice( + unsigned int device_alias, + const string &msg, + SingleUseCallback2 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::DeviceConfigRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DeviceConfigReply *reply = new ola::proto::DeviceConfigReply(); + + string configure_request; + request.set_device_alias(device_alias); + request.set_data(msg); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleDeviceConfig, + NewArgs(controller, reply, callback)); + m_stub->ConfigureDevice(controller, &request, reply, cb); + return true; +} + + +/* + * Set the priority for a port to inherit mode + * @param dev the device id + * @param port the port id + * @param is_output true for an output port, false of an input port + */ +bool OlaClientCore::SetPortPriorityInherit( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::PortPriorityRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_device_alias(device_alias); + request.set_port_id(port); + request.set_is_output(port_direction == OUTPUT_PORT); + request.set_priority_mode(ola::PRIORITY_MODE_INHERIT); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->SetPortPriority(controller, &request, reply, cb); + return true; +} + + +/* + * Set the priority for a port to override mode + * @param dev the device id + * @param port the port id + * @param is_output true for an output port, false of an input port + * @param value the port priority value + */ +bool OlaClientCore::SetPortPriorityOverride( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::PortPriorityRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_device_alias(device_alias); + request.set_port_id(port); + request.set_is_output(port_direction == OUTPUT_PORT); + request.set_priority_mode(ola::PRIORITY_MODE_OVERRIDE); + request.set_priority(value); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->SetPortPriority(controller, &request, reply, cb); + return true; +} + + +/* + * Request a universe listing + * @return true on success, false on failure + */ +bool OlaClientCore::FetchUniverseList( + SingleUseCallback2&, + const string&> *callback) { + if (!m_connected) { + delete callback; + return false; + } + + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::OptionalUniverseRequest request; + ola::proto::UniverseInfoReply *reply = new ola::proto::UniverseInfoReply(); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleUniverseList, + NewArgs(controller, reply, callback)); + m_stub->GetUniverseInfo(controller, &request, reply, cb); + return true; +} + + +/* + * Fetch the information for a single universe. + * @param universe_id the id of the universe + * @return true on success, false on failure + */ +bool OlaClientCore::FetchUniverseInfo( + unsigned int universe_id, + SingleUseCallback2 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::OptionalUniverseRequest request; + ola::proto::UniverseInfoReply *reply = new ola::proto::UniverseInfoReply(); + + request.set_universe(universe_id); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleUniverseInfo, + NewArgs(controller, reply, callback)); + m_stub->GetUniverseInfo(controller, &request, reply, cb); + return true; +} + + +/* + * Set the name of a universe + * @param universe the id of the universe + * @param name the new name + * @return true on success, false on failure + */ +bool OlaClientCore::SetUniverseName( + unsigned int universe, + const string &name, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::UniverseNameRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_universe(universe); + request.set_name(name); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->SetUniverseName(controller, &request, reply, cb); + return true; +} + + +/* + * Set the merge mode of a universe + * @param universe the id of the universe + * @param mode the new merge mode + * @return true on success, false on failure + */ +bool OlaClientCore::SetUniverseMergeMode( + unsigned int universe, + OlaUniverse::merge_mode mode, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::MergeModeRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + ola::proto::MergeMode merge_mode = mode == OlaUniverse::MERGE_HTP ? + ola::proto::HTP : ola::proto::LTP; + request.set_universe(universe); + request.set_merge_mode(merge_mode); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->SetMergeMode(controller, &request, reply, cb); + return true; +} + + +/* + * (Un)Patch a port to a universe + * @param device_alias the alias of the device + * @param port the port id + * @param action OlaClientCore::PATCH or OlaClientCore::UNPATCH + * @param universe universe id + */ +bool OlaClientCore::Patch( + unsigned int device_alias, + unsigned int port_id, + ola::PortDirection port_direction, + ola::PatchAction patch_action, + unsigned int universe, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::PatchPortRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + ola::proto::PatchAction action = ( + patch_action == ola::PATCH ? ola::proto::PATCH : ola::proto::UNPATCH); + request.set_universe(universe); + request.set_device_alias(device_alias); + request.set_port_id(port_id); + request.set_is_output(port_direction == OUTPUT_PORT); + request.set_action(action); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->PatchPort(controller, &request, reply, cb); + return true; +} + + +/* + * Set the callback to be run when DMX data arrives + */ +void OlaClientCore::SetDmxCallback( + Callback3 *callback) { + if (m_dmx_callback) + delete m_dmx_callback; + m_dmx_callback = callback; +} + + +/* + * Register our interest in a universe, the observer object will then + * be notifed when the dmx values in this universe change. + * @param universe the id of the universe + * @param action the action (register or unregister) + */ +bool OlaClientCore::RegisterUniverse( + unsigned int universe, + ola::RegisterAction register_action, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::RegisterDmxRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + ola::proto::RegisterAction action = ( + register_action == ola::REGISTER ? ola::proto::REGISTER : + ola::proto::UNREGISTER); + request.set_universe(universe); + request.set_action(action); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->RegisterForDmx(controller, &request, reply, cb); + return true; +} + + +/* + * Write some dmx data + * @param universe universe to send to + * @param data the DmxBuffer with the data + * @return true on success, false on failure + */ +bool OlaClientCore::SendDmx( + unsigned int universe, + const DmxBuffer &data, + SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::DmxData request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_universe(universe); + request.set_data(data.Get()); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->UpdateDmxData(controller, &request, reply, cb); + return true; +} + + +/* + * Read dmx data + * @param universe the universe id to get data for + * @return true on success, false on failure + */ +bool OlaClientCore::FetchDmx( + unsigned int universe, + SingleUseCallback2 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::UniverseRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DmxData *reply = new ola::proto::DmxData(); + + request.set_universe(universe); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleGetDmx, + NewArgs(controller, reply, callback)); + m_stub->GetDmx(controller, &request, reply, cb); + return true; +} + + +/* + * Fetch the UID list for a universe + */ +bool OlaClientCore::FetchUIDList( + unsigned int universe, + SingleUseCallback2 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::UniverseRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::UIDListReply *reply = new ola::proto::UIDListReply(); + + request.set_universe(universe); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleUIDList, + NewArgs(controller, reply, callback)); + m_stub->GetUIDs(controller, &request, reply, cb); + return true; +} + + +/* + * Force RDM discovery for a universe + * @param universe the universe id to run discovery on + * @return true on success, false on failure + */ +bool OlaClientCore::ForceDiscovery( + unsigned int universe, + ola::SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::UniverseRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_universe(universe); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->ForceDiscovery(controller, &request, reply, cb); + return true; +} + + +/* + * Set this clients Source UID + */ +bool OlaClientCore::SetSourceUID( + const UID &uid, + ola::SingleUseCallback1 *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::UID request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::Ack *reply = new ola::proto::Ack(); + + request.set_esta_id(uid.ManufacturerId()); + request.set_device_id(uid.DeviceId()); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleAck, + NewArgs(controller, reply, callback)); + m_stub->SetSourceUID(controller, &request, reply, cb); + return true; +} + + +/* + * Send an RDM Get Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaClientCore::RDMGet( + ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return RDMCommand(callback, false, universe, uid, sub_device, pid, data, + data_length); +} + + +/* + * Send an RDM Set Command + * @param callback the Callback to invoke when this completes + * @param universe the universe to send the command on + * @param uid the UID to send the command to + * @param sub_device the sub device index + * @param pid the PID to address + * @param data the optional data to send + * @param data_length the length of the data + * @return true on success, false on failure + */ +bool OlaClientCore::RDMSet( + ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + return RDMCommand(callback, true, universe, uid, sub_device, pid, data, + data_length); +} + + +/* + * Called when new DMX data arrives + */ +void OlaClientCore::UpdateDmxData( + ::google::protobuf::RpcController *controller, + const ola::proto::DmxData *request, + ola::proto::Ack *response, + ::google::protobuf::Closure *done) { + if (m_dmx_callback) { + DmxBuffer buffer; + buffer.Set(request->data()); + m_dmx_callback->Run(request->universe(), buffer, ""); + } + done->Run(); + (void) response; + (void) controller; +} + + +// The following are RPC callbacks + +/* + * Called once PluginInfo completes + */ +void OlaClientCore::HandlePluginList(plugin_list_arg *args) { + string error_string = ""; + vector ola_plugins; + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } else { + for (int i = 0; i < args->reply->plugin_size(); ++i) { + ola::proto::PluginInfo plugin_info = args->reply->plugin(i); + OlaPlugin plugin(plugin_info.plugin_id(), + plugin_info.name()); + ola_plugins.push_back(plugin); + } + } + std::sort(ola_plugins.begin(), ola_plugins.end()); + args->callback->Run(ola_plugins, error_string); + FreeArgs(args); +} + + +/* + * Called once PluginInfo completes + */ +void OlaClientCore::HandlePluginDescription(plugin_description_arg *args) { + string error_string = ""; + string description; + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } + args->callback->Run(args->reply->description(), error_string); + FreeArgs(args); +} + + +/* + * Called once DeviceInfo completes. + */ +void OlaClientCore::HandleDeviceInfo(device_info_arg *args) { + string error_string = ""; + vector ola_devices; + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } else { + for (int i = 0; i < args->reply->device_size(); ++i) { + ola::proto::DeviceInfo device_info = args->reply->device(i); + vector input_ports; + + for (int j = 0; j < device_info.input_port_size(); ++j) { + ola::proto::PortInfo port_info = device_info.input_port(j); + OlaInputPort port( + port_info.port_id(), + port_info.universe(), + port_info.active(), + port_info.description(), + static_cast( + port_info.priority_capability()), + static_cast( + port_info.priority_mode()), + port_info.priority()); + input_ports.push_back(port); + } + + vector output_ports; + + for (int j = 0; j < device_info.output_port_size(); ++j) { + ola::proto::PortInfo port_info = device_info.output_port(j); + OlaOutputPort port( + port_info.port_id(), + port_info.universe(), + port_info.active(), + port_info.description(), + static_cast( + port_info.priority_capability()), + static_cast( + port_info.priority_mode()), + port_info.priority()); + output_ports.push_back(port); + } + + OlaDevice device(device_info.device_id(), + device_info.device_alias(), + device_info.device_name(), + device_info.plugin_id(), + input_ports, + output_ports); + ola_devices.push_back(device); + } + } + std::sort(ola_devices.begin(), ola_devices.end()); + args->callback->Run(ola_devices, error_string); + FreeArgs(args); +} + + +/* + * Handle a device config response + */ +void OlaClientCore::HandleDeviceConfig(configure_device_args *args) { + string error_string; + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) + error_string = args->controller->ErrorText(); + + args->callback->Run(args->reply->data(), error_string); + FreeArgs(args); +} + + +/* + * Called once SetPriority completes + */ +void OlaClientCore::HandleAck(ack_args *args) { + string error_string = ""; + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) + error_string = args->controller->ErrorText(); + args->callback->Run(error_string); + FreeArgs(args); +} + + +/* + * Called once UniverseInfo completes + */ +void OlaClientCore::HandleUniverseList(universe_list_args *args) { + string error_string = ""; + vector ola_universes; + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } else { + for (int i = 0; i < args->reply->universe_size(); ++i) { + ola::proto::UniverseInfo universe_info = args->reply->universe(i); + OlaUniverse::merge_mode merge_mode = ( + universe_info.merge_mode() == ola::proto::HTP ? + OlaUniverse::MERGE_HTP: OlaUniverse::MERGE_LTP); + + OlaUniverse universe(universe_info.universe(), + merge_mode, + universe_info.name(), + universe_info.input_port_count(), + universe_info.output_port_count(), + universe_info.rdm_devices()); + ola_universes.push_back(universe); + } + } + args->callback->Run(ola_universes, error_string); + FreeArgs(args); +} + + +/* + * Called once UniverseInfo completes + */ +void OlaClientCore::HandleUniverseInfo(universe_info_args *args) { + string error_string = ""; + OlaUniverse null_universe(0, + OlaUniverse::MERGE_LTP, + "", + 0, + 0, + 0); + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } else { + if (args->reply->universe_size() == 1) { + ola::proto::UniverseInfo universe_info = args->reply->universe(0); + OlaUniverse::merge_mode merge_mode = ( + universe_info.merge_mode() == ola::proto::HTP ? + OlaUniverse::MERGE_HTP: OlaUniverse::MERGE_LTP); + + OlaUniverse universe(universe_info.universe(), + merge_mode, + universe_info.name(), + universe_info.input_port_count(), + universe_info.output_port_count(), + universe_info.rdm_devices()); + args->callback->Run(universe, error_string); + FreeArgs(args); + return; + + } else if (args->reply->universe_size() > 1) { + error_string = "Too many unvierses in response"; + } else { + error_string = "Universe not found"; + } + } + args->callback->Run(null_universe, error_string); + FreeArgs(args); +} + + +/* + * Called once GetDmx completes + */ +void OlaClientCore::HandleGetDmx(get_dmx_args *args) { + string error_string; + if (!args->callback) { + FreeArgs(args); + return; + } + if (args->controller->Failed()) + error_string = args->controller->ErrorText(); + + DmxBuffer buffer; + buffer.Set(args->reply->data()); + args->callback->Run(buffer, error_string); + FreeArgs(args); +} + + +/* + * Handle the UID list response + */ +void OlaClientCore::HandleUIDList(uid_list_args *args) { + string error_string = ""; + ola::rdm::UIDSet uid_set; + + if (!args->callback) { + FreeArgs(args); + return; + } + + if (args->controller->Failed()) { + error_string = args->controller->ErrorText(); + } else { + for (int i = 0; i < args->reply->uid_size(); ++i) { + ola::proto::UID proto_uid = args->reply->uid(i); + ola::rdm::UID uid(proto_uid.esta_id(), + proto_uid.device_id()); + uid_set.AddUID(uid); + } + } + args->callback->Run(uid_set, error_string); + FreeArgs(args); +} + + +/* + * Handle an RDM message + */ +void OlaClientCore::HandleRDM(rdm_response_args *args) { + ola::rdm::RDMAPIImplResponseStatus response_status; + + if (!args->callback) { + FreeArgs(args); + return; + } + + response_status.was_broadcast = args->reply->was_broadcast(); + response_status.response_type = args->reply->response_code(); + response_status.message_count = args->reply->message_count(); + + if (args->controller->Failed()) { + response_status.error = args->controller->ErrorText(); + } else if (args->reply->response_code() == ola::rdm::ACK_OVERFLOW) { + OLA_WARN << "Unexpected ACK_OVERFLOW"; + response_status.error = "Unexpected ACK_OVERFLOW in OLA Client"; + } else if (args->reply->response_code() == ola::rdm::ACK_TIMER) { + // TODO(simon): handle ACK_TIMER case here. + OLA_WARN << "We don't handle ACK_TIMER yet!"; + response_status.error = "ACK_TIMER not implemented in OLA Client"; + } + + args->callback->Run(response_status, args->reply->data()); + FreeArgs(args); +} + + +/* + * Fetch a list of candidate ports, with or without a universe + */ +bool OlaClientCore::GenericFetchCandidatePorts( + unsigned int universe_id, + bool include_universe, + SingleUseCallback2&, + const string&> *callback) { + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::OptionalUniverseRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DeviceInfoReply *reply = new ola::proto::DeviceInfoReply(); + + if (include_universe) + request.set_universe(universe_id); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleDeviceInfo, + NewArgs(controller, reply, callback)); + m_stub->GetCandidatePorts(controller, &request, reply, cb); + return true; +} + + +/* + * Send a generic rdm command + */ +bool OlaClientCore::RDMCommand( + ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + bool is_set, + unsigned int universe, + const UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length) { + if (!callback) { + OLA_WARN << "RDM callback was null, command to " << uid << " won't be sent"; + return false; + } + + if (!m_connected) { + delete callback; + return false; + } + + ola::proto::RDMRequest request; + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::RDMResponse *reply = new ola::proto::RDMResponse(); + + request.set_universe(universe); + ola::proto::UID *pb_uid = request.mutable_uid(); + pb_uid->set_esta_id(uid.ManufacturerId()); + pb_uid->set_device_id(uid.DeviceId()); + request.set_sub_device(sub_device); + request.set_param_id(pid); + request.set_is_set(is_set); + request.set_data(string(reinterpret_cast(data), data_length)); + + google::protobuf::Closure *cb = google::protobuf::NewCallback( + this, + &ola::OlaClientCore::HandleRDM, + NewArgs(controller, reply, callback)); + + m_stub->RDMCommand(controller, &request, reply, cb); + return true; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.h b/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.h new file mode 100644 index 0000000..b188955 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClientCore.h @@ -0,0 +1,339 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClientCore.h + * The OLA Client Core class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLA_OLACLIENTCORE_H_ +#define OLA_OLACLIENTCORE_H_ + +#include +#include +#include + +#include "common/protocol/Ola.pb.h" +#include "common/rpc/SimpleRpcController.h" +#include "common/rpc/StreamRpcChannel.h" +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/OlaDevice.h" +#include "ola/common.h" +#include "ola/network/Socket.h" +#include "ola/plugin_id.h" +#include "ola/rdm/RDMAPIImplInterface.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" + +namespace ola { + +class OlaClientCoreServiceImpl; + +using std::string; +using ola::network::ConnectedSocket; +using ola::rpc::SimpleRpcController; +using ola::rpc::StreamRpcChannel; + +class OlaClientCore: public ola::proto::OlaClientService { + public: + explicit OlaClientCore(ConnectedSocket *socket); + ~OlaClientCore(); + + bool Setup(); + bool Stop(); + + // plugin methods + bool FetchPluginList( + SingleUseCallback2&, + const string&> *callback); + + bool FetchPluginDescription( + ola_plugin_id plugin_id, + SingleUseCallback2 *callback); + + // device methods + bool FetchDeviceInfo( + ola_plugin_id filter, + SingleUseCallback2&, + const string&> *callback); + + bool FetchCandidatePorts( + SingleUseCallback2&, + const string&> *callback); + + bool FetchCandidatePorts( + unsigned int universe_id, + SingleUseCallback2&, + const string&> *callback); + + bool ConfigureDevice( + unsigned int device_alias, + const string &msg, + SingleUseCallback2 *callback); + + // port methods + bool SetPortPriorityInherit( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + SingleUseCallback1 *callback); + bool SetPortPriorityOverride( + unsigned int device_alias, + unsigned int port, + PortDirection port_direction, + uint8_t value, + SingleUseCallback1 *callback); + + // universe methods + bool FetchUniverseList( + SingleUseCallback2&, + const string &> *callback); + bool FetchUniverseInfo( + unsigned int universe, + SingleUseCallback2 *callback); + bool SetUniverseName( + unsigned int uni, + const string &name, + SingleUseCallback1 *callback); + bool SetUniverseMergeMode( + unsigned int uni, + OlaUniverse::merge_mode mode, + SingleUseCallback1 *callback); + + // patching + bool Patch( + unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + ola::PatchAction action, + unsigned int uni, + SingleUseCallback1 *callback); + + // dmx methods + void SetDmxCallback( + Callback3 *callback); + + bool RegisterUniverse( + unsigned int universe, + ola::RegisterAction register_action, + SingleUseCallback1 *callback); + bool SendDmx( + unsigned int universe, + const DmxBuffer &data, + SingleUseCallback1 *callback); + bool FetchDmx( + unsigned int universe, + SingleUseCallback2 *callback); + + // rdm methods + bool FetchUIDList( + unsigned int universe, + SingleUseCallback2 *callback); + bool ForceDiscovery( + unsigned int universe, + ola::SingleUseCallback1 *callback); + bool SetSourceUID(const ola::rdm::UID &uid, + ola::SingleUseCallback1 *callback); + + bool RDMGet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + bool RDMSet(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + + /* + * This is called by the channel when new DMX data turns up + */ + void UpdateDmxData(::google::protobuf::RpcController* controller, + const ola::proto::DmxData* request, + ola::proto::Ack* response, + ::google::protobuf::Closure* done); + + // unfortunately all of these need to be public because they're used in the + // closures. That's why this class is wrapped in OlaClient or + // OlaCallbackClient. + typedef struct { + SimpleRpcController *controller; + ola::proto::PluginListReply *reply; + SingleUseCallback2&, + const string&> *callback; + } plugin_list_arg; + + void HandlePluginList(plugin_list_arg *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::PluginDescriptionReply *reply; + SingleUseCallback2 *callback; + } plugin_description_arg; + + void HandlePluginDescription(plugin_description_arg *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::DeviceInfoReply *reply; + SingleUseCallback2 &, + const string &> *callback; + } device_info_arg; + + void HandleDeviceInfo(device_info_arg *arg); + + typedef struct { + SimpleRpcController *controller; + ola::proto::DeviceConfigReply *reply; + SingleUseCallback2 *callback; + } configure_device_args; + + void HandleDeviceConfig(configure_device_args *arg); + + typedef struct { + SimpleRpcController *controller; + ola::proto::Ack *reply; + SingleUseCallback1 *callback; + } ack_args; + + void HandleAck(ack_args *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::UniverseInfoReply *reply; + SingleUseCallback2&, + const string&> *callback; + } universe_list_args; + + void HandleUniverseList(universe_list_args *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::UniverseInfoReply *reply; + SingleUseCallback2 *callback; + } universe_info_args; + + void HandleUniverseInfo(universe_info_args *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::DmxData *reply; + SingleUseCallback2 *callback; + } get_dmx_args; + + void HandleGetDmx(get_dmx_args *args); + + typedef struct { + SimpleRpcController *controller; + ola::proto::UIDListReply *reply; + SingleUseCallback2 *callback; + } uid_list_args; + + void HandleUIDList(uid_list_args *args); + + typedef struct { + ola::rdm::RDMAPIImplInterface::rdm_callback *callback; + SimpleRpcController *controller; + ola::proto::RDMResponse *reply; + } rdm_response_args; + void HandleRDM(rdm_response_args *args); + + private: + OlaClientCore(const OlaClientCore&); + OlaClientCore operator=(const OlaClientCore&); + + bool GenericFetchCandidatePorts( + unsigned int universe_id, + bool include_universe, + SingleUseCallback2&, + const string&> *callback); + + bool RDMCommand(ola::rdm::RDMAPIImplInterface::rdm_callback *callback, + bool is_set, + unsigned int universe, + const ola::rdm::UID &uid, + uint16_t sub_device, + uint16_t pid, + const uint8_t *data, + unsigned int data_length); + + template + arg_type *NewArgs( + SimpleRpcController *controller, + reply_type reply, + callback_type callback); + + template + void FreeArgs(arg_type *args); + + ConnectedSocket *m_socket; + Callback3 + *m_dmx_callback; + StreamRpcChannel *m_channel; + ola::proto::OlaServerService_Stub *m_stub; + int m_connected; +}; + + +/** + * Create a new args structure + */ +template +arg_type *OlaClientCore::NewArgs( + SimpleRpcController *controller, + reply_type reply, + callback_type callback) { + arg_type *args = new arg_type(); + args->controller = controller; + args->reply = reply; + args->callback = callback; + return args; +} + + +/** + * Free an args structure + */ +template +void OlaClientCore::FreeArgs(arg_type *args) { + delete args->controller; + delete args->reply; + delete args; +} +} // ola +#endif // OLA_OLACLIENTCORE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClientTester.cpp b/open-lighting-architecture/ola-0.8.4/ola/OlaClientTester.cpp new file mode 100644 index 0000000..79d7308 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClientTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * OlaClientTester.cpp + * Runs all the Ola Client tests + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.cpp b/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.cpp new file mode 100644 index 0000000..8b85e49 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.cpp @@ -0,0 +1,85 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClientWrapper.cpp + * Implementation of Simple Client + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +namespace ola { + +BaseClientWrapper::BaseClientWrapper() + : m_socket(NULL), + m_ss(NULL) { +} + + +BaseClientWrapper::~BaseClientWrapper() { + Cleanup(); +} + + +/* + * Setup the Simple Client + * @returns true on success, false on failure + */ +bool BaseClientWrapper::Setup() { + if (!m_ss) + m_ss = new SelectServer(); + + if (!m_socket) { + m_socket = TcpSocket::Connect("127.0.0.1", OLA_DEFAULT_PORT); + if (!m_socket) { + delete m_socket; + delete m_ss; + m_socket = NULL; + m_ss = NULL; + return false; + } + m_socket->SetOnClose( + ola::NewSingleClosure(this, &OlaClientWrapper::SocketClosed)); + } + + CreateClient(); + m_ss->AddSocket(m_socket); + return StartupClient(); +} + + +/* + * Close the ola connection. + * @return true on sucess, false on failure + */ +bool BaseClientWrapper::Cleanup() { + if (m_socket) + delete m_socket; + + if (m_ss) + delete m_ss; + return true; +} + +/* + * Called if the server closed the connection + */ +void BaseClientWrapper::SocketClosed() { + OLA_INFO << "Server closed the connection"; + m_ss->Terminate(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.h b/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.h new file mode 100644 index 0000000..268fed2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaClientWrapper.h @@ -0,0 +1,101 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaClientWrapper.h + * This provides a helpful wrapper for the OlaClient & OlaCallbackClient + * classes. + * Copyright (C) 2005-2008 Simon Newton + * + * The OlaClientWrapper classes takes care of setting up the socket, select + * server and client for you. + */ + +#ifndef OLA_OLACLIENTWRAPPER_H_ +#define OLA_OLACLIENTWRAPPER_H_ + +#include +#include +#include +#include + +namespace ola { + +using ola::network::SelectServer; +using ola::network::TcpSocket; + +/* + * The base class, not used directly. + */ +class BaseClientWrapper { + public: + BaseClientWrapper(); + virtual ~BaseClientWrapper(); + + SelectServer *GetSelectServer() const { return m_ss; } + + bool Setup(); + bool Cleanup(); + + void SocketClosed(); + + protected: + TcpSocket *m_socket; + + private: + virtual void CreateClient() = 0; + virtual bool StartupClient() = 0; + + SelectServer *m_ss; +}; + + +/* + * This wrapper uses the OlaClient class. + */ +template +class GenericClientWrapper: public BaseClientWrapper { + public: + GenericClientWrapper(): + BaseClientWrapper(), + m_client(NULL) { + } + ~GenericClientWrapper() { + if (m_client) + delete m_client; + } + + client_class *GetClient() const { return m_client; } + + private: + client_class *m_client; + + void CreateClient() { + if (!m_client) { + m_client = new client_class(m_socket); + } + } + bool StartupClient() { + return m_client->Setup(); + } +}; + +typedef GenericClientWrapper OlaClientWrapper; +// for historical reasons we typedef SimpleClient to OlaClientWrapper +typedef GenericClientWrapper SimpleClient; + + +typedef GenericClientWrapper OlaCallbackClientWrapper; +} // ola +#endif // OLA_OLACLIENTWRAPPER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/OlaDevice.h b/open-lighting-architecture/ola-0.8.4/ola/OlaDevice.h new file mode 100644 index 0000000..afde347 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/OlaDevice.h @@ -0,0 +1,218 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * OlaDevice.h + * Interface to the OLA Client Device class + * Copyright (C) 2005-2006 Simon Newton + */ + +#ifndef OLA_OLADEVICE_H_ +#define OLA_OLADEVICE_H_ + +#include +#include +#include + +namespace ola { + +using std::string; +using std::vector; + + +enum PatchAction {PATCH, UNPATCH}; +enum RegisterAction {REGISTER, UNREGISTER}; +enum PortDirection {INPUT_PORT, OUTPUT_PORT}; + + +/* + * Represents a Plugin + */ +class OlaPlugin { + public: + OlaPlugin(unsigned int id, const string &name): + m_id(id), + m_name(name) {} + ~OlaPlugin() {} + + unsigned int Id() const { return m_id; } + string Name() const { return m_name; } + + bool operator<(const OlaPlugin &other) const { + return m_id < other.m_id; + } + private: + unsigned int m_id; // id of this plugin + string m_name; // plugin name +}; + + +/* + * Represents a port + */ +class OlaPort { + public: + OlaPort(unsigned int port_id, + unsigned int universe, + bool active, + const string &description, + port_priority_capability capability, + port_priority_mode mode, + uint8_t priority): + m_id(port_id), + m_universe(universe), + m_active(active), + m_description(description), + m_priority_capability(capability), + m_priority_mode(mode), + m_priority(priority) {} + virtual ~OlaPort() {} + + unsigned int Id() const { return m_id; } + + unsigned int Universe() const { return m_universe; } + bool IsActive() const { return m_active; } + string Description() const { return m_description; } + + port_priority_capability PriorityCapability() const { + return m_priority_capability; + } + port_priority_mode PriorityMode() const { + return m_priority_mode; + } + uint8_t Priority() const { return m_priority; } + + private: + unsigned int m_id; // id of this port + unsigned int m_universe; // universe + bool m_active; // active + string m_description; + port_priority_capability m_priority_capability; + port_priority_mode m_priority_mode; + uint8_t m_priority; +}; + + +class OlaInputPort: public OlaPort { + public: + OlaInputPort(unsigned int port_id, + unsigned int universe, + bool active, + const string &description, + port_priority_capability capability, + port_priority_mode mode, + uint8_t priority): + OlaPort(port_id, universe, active, description, + capability, mode, priority) { + } +}; + + +class OlaOutputPort: public OlaPort { + public: + OlaOutputPort(unsigned int port_id, + unsigned int universe, + bool active, + const string &description, + port_priority_capability capability, + port_priority_mode mode, + uint8_t priority): + OlaPort(port_id, universe, active, description, + capability, mode, priority) { + } +}; + + +/* + * Represents a device + */ +class OlaDevice { + public: + OlaDevice(const string &id, + unsigned int alias, + const string &name, + int plugin_id, + const vector &input_ports, + const vector &output_ports): + m_id(id), + m_alias(alias), + m_name(name), + m_plugin_id(plugin_id), + m_input_ports(input_ports), + m_output_ports(output_ports) {} + ~OlaDevice() {} + + string Id() const { return m_id; } + unsigned int Alias() const { return m_alias; } + string Name() const { return m_name; } + int PluginId() const { return m_plugin_id; } + + const vector &InputPorts() const { return m_input_ports; } + const vector &OutputPorts() const { return m_output_ports; } + + bool operator<(const OlaDevice &other) const { + return m_alias < other.m_alias; + } + + private: + string m_id; // device id + unsigned int m_alias; // device alias + std::string m_name; // device name + int m_plugin_id; // parent plugin id + std::vector m_input_ports; + std::vector m_output_ports; +}; + + +/* + * Represents a universe + */ +class OlaUniverse { + public: + enum merge_mode { + MERGE_HTP, + MERGE_LTP, + }; + + OlaUniverse(unsigned int id, + merge_mode m, + const string &name, + unsigned int input_port_count, + unsigned int output_port_count, + unsigned int rdm_device_count): + m_id(id), + m_merge_mode(m), + m_name(name), + m_input_port_count(input_port_count), + m_output_port_count(output_port_count), + m_rdm_device_count(rdm_device_count) {} + ~OlaUniverse() {} + + unsigned int Id() const { return m_id;} + merge_mode MergeMode() const { return m_merge_mode; } + string Name() const { return m_name;} + unsigned int InputPortCount() const { return m_input_port_count; } + unsigned int OutputPortCount() const { return m_output_port_count; } + unsigned int RDMDeviceCount() const { return m_rdm_device_count; } + + private: + unsigned int m_id; // id of this universe + merge_mode m_merge_mode; // merge mode + string m_name; // universe name + unsigned int m_input_port_count; + unsigned int m_output_port_count; + unsigned int m_rdm_device_count; +}; +} // ola +#endif // OLA_OLADEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.cpp b/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.cpp new file mode 100644 index 0000000..10c7d44 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.cpp @@ -0,0 +1,156 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * StreamingClient.cpp + * Implementation of Streaming Client + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include "common/protocol/Ola.pb.h" +#include "common/rpc/StreamRpcChannel.h" + +namespace ola { + +using ola::rpc::StreamRpcChannel; +using ola::proto::OlaServerService_Stub; + +StreamingClient::StreamingClient() + : m_socket(NULL), + m_ss(NULL), + m_channel(NULL), + m_stub(NULL), + m_socket_closed(false) { +} + + +StreamingClient::~StreamingClient() { + Stop(); +} + + +/* + * Setup the Streaming Client + * @returns true on success, false on failure + */ +bool StreamingClient::Setup() { + if (m_socket || m_channel || m_stub) + return false; + + m_socket = TcpSocket::Connect("127.0.0.1", OLA_DEFAULT_PORT); + if (!m_socket) + return false; + + m_ss = new SelectServer(); + m_ss->AddSocket(m_socket); + + m_channel = new StreamRpcChannel(NULL, m_socket); + + if (!m_channel) { + delete m_socket; + m_socket = NULL; + return false; + } + + m_stub = new OlaServerService_Stub(m_channel); + + if (!m_stub) { + delete m_channel; + delete m_socket; + m_channel = NULL; + m_socket = NULL; + return false; + } + + m_socket->SetOnClose( + NewSingleClosure(this, &StreamingClient::SocketClosed)); + m_channel->SetOnClose( + NewSingleClosure(this, &StreamingClient::SocketClosed)); + + return true; +} + + +/* + * Close the ola connection. + */ +void StreamingClient::Stop() { + if (m_stub) + delete m_stub; + + if (m_channel) + delete m_channel; + + if (m_ss) + delete m_ss; + + if (m_socket) + delete m_socket; + + m_channel = NULL; + m_socket = NULL; + m_ss = NULL; + m_stub = NULL; +} + + +/* + * Send DMX to the remote OLA server + * @returns True is sent sucessfully, false if the connection to the server has + * been closed and Setup() needs to be run again. + */ +bool StreamingClient::SendDmx(unsigned int universe, + const DmxBuffer &data) { + if (!m_stub || + m_socket->ReadDescriptor() == ola::network::Socket::INVALID_SOCKET) + return false; + + // We select() on the fd here to see if the remove end has closed the + // connection. We could skip this and rely on the EPIPE delivered by the + // write() below, but that introduces a race condition in the unittests. + m_socket_closed = false; + m_ss->RunOnce(0, 0); + + if (m_socket_closed) { + Stop(); + return false; + } + + ola::proto::DmxData request; + request.set_universe(universe); + request.set_data(data.Get()); + m_stub->StreamDmxData(NULL, &request, NULL, NULL); + + if (m_socket_closed) { + Stop(); + return false; + } + return true; +} + + +/* + * Called when the socket is closed + */ +void StreamingClient::SocketClosed() { + m_socket_closed = true; + OLA_WARN << "The RPC socket has been closed, this is more than likely due" + << " to a framing error, perhaps you're sending too fast?"; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.h b/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.h new file mode 100644 index 0000000..2630d61 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/StreamingClient.h @@ -0,0 +1,70 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * StreamingClient.h + * Interface to the Streaming Client class. + * Copyright (C) 2005-2010 Simon Newton + * + * This client does one thing and one thing only. Sends DMX data to a OLA + * server. It doesn't support any callbacks. This is very useful in integrating + * OLA into programs like QLC and Max. + */ + +#ifndef OLA_STREAMINGCLIENT_H_ +#define OLA_STREAMINGCLIENT_H_ + +#include +#include +#include + +namespace ola { + +namespace rpc { + class StreamRpcChannel; +} + +namespace proto { + class OlaServerService_Stub; +} + +using ola::network::TcpSocket; +using ola::network::SelectServer; + +/* + * StreamingClient opens a connection and then sends data over the socket. + */ +class StreamingClient { + public: + StreamingClient(); + ~StreamingClient(); + + bool Setup(); + void Stop(); + + bool SendDmx(unsigned int universe, const DmxBuffer &data); + void SocketClosed(); + + private: + StreamingClient(const StreamingClient&); + StreamingClient operator=(const StreamingClient&); + + TcpSocket *m_socket; + SelectServer *m_ss; + class ola::rpc::StreamRpcChannel *m_channel; + class ola::proto::OlaServerService_Stub *m_stub; + bool m_socket_closed; +}; +} // ola +#endif // OLA_STREAMINGCLIENT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/ola/StreamingClientTest.cpp b/open-lighting-architecture/ola-0.8.4/ola/StreamingClientTest.cpp new file mode 100644 index 0000000..b5bba4f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/StreamingClientTest.cpp @@ -0,0 +1,174 @@ +/* + * 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 Library 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. + * + * StreamingClientTest.cpp + * Test fixture for the StreamingClient class + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include + +#include "ola/StreamingClient.h" +#include "ola/DmxBuffer.h" +#include "ola/OlaThread.h" +#include "ola/Logging.h" +#include "olad/OlaDaemon.h" + + +static unsigned int TEST_UNIVERSE = 1; + +using ola::OlaDaemon; + + +class StreamingClientTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(StreamingClientTest); + CPPUNIT_TEST(testSendDMX); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testSendDMX(); + + private: + class OlaServerThread *m_server_thread; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(StreamingClientTest); + + +/* + * The thread that the OlaServer runs in. + */ +class OlaServerThread: public ola::OlaThread { + public: + OlaServerThread() : + OlaThread(), + m_olad(NULL) { + } + ~OlaServerThread(); + bool Setup(); + void *Run(); + void Terminate(); + + private: + OlaDaemon *m_olad; +}; + + +OlaServerThread::~OlaServerThread() { + if (m_olad) { + delete m_olad; + m_olad = NULL; + } +} + + +bool OlaServerThread::Setup() { + ola::ola_server_options ola_options; + ola_options.http_enable = false; + ola_options.http_localhost_only = false; + ola_options.http_enable_quit = false; + ola_options.http_port = 0; + ola_options.http_data_dir = ""; + + m_olad = new OlaDaemon(ola_options); + if (!m_olad->Init()) { + delete m_olad; + m_olad = NULL; + return false; + } + return true; +} + + +/* + * Run the ola Server + */ +void *OlaServerThread::Run() { + if (m_olad) { + m_olad->Run(); + m_olad->Shutdown(); + } + return NULL; +} + + +/* + * Stop the OLA server + */ +void OlaServerThread::Terminate() { + if (m_olad) + m_olad->Terminate(); +} + + + +/* + * Startup the Ola server + */ +void StreamingClientTest::setUp() { + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + m_server_thread = new OlaServerThread(); + if (m_server_thread->Setup()) + m_server_thread->Start(); +} + + +/* + * Stop the ola Server + */ +void StreamingClientTest::tearDown() { + m_server_thread->Terminate(); + m_server_thread->Join(); + delete m_server_thread; +} + + +/* + * Check that the SendDMX method works correctly. + */ +void StreamingClientTest::testSendDMX() { + ola::StreamingClient ola_client; + + ola::DmxBuffer buffer; + buffer.Blackout(); + + // Setup the client, this connects to the server + CPPUNIT_ASSERT(ola_client.Setup()); + // Try it again to make sure it doesn't break + CPPUNIT_ASSERT(!ola_client.Setup()); + + CPPUNIT_ASSERT(ola_client.SendDmx(TEST_UNIVERSE, buffer)); + ola_client.Stop(); + + // Now reconnect + CPPUNIT_ASSERT(ola_client.Setup()); + CPPUNIT_ASSERT(ola_client.SendDmx(TEST_UNIVERSE, buffer)); + ola_client.Stop(); + + // Now Terminate the server mid flight + CPPUNIT_ASSERT(ola_client.Setup()); + CPPUNIT_ASSERT(ola_client.SendDmx(TEST_UNIVERSE, buffer)); + m_server_thread->Terminate(); + m_server_thread->Join(); + + CPPUNIT_ASSERT(!ola_client.SendDmx(TEST_UNIVERSE, buffer)); + ola_client.Stop(); + + CPPUNIT_ASSERT(!ola_client.Setup()); +} diff --git a/open-lighting-architecture/ola-0.8.4/ola/common-h.in b/open-lighting-architecture/ola-0.8.4/ola/common-h.in new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/ola/common-h.in @@ -0,0 +1 @@ + diff --git a/open-lighting-architecture/ola-0.8.4/olad/Client.cpp b/open-lighting-architecture/ola-0.8.4/olad/Client.cpp new file mode 100644 index 0000000..1cae788 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Client.cpp @@ -0,0 +1,107 @@ +/* + * 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 Library 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. + * + * Client.cpp + * Represents a connected client. + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include "common/protocol/Ola.pb.h" +#include "ola/Logging.h" +#include "olad/Client.h" + +namespace ola { + +using google::protobuf::NewCallback; +using ola::rpc::SimpleRpcController; + +Client::~Client() { + m_data_map.clear(); +} + + +/* + * Send a DMX Update to this client + * @param universe the universe_id for this data + * @param buffer the DmxBuffer with the data + * @return true if the update was sent, false otherwise + */ +bool Client::SendDMX(unsigned int universe, const DmxBuffer &buffer) { + if (!m_client_stub) { + OLA_FATAL << "client_stub is null"; + return false; + } + + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DmxData dmx_data; + ola::proto::Ack *ack = new ola::proto::Ack(); + + dmx_data.set_universe(universe); + dmx_data.set_data(buffer.Get()); + + m_client_stub->UpdateDmxData( + controller, + &dmx_data, + ack, + NewCallback(this, &ola::Client::SendDMXCallback, controller, ack)); + return true; +} + + +/* + * Called when UpdateDmxData completes + */ +void Client::SendDMXCallback(SimpleRpcController *controller, + ola::proto::Ack *reply) { + delete controller; + delete reply; +} + + +/* + * Called when this client sends us new data + * @param universe the id of the universe for the new data + * @param buffer the new data + */ +void Client::DMXRecieved(unsigned int universe, const DmxSource &source) { + map::iterator iter = m_data_map.find(universe); + + if (iter != m_data_map.end()) { + iter->second = source; + } else { + std::pair pair(universe, source); + m_data_map.insert(pair); + } +} + + +/* + * Return the last dmx data sent by this client + * @param universe the id of the universe we're interested in + */ +const DmxSource Client::SourceData(unsigned int universe) const { + map::const_iterator iter = + m_data_map.find(universe); + + if (iter != m_data_map.end()) { + return iter->second; + } else { + DmxSource source; + return source; + } +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/Client.h b/open-lighting-architecture/ola-0.8.4/olad/Client.h new file mode 100644 index 0000000..86baf96 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Client.h @@ -0,0 +1,61 @@ +/* + * 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 Library 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. + * + * client.h + * Header file for the client class + * Copyright (C) 2005 Simon Newton + */ + +#ifndef OLAD_CLIENT_H_ +#define OLAD_CLIENT_H_ + +#include +#include "common/rpc/SimpleRpcController.h" +#include "olad/DmxSource.h" + +namespace ola { +namespace proto { + class OlaClientService_Stub; + class Ack; +} +} + +namespace ola { + +using std::map; +using ola::proto::OlaClientService_Stub; + +class Client { + public : + explicit Client(OlaClientService_Stub *client_stub): + m_client_stub(client_stub) {} + virtual ~Client(); + virtual bool SendDMX(unsigned int universe_id, const DmxBuffer &buffer); + + void SendDMXCallback(ola::rpc::SimpleRpcController *controller, + ola::proto::Ack *ack); + void DMXRecieved(unsigned int universe, const DmxSource &source); + const DmxSource SourceData(unsigned int universe) const; + class OlaClientService_Stub *Stub() const { return m_client_stub; } + + private: + Client(const Client&); + Client& operator=(const Client&); + + class OlaClientService_Stub *m_client_stub; + map m_data_map; +}; +} // ola +#endif // OLAD_CLIENT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/ClientTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/ClientTest.cpp new file mode 100644 index 0000000..dbd31aa --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/ClientTest.cpp @@ -0,0 +1,142 @@ +/* + * 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 Library 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. + * + * ClientTest.cpp + * Test fixture for the Client class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include + +#include "ola/Clock.h" +#include "ola/DmxBuffer.h" +#include "olad/DmxSource.h" +#include "olad//Client.h" +#include "common/protocol/Ola.pb.h" + + +static unsigned int TEST_UNIVERSE = 1; +static unsigned int TEST_UNIVERSE2 = 2; +static const char TEST_DATA[] = "this is some test data"; +static const char TEST_DATA2[] = "another set of test data"; + +using ola::Client; +using ola::DmxBuffer; +using std::string; + + +class ClientTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ClientTest); + CPPUNIT_TEST(testSendDMX); + CPPUNIT_TEST(testGetSetDMX); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSendDMX(); + void testGetSetDMX(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(ClientTest); + + +/* + * Mock out the ClientStub for testing + */ +class MockClientStub: public ola::proto::OlaClientService_Stub { + public: + MockClientStub(): ola::proto::OlaClientService_Stub(NULL) {} + void UpdateDmxData(::google::protobuf::RpcController* controller, + const ::ola::proto::DmxData* request, + ::ola::proto::Ack* response, + ::google::protobuf::Closure* done); +}; + + + +void MockClientStub::UpdateDmxData( + ::google::protobuf::RpcController* controller, + const ::ola::proto::DmxData* request, + ::ola::proto::Ack* response, + ::google::protobuf::Closure* done) { + + CPPUNIT_ASSERT(controller); + CPPUNIT_ASSERT(!controller->Failed()); + CPPUNIT_ASSERT_EQUAL(TEST_UNIVERSE, (unsigned int) request->universe()); + CPPUNIT_ASSERT(TEST_DATA == request->data()); + done->Run(); + (void) response; +} + + +/* + * Check that the SendDMX method works correctly. + */ +void ClientTest::testSendDMX() { + // check we survive a null pointer + const DmxBuffer buffer(TEST_DATA); + Client client(NULL); + CPPUNIT_ASSERT(NULL == client.Stub()); + client.SendDMX(TEST_UNIVERSE, buffer); + + // check the stub is called correctly + MockClientStub client_stub; + Client client2(&client_stub); + CPPUNIT_ASSERT(&client_stub == client2.Stub()); + client2.SendDMX(TEST_UNIVERSE, buffer); +} + + +/* + * Check that the DMX get/set works correctly. + */ +void ClientTest::testGetSetDMX() { + DmxBuffer buffer(TEST_DATA); + const DmxBuffer empty; + Client client(NULL); + + ola::TimeStamp timestamp; + ola::Clock::CurrentTime(×tamp); + ola::DmxSource source(buffer, timestamp, 100); + + // check get/set works + client.DMXRecieved(TEST_UNIVERSE, source); + const ola::DmxSource &source2 = client.SourceData(TEST_UNIVERSE); + CPPUNIT_ASSERT(source2.IsSet()); + CPPUNIT_ASSERT(source2.Data() == buffer); + CPPUNIT_ASSERT_EQUAL(timestamp, source2.Timestamp()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 100, source2.Priority()); + + // check update works + ola::DmxBuffer old_data(buffer); + buffer.Set(TEST_DATA2); + CPPUNIT_ASSERT(source2.Data() == old_data); + CPPUNIT_ASSERT_EQUAL(timestamp, source2.Timestamp()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 100, source2.Priority()); + + source.UpdateData(buffer, timestamp, 120); + client.DMXRecieved(TEST_UNIVERSE, source); + const ola::DmxSource source3 = client.SourceData(TEST_UNIVERSE); + CPPUNIT_ASSERT(source3.IsSet()); + CPPUNIT_ASSERT(buffer == source3.Data()); + CPPUNIT_ASSERT_EQUAL(timestamp, source3.Timestamp()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 120, source3.Priority()); + + // check fetching an unknown universe results in an empty buffer + const ola::DmxSource source4 = client.SourceData(TEST_UNIVERSE2); + CPPUNIT_ASSERT(!source4.IsSet()); + CPPUNIT_ASSERT(empty == source4.Data()); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/Device.cpp b/open-lighting-architecture/ola-0.8.4/olad/Device.cpp new file mode 100644 index 0000000..8a7b4ce --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Device.cpp @@ -0,0 +1,238 @@ +/* + * 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 Library 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. + * + * Device.cpp + * Base implementation of the device class. + * Copyright (C) 2005-2008 Simon Newton + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/Device.h" +#include "olad/Plugin.h" +#include "olad/Port.h" +#include "olad/Universe.h" + +namespace ola { + +using google::protobuf::RpcController; +using google::protobuf::Closure; +using std::pair; + +/* + * Create a new device + * @param owner the plugin that owns this device + * @param name a nice name for this device + */ +Device::Device(AbstractPlugin *owner, const string &name) + : AbstractDevice(), + m_enabled(false), + m_owner(owner), + m_name(name) { +} + + +/* + * Stop this device + */ +Device::~Device() { + // we can't call stop from here because it uses virtual methods + if (m_enabled) + OLA_FATAL << "Device " << m_name << " wasn't stopped before deleting, " << + "this represents a serious programming error."; +} + + +/* + * Start the Device + */ +bool Device::Start() { + if (m_enabled) + return true; + + bool ret = StartHook(); + if (ret) + m_enabled = true; + return ret; +} + + +/* + * Stop this device + */ +bool Device::Stop() { + if (!m_enabled) + return true; + + PrePortStop(); + DeleteAllPorts(); + PostPortStop(); + + m_enabled = false; + return true; +} + + +/* + * Add a port to this device + * @param port the port to add + * @return true on success, false if the port already exists + */ +bool Device::AddPort(InputPort *port) { + return GenericAddPort(port, &m_input_ports); +} + + +/* + * Add a port to this device + * @param port the port to add + * @return 0 on success, non 0 on failure + */ +bool Device::AddPort(OutputPort *port) { + return GenericAddPort(port, &m_output_ports); +} + +void Device::InputPorts(vector *ports) const { + GenericFetchPortsVector(ports, m_input_ports); +} + + +void Device::OutputPorts(vector *ports) const { + GenericFetchPortsVector(ports, m_output_ports); +} + +/* + * Returns the InputPort with the id port_id + */ +InputPort *Device::GetInputPort(unsigned int port_id) const { + map::const_iterator iter = + m_input_ports.find(port_id); + + if (iter == m_input_ports.end()) + return NULL; + return iter->second; +} + + +/* + * Returns the OutputPort with the id port_id + */ +OutputPort *Device::GetOutputPort(unsigned int port_id) const { + map::const_iterator iter = + m_output_ports.find(port_id); + + if (iter == m_output_ports.end()) + return NULL; + return iter->second; +} + + +/* + * Delete all ports and clear the port list + */ +void Device::DeleteAllPorts() { + map::iterator input_iter; + map::iterator output_iter; + for (input_iter = m_input_ports.begin(); input_iter != m_input_ports.end(); + ++input_iter) { + GenericDeletePort(input_iter->second); + } + for (output_iter = m_output_ports.begin(); + output_iter != m_output_ports.end(); ++output_iter) { + GenericDeletePort(output_iter->second); + } + m_input_ports.clear(); + m_output_ports.clear(); +} + + +/* + * Returns a unique id for this device + */ +string Device::UniqueId() const { + if (m_unique_id.empty()) { + if (!Owner()) { + OLA_WARN << "Device: " << Name() << " missing owner"; + return ""; + } + + std::stringstream str; + str << Owner()->Id() << "-" << DeviceId(); + m_unique_id = str.str(); + } + return m_unique_id; +} + +/* + * Device Config request + */ +void Device::Configure(RpcController *controller, + const string &request, + string *response, + Closure *done) { + controller->SetFailed("Not Implemented"); + done->Run(); + (void) request; + (void) response; +} + + +template +bool Device::GenericAddPort(PortClass *port, + map *port_map) { + if (!port) + return false; + + typename map::iterator iter = + port_map->find(port->PortId()); + if (iter == port_map->end()) { + pair p(port->PortId(), port); + port_map->insert(p); + return true; + } else if (iter->second != port) { + OLA_WARN << "Attempt to insert a port but this port id is already " << + "associated with a diferent port."; + return true; + } + return true; +} + + +template +void Device::GenericFetchPortsVector( + vector *ports, + const map &port_map) const { + typename map::const_iterator iter; + for (iter = port_map.begin(); iter != port_map.end(); ++iter) { + ports->push_back(iter->second); + } +} + + +template +void Device::GenericDeletePort(PortClass *port) { + Universe *universe = port->GetUniverse(); + if (universe) + universe->RemovePort(port); + delete port; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.cpp b/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.cpp new file mode 100644 index 0000000..df6f54b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.cpp @@ -0,0 +1,385 @@ +/* + * 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 Library 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. + * + * devicemanager.cpp + * Implementation of the device manager, this object tracks what devices are in + * use. + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/Port.h" +#include "olad/PortManager.h" +#include "olad/DeviceManager.h" + +namespace ola { + +const unsigned int DeviceManager::MISSING_DEVICE_ALIAS = 0; +const char DeviceManager::PORT_PREFERENCES[] = "port"; +const char DeviceManager::PRIORITY_VALUE_SUFFIX[] = "_priority_value"; +const char DeviceManager::PRIORITY_MODE_SUFFIX[] = "_priority_mode"; + +bool operator <(const device_alias_pair& left, + const device_alias_pair &right) { + if (left.alias < right.alias) + return true; + return false; +} + + +/* + * Constructor + */ +DeviceManager::DeviceManager(PreferencesFactory *prefs_factory, + PortManager *port_manager) + : m_port_preferences(NULL), + m_port_manager(port_manager), + m_next_device_alias(FIRST_DEVICE_ALIAS) { + if (prefs_factory) { + m_port_preferences = prefs_factory->NewPreference(PORT_PREFERENCES); + m_port_preferences->Load(); + } +} + + +/* + * Cleanup + */ +DeviceManager::~DeviceManager() { + if (m_port_preferences) + m_port_preferences->Save(); +} + + +/* + * Register a device + * @param device pointer to the device to register + * @return true on success, false on failure + */ +bool DeviceManager::RegisterDevice(AbstractDevice *device) { + if (!device) + return false; + + string device_id = device->UniqueId(); + + if (device_id.empty()) { + OLA_WARN << "Device: " << device->Name() << " is missing UniqueId"; + return false; + } + + unsigned int alias; + map::iterator iter = m_devices.find(device_id); + if (iter != m_devices.end()) { + if (iter->second.device) { + // already registered + OLA_INFO << "Device " << device_id << " is already registered"; + return false; + } else { + // was previously registered, reuse alias + alias = iter->second.alias; + iter->second.device = device; + } + } else { + alias = m_next_device_alias++; + device_alias_pair pair; + pair.alias = alias; + pair.device = device; + m_devices[device_id] = pair; + } + + m_alias_map[alias] = device; + OLA_INFO << "Installed device: " << device->Name() << ":" << + device->UniqueId(); + + RestoreDevicePortSettings(device); + return true; +} + + +/* + * Unregister a device + * @param device_id the id of the device to remove + * @return true on sucess, false on failure + */ +bool DeviceManager::UnregisterDevice(const string &device_id) { + map::iterator iter = + m_devices.find(device_id); + + if (iter == m_devices.end() || !iter->second.device) { + OLA_WARN << "Device " << device_id << "not found"; + return false; + } + + SaveDevicePortSettings(iter->second.device); + map::iterator alias_iter = + m_alias_map.find(iter->second.alias); + + if (alias_iter != m_alias_map.end()) + m_alias_map.erase(alias_iter); + + iter->second.device = NULL; + return true; +} + +/* + * Unregister a Device + * @param device a pointer to the device + * @return true on sucess, false on failure + */ +bool DeviceManager::UnregisterDevice(const AbstractDevice *device) { + if (!device) + return false; + + string device_id = device->UniqueId(); + if (device_id.empty()) + return false; + + return UnregisterDevice(device_id); +} + + +/* + * Return the number of active devices + * @return the number of active devices + */ +unsigned int DeviceManager::DeviceCount() const { + unsigned int count = 0; + map::const_iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) + if (iter->second.device) + count++; + + return count; +} + + +/* + * Return a list of all the devices + * @return a vector of device_alias_pairs + */ +vector DeviceManager::Devices() const { + vector result; + map::const_iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) + if (iter->second.device) + result.push_back(iter->second); + + return result; +} + + +/* + * Find the device with the given alias. + * @return a pointer to the device or NULL if the device wasn't found. + */ +AbstractDevice *DeviceManager::GetDevice(unsigned int alias) const { + map::const_iterator alias_iter = + m_alias_map.find(alias); + if (alias_iter != m_alias_map.end()) + return alias_iter->second; + return NULL; +} + + +/* + * Return the device_alias_pair corresponding to the device with the given ID. + * @param unique_id the unique id of the device + * @return a device_alias_pair, if the device isn't found the alias is set to + * MISSING_DEVICE_ALIAS and the device pointer is NULL. + */ +device_alias_pair DeviceManager::GetDevice(const string &unique_id) const { + device_alias_pair result; + map::const_iterator iter = + m_devices.find(unique_id); + + if (iter != m_devices.end() && iter->second.device) + return iter->second; + + result.alias = MISSING_DEVICE_ALIAS; + result.device = NULL; + return result; +} + + +/* + * Remove all devices and reset the device counter + */ +void DeviceManager::UnregisterAllDevices() { + map::iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) { + SaveDevicePortSettings(iter->second.device); + iter->second.device = NULL; + } + m_alias_map.clear(); +} + + +/* + * Save the port universe patchings for a device + * @param device the device to save the settings for + */ +void DeviceManager::SaveDevicePortSettings(const AbstractDevice *device) { + if (!m_port_preferences || !device) + return; + + vector input_ports; + vector output_ports; + device->InputPorts(&input_ports); + device->OutputPorts(&output_ports); + SavePortPatchings(input_ports); + SavePortPatchings(output_ports); + + vector::const_iterator input_iter = input_ports.begin(); + for (; input_iter != input_ports.end(); ++input_iter) + SavePortPriority(**input_iter); + vector::const_iterator output_iter = output_ports.begin(); + for (; output_iter != output_ports.end(); ++output_iter) + SavePortPriority(**output_iter); +} + + +/* + * Restore the port universe patchings for a list of ports. + */ +void DeviceManager::RestoreDevicePortSettings(AbstractDevice *device) { + if (!m_port_preferences || !device) + return; + + vector input_ports; + vector output_ports; + device->InputPorts(&input_ports); + device->OutputPorts(&output_ports); + RestorePortPatchings(input_ports); + RestorePortPatchings(output_ports); + + vector::const_iterator input_iter = input_ports.begin(); + for (; input_iter != input_ports.end(); ++input_iter) + RestorePortPriority(*input_iter); + vector::const_iterator output_iter = output_ports.begin(); + for (; output_iter != output_ports.end(); ++output_iter) + RestorePortPriority(*output_iter); +} + + +/* + * Save the patching information for a list of ports. + */ +template +void DeviceManager::SavePortPatchings(const vector &ports) const { + typename vector::const_iterator iter = ports.begin(); + while (iter != ports.end()) { + string port_id = (*iter)->UniqueId(); + if (port_id.empty()) + return; + + if ((*iter)->GetUniverse()) { + m_port_preferences->SetValue( + port_id, + IntToString((*iter)->GetUniverse()->UniverseId())); + } else { + m_port_preferences->RemoveValue(port_id); + } + iter++; + } +} + + +/* + * Save the priorities for all ports on this device + */ +void DeviceManager::SavePortPriority(const Port &port) const { + if (port.PriorityCapability() == CAPABILITY_NONE) + return; + + string port_id = port.UniqueId(); + if (port_id.empty()) + return; + + m_port_preferences->SetValue(port_id + PRIORITY_VALUE_SUFFIX, + IntToString(port.GetPriority())); + + if (port.PriorityCapability() == CAPABILITY_FULL) + m_port_preferences->SetValue(port_id + PRIORITY_MODE_SUFFIX, + IntToString(port.GetPriorityMode())); +} + + +/* + * Restore the priority settings for a port + */ +void DeviceManager::RestorePortPriority(Port *port) const { + if (port->PriorityCapability() == CAPABILITY_NONE) + return; + + string port_id = port->UniqueId(); + if (port_id.empty()) + return; + + string priority_str = m_port_preferences->GetValue( + port_id + PRIORITY_VALUE_SUFFIX); + string priority_mode_str = m_port_preferences->GetValue( + port_id + PRIORITY_MODE_SUFFIX); + + if (priority_str.empty() && priority_mode_str.empty()) + return; + + uint8_t priority, priority_mode; + // setting the priority to overide mode first means we remember the over + // value even if it's in inherit mode + if (StringToUInt8(priority_str, &priority)) + m_port_manager->SetPriorityOverride(port, priority); + + if (StringToUInt8(priority_mode_str, &priority_mode)) { + if (priority_mode == PRIORITY_MODE_INHERIT) + m_port_manager->SetPriorityInherit(port); + } +} + + +/* + * Restore the patching information for a port. + */ +template +void DeviceManager::RestorePortPatchings( + const vector &ports) const { + typename vector::const_iterator iter = ports.begin(); + while (iter != ports.end()) { + PortClass *port = *iter; + iter++; + + string port_id = port->UniqueId(); + if (port_id.empty()) + continue; + + string uni_id = m_port_preferences->GetValue(port_id); + if (uni_id.empty()) + continue; + + errno = 0; + int id = static_cast(strtol(uni_id.data(), NULL, 10)); + if ((id == 0 && errno) || id < 0) + continue; + + m_port_manager->PatchPort(port, id); + } +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.h b/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.h new file mode 100644 index 0000000..541d993 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DeviceManager.h @@ -0,0 +1,97 @@ +/* + * 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 Library 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. + * + * DeviceManager.h + * Interface to the DeviceManager class + * Copyright (C) 2005-2009 Simon Newton + * + * The DeviceManager assigns an unsigned int as an alias to each device which + * remains consistent throughout the lifetime of the DeviceManager. These are + * used in the user facing portion as '1' is easier to understand/type + * than 5-02050016. If a device is registered, then unregistered, then + * registered again, it'll have the same device alias. + * + * The DeviceManager is also responsible for restoring the port patchings when + * devices are registered. + */ + +#ifndef OLAD_DEVICEMANAGER_H_ +#define OLAD_DEVICEMANAGER_H_ + +#include +#include +#include +#include "olad/Device.h" +#include "olad/Preferences.h" + +namespace ola { + +using std::map; +using std::string; + + +// pair a device with it's alias +typedef struct { + unsigned int alias; + AbstractDevice *device; +} device_alias_pair; + +bool operator <(const device_alias_pair& left, const device_alias_pair &right); + +class DeviceManager { + public: + DeviceManager(PreferencesFactory *prefs_factory, + class PortManager *port_manager); + ~DeviceManager(); + + bool RegisterDevice(AbstractDevice *device); + bool UnregisterDevice(const string &device_id); + bool UnregisterDevice(const AbstractDevice *device); + unsigned int DeviceCount() const; + vector Devices() const; + AbstractDevice *GetDevice(unsigned int alias) const; + device_alias_pair GetDevice(const string &unique_id) const; + void UnregisterAllDevices(); + + static const unsigned int MISSING_DEVICE_ALIAS; + static const char PRIORITY_VALUE_SUFFIX[]; + static const char PRIORITY_MODE_SUFFIX[]; + + private: + Preferences *m_port_preferences; + class PortManager *m_port_manager; + map m_devices; // map device_ids to devices + map m_alias_map; // map alias to devices + unsigned int m_next_device_alias; + + DeviceManager(const DeviceManager&); + DeviceManager& operator=(const DeviceManager&); + void SaveDevicePortSettings(const AbstractDevice *device); + void RestoreDevicePortSettings(AbstractDevice *device); + + template + void SavePortPatchings(const vector &ports) const; + + void SavePortPriority(const Port &port) const; + void RestorePortPriority(Port *port) const; + + template + void RestorePortPatchings(const vector &ports) const; + + static const char PORT_PREFERENCES[]; + static const unsigned int FIRST_DEVICE_ALIAS = 1; +}; +} // ola +#endif // OLAD_DEVICEMANAGER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/DeviceManagerTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/DeviceManagerTest.cpp new file mode 100644 index 0000000..190e6e9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DeviceManagerTest.cpp @@ -0,0 +1,305 @@ +/* + * 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 Library 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. + * + * DeviceManagerTest.cpp + * Test fixture for the DeviceManager class. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/DmxBuffer.h" +#include "olad/DeviceManager.h" +#include "olad/Plugin.h" +#include "olad/Port.h" +#include "olad/PortManager.h" +#include "olad/Preferences.h" +#include "olad/TestCommon.h" +#include "olad/UniverseStore.h" + +using ola::AbstractDevice; +using ola::AbstractPlugin; +using ola::DeviceManager; +using ola::DmxBuffer; +using ola::Port; +using ola::PortManager; +using ola::Universe; +using ola::UniverseStore; +using std::string; +using std::vector; + + +class DeviceManagerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DeviceManagerTest); + CPPUNIT_TEST(testDeviceManager); + CPPUNIT_TEST(testRestorePatchings); + CPPUNIT_TEST(testRestorePriorities); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDeviceManager(); + void testRestorePatchings(); + void testRestorePriorities(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(DeviceManagerTest); + + +/* + * Test that we can register devices and retrieve them. + */ +void DeviceManagerTest::testDeviceManager() { + DeviceManager manager(NULL, NULL); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + + TestMockPlugin plugin(NULL, ola::OLA_PLUGIN_ARTNET); + MockDevice orphaned_device(NULL, "orphaned device"); + MockDevice device1(&plugin, "test device 1"); + MockDevice device2(&plugin, "test device 2"); + + // can't register NULL + CPPUNIT_ASSERT(!manager.RegisterDevice(NULL)); + + // Can't register a device with no unique id + CPPUNIT_ASSERT(!manager.RegisterDevice(&orphaned_device)); + + // register a device + CPPUNIT_ASSERT(manager.RegisterDevice(&device1)); + // the second time must fail + CPPUNIT_ASSERT(!manager.RegisterDevice(&device1)); + + // register a second device + CPPUNIT_ASSERT(manager.RegisterDevice(&device2)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, manager.DeviceCount()); + + vector devices = manager.Devices(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, devices[0].alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + devices[0].device); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, devices[1].alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device2), + devices[1].device); + + // test fetching a device by alias + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + manager.GetDevice(1)); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device2), + manager.GetDevice(2)); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), + manager.GetDevice(3)); + + // test fetching a device by id + ola::device_alias_pair result = manager.GetDevice(device1.UniqueId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, result.alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + result.device); + result = manager.GetDevice(device2.UniqueId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, result.alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device2), + result.device); + result = manager.GetDevice("foo"); + CPPUNIT_ASSERT_EQUAL(DeviceManager::MISSING_DEVICE_ALIAS, result.alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), result.device); + result = manager.GetDevice(""); + CPPUNIT_ASSERT_EQUAL(DeviceManager::MISSING_DEVICE_ALIAS, result.alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), result.device); + + // test unregistering null or non-registered device + CPPUNIT_ASSERT(!manager.UnregisterDevice(NULL)); + CPPUNIT_ASSERT(!manager.UnregisterDevice(&orphaned_device)); + + // unregistering the first device doesn't change the ID of the second + CPPUNIT_ASSERT(manager.UnregisterDevice(&device1)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, manager.DeviceCount()); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), + manager.GetDevice(1)); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device2), + manager.GetDevice(2)); + + // unregister by id + CPPUNIT_ASSERT(!manager.UnregisterDevice(device1.UniqueId())); + CPPUNIT_ASSERT(manager.UnregisterDevice(device2.UniqueId())); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + manager.UnregisterAllDevices(); + + // add one back and check that ids reset + CPPUNIT_ASSERT(manager.RegisterDevice(&device1)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, manager.DeviceCount()); + devices = manager.Devices(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, devices[0].alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + devices[0].device); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + manager.GetDevice(1)); + result = manager.GetDevice(device1.UniqueId()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, result.alias); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&device1), + result.device); +} + + +/* + * Check that we restore the port patchings + */ +void DeviceManagerTest::testRestorePatchings() { + ola::MemoryPreferencesFactory prefs_factory; + UniverseStore uni_store(NULL, NULL); + PortManager port_manager(&uni_store); + DeviceManager manager(&prefs_factory, &port_manager); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + + ola::Preferences *prefs = prefs_factory.NewPreference("port"); + CPPUNIT_ASSERT(prefs); + prefs->SetValue("2-test_device_1-I-1", "1"); + prefs->SetValue("2-test_device_1-O-1", "3"); + + TestMockPlugin plugin(NULL, ola::OLA_PLUGIN_ARTNET); + MockDevice device1(&plugin, "test_device_1"); + TestMockInputPort input_port(&device1, 1, NULL); + TestMockOutputPort output_port(&device1, 1); + device1.AddPort(&input_port); + device1.AddPort(&output_port); + + CPPUNIT_ASSERT(manager.RegisterDevice(&device1)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, manager.DeviceCount()); + CPPUNIT_ASSERT(input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(input_port.GetUniverse()->UniverseId(), + (unsigned int) 1); + CPPUNIT_ASSERT(output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(output_port.GetUniverse()->UniverseId(), + (unsigned int) 3); + + // Now check that patching a universe saves the settings + Universe *uni = uni_store.GetUniverseOrCreate(10); + CPPUNIT_ASSERT(uni); + input_port.SetUniverse(uni); + + // unregister all + manager.UnregisterAllDevices(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + + CPPUNIT_ASSERT_EQUAL(string("10"), prefs->GetValue("2-test_device_1-I-1")); + CPPUNIT_ASSERT_EQUAL(string("3"), prefs->GetValue("2-test_device_1-O-1")); +} + + + +/* + * Test that port priorities are restored correctly. + */ +void DeviceManagerTest::testRestorePriorities() { + ola::MemoryPreferencesFactory prefs_factory; + UniverseStore uni_store(NULL, NULL); + PortManager port_manager(&uni_store); + DeviceManager manager(&prefs_factory, &port_manager); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + + ola::Preferences *prefs = prefs_factory.NewPreference("port"); + CPPUNIT_ASSERT(prefs); + prefs->SetValue("2-test_device_1-I-1_priority_mode", "0"); + prefs->SetValue("2-test_device_1-I-1_priority_value", "120"); + prefs->SetValue("2-test_device_1-O-1_priority_mode", "0"); + prefs->SetValue("2-test_device_1-O-1_priority_value", "140"); + prefs->SetValue("2-test_device_1-I-2_priority_mode", "1"); // override mode + prefs->SetValue("2-test_device_1-I-2_priority_value", "160"); + prefs->SetValue("2-test_device_1-O-2_priority_mode", "1"); // override mode + prefs->SetValue("2-test_device_1-O-2_priority_value", "180"); + prefs->SetValue("2-test_device_1-I-3_priority_mode", "0"); // inherit mode + // invalid priority + prefs->SetValue("2-test_device_1-I-3_priority_value", "210"); + prefs->SetValue("2-test_device_1-O-3_priority_mode", "0"); // inherit mode + prefs->SetValue("2-test_device_1-O-3_priority_value", "180"); + + TestMockPlugin plugin(NULL, ola::OLA_PLUGIN_ARTNET); + MockDevice device1(&plugin, "test_device_1"); + // these ports don't support priorities. + TestMockInputPort input_port(&device1, 1, NULL); + TestMockOutputPort output_port(&device1, 1); + // these devices support priorities + TestMockPriorityInputPort input_port2(&device1, 2, NULL); + TestMockPriorityOutputPort output_port2(&device1, 2); + TestMockPriorityInputPort input_port3(&device1, 3, NULL); + TestMockPriorityOutputPort output_port3(&device1, 3); + device1.AddPort(&input_port); + device1.AddPort(&output_port); + device1.AddPort(&input_port2); + device1.AddPort(&output_port2); + device1.AddPort(&input_port3); + device1.AddPort(&output_port3); + + CPPUNIT_ASSERT(manager.RegisterDevice(&device1)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, manager.DeviceCount()); + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_STATIC, + input_port.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + input_port.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 120, input_port.GetPriority()); + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_NONE, + output_port.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + output_port.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 100, output_port.GetPriority()); + + // these ports support priorities + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_FULL, + input_port2.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_OVERRIDE, + input_port2.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 160, input_port2.GetPriority()); + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_FULL, + output_port2.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_OVERRIDE, + output_port2.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 180, output_port2.GetPriority()); + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_FULL, + input_port3.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + input_port3.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 200, input_port3.GetPriority()); + CPPUNIT_ASSERT_EQUAL(ola::CAPABILITY_FULL, + output_port3.PriorityCapability()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + output_port3.GetPriorityMode()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 180, output_port3.GetPriority()); + + // Now make some changes + input_port2.SetPriorityMode(ola::PRIORITY_MODE_INHERIT); + output_port2.SetPriorityMode(ola::PRIORITY_MODE_INHERIT); + input_port3.SetPriorityMode(ola::PRIORITY_MODE_OVERRIDE); + input_port3.SetPriority(40); + output_port3.SetPriorityMode(ola::PRIORITY_MODE_OVERRIDE); + output_port3.SetPriority(60); + + // unregister all + manager.UnregisterAllDevices(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, manager.DeviceCount()); + + CPPUNIT_ASSERT_EQUAL(string("0"), + prefs->GetValue("2-test_device_1-I-2_priority_mode")); + CPPUNIT_ASSERT_EQUAL(string("0"), + prefs->GetValue("2-test_device_1-O-2_priority_mode")); + CPPUNIT_ASSERT_EQUAL(string("1"), + prefs->GetValue("2-test_device_1-I-3_priority_mode")); + CPPUNIT_ASSERT_EQUAL(string("40"), + prefs->GetValue("2-test_device_1-I-3_priority_value")); + CPPUNIT_ASSERT_EQUAL(string("1"), + prefs->GetValue("2-test_device_1-O-3_priority_mode")); + CPPUNIT_ASSERT_EQUAL(string("60"), + prefs->GetValue("2-test_device_1-O-3_priority_value")); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/DeviceTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/DeviceTest.cpp new file mode 100644 index 0000000..26f7d82 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DeviceTest.cpp @@ -0,0 +1,110 @@ +/* + * 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 Library 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. + * + * DeviceTest.cpp + * Test fixture for the Device class. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +#include "olad/Device.h" +#include "olad/Plugin.h" +#include "olad/Port.h" +#include "olad/Preferences.h" +#include "olad/TestCommon.h" + +using ola::AbstractDevice; +using ola::AbstractPlugin; +using ola::InputPort; +using ola::OutputPort; +using std::string; +using std::vector; + + +class DeviceTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DeviceTest); + CPPUNIT_TEST(testDevice); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDevice(); + + private: + void AddPortsToDeviceAndCheck(ola::Device *device); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(DeviceTest); + + +/* + * Check that the base device class works correctly. + */ +void DeviceTest::testDevice() { + string device_name = "test"; + MockDevice orphaned_device(NULL, device_name); + + CPPUNIT_ASSERT_EQUAL(device_name, orphaned_device.Name()); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(NULL), + orphaned_device.Owner()); + CPPUNIT_ASSERT_EQUAL(string(""), orphaned_device.UniqueId()); + AddPortsToDeviceAndCheck(&orphaned_device); + + // Non orphaned device + TestMockPlugin plugin(NULL, ola::OLA_PLUGIN_ARTNET); + MockDevice device(&plugin, device_name); + CPPUNIT_ASSERT_EQUAL(device.Name(), device_name); + CPPUNIT_ASSERT_EQUAL(reinterpret_cast(&plugin), + device.Owner()); + CPPUNIT_ASSERT_EQUAL(string("2-test"), device.UniqueId()); + AddPortsToDeviceAndCheck(&device); +} + + +void DeviceTest::AddPortsToDeviceAndCheck(ola::Device *device) { + // check we don't have any ports yet. + vector input_ports; + device->InputPorts(&input_ports); + CPPUNIT_ASSERT_EQUAL((size_t) 0, input_ports.size()); + vector output_ports; + device->OutputPorts(&output_ports); + CPPUNIT_ASSERT_EQUAL((size_t) 0, output_ports.size()); + + // add two input ports and an output port + TestMockInputPort input_port1(device, 1, NULL); + TestMockInputPort input_port2(device, 2, NULL); + TestMockOutputPort output_port1(device, 1); + device->AddPort(&input_port1); + device->AddPort(&input_port2); + device->AddPort(&output_port1); + + device->InputPorts(&input_ports); + CPPUNIT_ASSERT_EQUAL((size_t) 2, input_ports.size()); + device->OutputPorts(&output_ports); + CPPUNIT_ASSERT_EQUAL((size_t) 1, output_ports.size()); + + InputPort *input_port = device->GetInputPort(1); + CPPUNIT_ASSERT(input_port); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, input_port->PortId()); + input_port = device->GetInputPort(2); + CPPUNIT_ASSERT(input_port); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, input_port->PortId()); + OutputPort *output_port = device->GetOutputPort(1); + CPPUNIT_ASSERT(output_port); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, output_port->PortId()); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/DlOpenPluginLoader.h b/open-lighting-architecture/ola-0.8.4/olad/DlOpenPluginLoader.h new file mode 100644 index 0000000..92b1017 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DlOpenPluginLoader.h @@ -0,0 +1,61 @@ +/* + * 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 Library 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. + * + * DlOpenPluginLoader.h + * Interface for the DlOpenPluginLoader class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_DLOPENPLUGINLOADER_H_ +#define OLAD_DLOPENPLUGINLOADER_H_ + +#include +#include +#include +#include + +#include "olad/PluginLoader.h" + +namespace ola { + +using std::set; +using std::string; +using std::vector; + +class AbstractPlugin; + +class DlOpenPluginLoader: public PluginLoader { + public: + explicit DlOpenPluginLoader(const string &dirname): + m_dirname(dirname), + m_dl_active(false) {} + ~DlOpenPluginLoader() { UnloadPlugins(); } + + std::vector LoadPlugins(); + void UnloadPlugins(); + + private: + DlOpenPluginLoader(const DlOpenPluginLoader&); + DlOpenPluginLoader operator=(const DlOpenPluginLoader&); + + set FindPlugins(const string &path); + AbstractPlugin *LoadPlugin(const string &path); + + string m_dirname; + bool m_dl_active; + std::vector m_plugin_handles; +}; +} // ola +#endif // OLAD_DLOPENPLUGINLOADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/DmxSource.cpp b/open-lighting-architecture/ola-0.8.4/olad/DmxSource.cpp new file mode 100644 index 0000000..83be3ad --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DmxSource.cpp @@ -0,0 +1,30 @@ +/* + * 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 Library 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. + * + * DmxSource.cpp + * The DmxSource class. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include + +namespace ola { + +const uint8_t DmxSource::PRIORITY_MIN = 0; +const uint8_t DmxSource::PRIORITY_MAX = 200; +const uint8_t DmxSource::PRIORITY_DEFAULT = 100; + +const TimeInterval DmxSource::TIMEOUT_INTERVAL(2500000); // 2.5s +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/DmxSourceTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/DmxSourceTest.cpp new file mode 100644 index 0000000..1f37a87 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DmxSourceTest.cpp @@ -0,0 +1,98 @@ +/* + * 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 Library 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. + * + * DmxSourceTest.cpp + * Test fixture for the DmxSource classes + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +#include "ola/Clock.h" +#include "ola/DmxBuffer.h" +#include "olad/DmxSource.h" + + +class DmxSourceTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DmxSourceTest); + CPPUNIT_TEST(testDmxSource); + CPPUNIT_TEST(testIsActive); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDmxSource(); + void testIsActive(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(DmxSourceTest); + +using ola::Clock; +using ola::DmxBuffer; +using ola::DmxSource; +using ola::TimeInterval; +using ola::TimeStamp; + + +/* + * Check that the base device class works correctly. + */ +void DmxSourceTest::testDmxSource() { + DmxBuffer buffer("123456789"); + TimeStamp timestamp; + Clock::CurrentTime(×tamp); + + DmxSource source(buffer, timestamp, 100); + CPPUNIT_ASSERT(source.IsSet()); + CPPUNIT_ASSERT(buffer == source.Data()); + CPPUNIT_ASSERT_EQUAL(timestamp, source.Timestamp()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 100, source.Priority()); + + DmxBuffer buffer2("987654321"); + TimeStamp timestamp2; + Clock::CurrentTime(×tamp2); + CPPUNIT_ASSERT(timestamp != timestamp2); + + source.UpdateData(buffer2, timestamp2, 120); + CPPUNIT_ASSERT(buffer2 == source.Data()); + CPPUNIT_ASSERT_EQUAL(timestamp2, source.Timestamp()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 120, source.Priority()); + + DmxSource empty_source; + CPPUNIT_ASSERT(!empty_source.IsSet()); +} + + +/* + * Test the time based checks + */ +void DmxSourceTest::testIsActive() { + DmxBuffer buffer("123456789"); + TimeStamp timestamp; + Clock::CurrentTime(×tamp); + + DmxSource source(buffer, timestamp, 100); + CPPUNIT_ASSERT(source.IsSet()); + + CPPUNIT_ASSERT(source.IsActive(timestamp)); + TimeInterval interval(1000000); + TimeStamp later = timestamp + interval; + CPPUNIT_ASSERT(source.IsActive(later)); + + later = timestamp + TimeInterval(2500000); + CPPUNIT_ASSERT(!source.IsActive(later)); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.cpp b/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.cpp new file mode 100644 index 0000000..86ab8a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.cpp @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * DynamicPluginLoader.cpp + * This class is responsible for loading and unloading the plugins + * Copyright (C) 2005-2009 Simon Newton + */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include "olad/Plugin.h" +#include "olad/DynamicPluginLoader.h" + +#include "plugins/artnet/ArtNetPlugin.h" +#include "plugins/dummy/DummyPlugin.h" +#include "plugins/e131/E131Plugin.h" +#include "plugins/espnet/EspNetPlugin.h" +#include "plugins/opendmx/OpenDmxPlugin.h" +#include "plugins/pathport/PathportPlugin.h" +#include "plugins/sandnet/SandNetPlugin.h" +#include "plugins/shownet/ShowNetPlugin.h" +#include "plugins/stageprofi/StageProfiPlugin.h" +#include "plugins/usbpro/UsbProPlugin.h" + +#ifdef HAVE_LIBUSB +#include "plugins/usbdmx/UsbDmxPlugin.h" +#endif + + + +#ifdef HAVE_DMX4LINUX +#include "plugins/dmx4linux/Dmx4LinuxPlugin.h" +#endif + + +namespace ola { + +using std::vector; + +/* + * Load the plugins that we were linked against + * @returns a vector of plugins + */ +vector DynamicPluginLoader::LoadPlugins() { + vector plugins; + +#ifdef HAVE_DMX4LINUX + plugins.push_back( + new ola::plugin::dmx4linux::Dmx4LinuxPlugin(m_plugin_adaptor)); +#endif + + plugins.push_back(new ola::plugin::artnet::ArtNetPlugin(m_plugin_adaptor)); + plugins.push_back(new ola::plugin::dummy::DummyPlugin(m_plugin_adaptor)); + plugins.push_back(new ola::plugin::e131::E131Plugin(m_plugin_adaptor)); + plugins.push_back(new ola::plugin::espnet::EspNetPlugin(m_plugin_adaptor)); + plugins.push_back( + new ola::plugin::opendmx::OpenDmxPlugin(m_plugin_adaptor)); + plugins.push_back( + new ola::plugin::sandnet::SandNetPlugin(m_plugin_adaptor)); + plugins.push_back( + new ola::plugin::shownet::ShowNetPlugin(m_plugin_adaptor)); + plugins.push_back( + new ola::plugin::stageprofi::StageProfiPlugin(m_plugin_adaptor)); + plugins.push_back(new ola::plugin::usbpro::UsbProPlugin(m_plugin_adaptor)); +#ifdef HAVE_LIBUSB + plugins.push_back(new ola::plugin::usbdmx::UsbDmxPlugin(m_plugin_adaptor)); +#endif + plugins.push_back( + new ola::plugin::pathport::PathportPlugin(m_plugin_adaptor)); + return plugins; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.h b/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.h new file mode 100644 index 0000000..535a69a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/DynamicPluginLoader.h @@ -0,0 +1,42 @@ +/* + * 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 Library 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. + * + * DynamicPluginLoader.h + * Interface for the DynamicPluginLoader class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_DYNAMICPLUGINLOADER_H_ +#define OLAD_DYNAMICPLUGINLOADER_H_ + +#include +#include "olad/PluginLoader.h" + +namespace ola { + +class DynamicPluginLoader: public PluginLoader { + public: + DynamicPluginLoader() {} + ~DynamicPluginLoader() { UnloadPlugins(); } + + std::vector LoadPlugins(); + void UnloadPlugins() {} + + private: + DynamicPluginLoader(const DynamicPluginLoader&); + DynamicPluginLoader operator=(const DynamicPluginLoader&); +}; +} // ola +#endif // OLAD_DYNAMICPLUGINLOADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpModule.cpp b/open-lighting-architecture/ola-0.8.4/olad/HttpModule.cpp new file mode 100644 index 0000000..6e96de4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpModule.cpp @@ -0,0 +1,42 @@ +/* + * 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 Library 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. + * + * HttpModule.cpp + * The base class for HTTP Modules which are used to extend the web UI + * functionaiity. + * Copyright (C) 2010 Simon Newton + */ + +#include "ola/OlaCallbackClient.h" +#include "olad/OlaServer.h" +#include "olad/HttpModule.h" + + +namespace ola { + + +const char HttpModule::BACKEND_DISCONNECTED_ERROR[] = + "Failed to send request, client isn't connected"; + + +/** + * Create a new OLA HTTP server + * @param + */ +HttpModule::HttpModule(HttpServer *http_server, OlaCallbackClient *client) + : m_server(http_server), + m_client(client) { +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpModule.h b/open-lighting-architecture/ola-0.8.4/olad/HttpModule.h new file mode 100644 index 0000000..05442a2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpModule.h @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * HttpModule.h + * The base class for HTTP Modules which are used to extend the web UI + * functionaiity. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_HTTPMODULE_H_ +#define OLAD_HTTPMODULE_H_ + +#include "ola/OlaCallbackClient.h" +#include "olad/HttpServer.h" + +namespace ola { + + +/* + * The base class that other modules inherit from. + */ +class HttpModule { + public: + HttpModule(HttpServer *http_server, class OlaCallbackClient *client); + virtual ~HttpModule() {} + + protected: + HttpServer *m_server; + class OlaCallbackClient *m_client; + + HttpModule(const HttpModule&); + HttpModule& operator=(const HttpModule&); + + static const char BACKEND_DISCONNECTED_ERROR[]; +}; +} // ola +#endif // OLAD_HTTPMODULE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpServer.cpp b/open-lighting-architecture/ola-0.8.4/olad/HttpServer.cpp new file mode 100644 index 0000000..bb266ed --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpServer.cpp @@ -0,0 +1,718 @@ +/* + * 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 Library 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. + * + * HttpServer.cpp + * Ola HTTP class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include "olad/HttpServer.h" +#include "ola/Logging.h" + +namespace ola { + +using std::ifstream; +using std::pair; +using std::set; +using std::string; +using ola::network::UnmanagedSocket; + +const char HttpServer::CONTENT_TYPE_PLAIN[] = "text/plain"; +const char HttpServer::CONTENT_TYPE_HTML[] = "text/html"; +const char HttpServer::CONTENT_TYPE_GIF[] = "image/gif"; +const char HttpServer::CONTENT_TYPE_PNG[] = "image/png"; +const char HttpServer::CONTENT_TYPE_CSS[] = "text/css"; +const char HttpServer::CONTENT_TYPE_JS[] = "text/javascript"; + + +/** + * Called by MHD_get_connection_values to add headers to a request obect. + * @param cls a pointer to an HttpRequest object. + * @param key the header name + * @param value the header value + */ +static int AddHeaders(void *cls, enum MHD_ValueKind kind, const char *key, + const char *value) { + HttpRequest *request = reinterpret_cast(cls); + string key_string = key; + string value_string = value; + request->AddHeader(key, value); + return MHD_YES; + (void) kind; +} + + +/** + * Called by MHD_create_post_processor to iterate over the post form data + * @param request_cls a pointer to a HttpRequest object + * @param key the header name + * @param value the header value + */ +int IteratePost(void *request_cls, enum MHD_ValueKind kind, const char *key, + const char *filename, const char *content_type, + const char *transfer_encoding, const char *data, uint64_t off, + size_t size) { + // libmicrohttpd has a bug where the zie isn't set correctly. + HttpRequest *request = reinterpret_cast(request_cls); + string value(data); + request->AddPostParameter(key, value); + return MHD_YES; + (void) content_type; + (void) filename; + (void) kind; + (void) transfer_encoding; + (void) off; + (void) size; +} + + +/** + * Called whenever a new request is made. This sets up HttpRequest & + * HttpResponse objects and then calls DispatchRequest. + */ +static int HandleRequest(void *http_server_ptr, + struct MHD_Connection *connection, + const char *url, + const char *method, + const char *version, + const char *upload_data, + size_t *upload_data_size, + void **ptr) { + HttpServer *http_server = reinterpret_cast(http_server_ptr); + HttpRequest *request; + + // on the first call ptr is null + if (*ptr == NULL) { + request = new HttpRequest(url, method, version, connection); + if (!request) + return MHD_NO; + + if (!request->Init()) { + delete request; + return MHD_NO; + } + *ptr = reinterpret_cast(request); + return MHD_YES; + } + + request = reinterpret_cast(*ptr); + + if (request->InFlight()) + // don't dispatch more than once + return MHD_YES; + + if (request->Method() == MHD_HTTP_METHOD_GET) { + HttpResponse *response = new HttpResponse(connection); + request->SetInFlight(); + return http_server->DispatchRequest(request, response); + + } else if (request->Method() == MHD_HTTP_METHOD_POST) { + if (*upload_data_size != 0) { + request->ProcessPostData(upload_data, upload_data_size); + *upload_data_size = 0; + return MHD_YES; + } + request->SetInFlight(); + HttpResponse *response = new HttpResponse(connection); + return http_server->DispatchRequest(request, response); + } + return MHD_NO; +} + + +/** + * Called when a request completes. This deletes the associated HttpRequest + * object. + */ +void RequestCompleted(void *cls, + struct MHD_Connection *connection, + void **request_cls, + enum MHD_RequestTerminationCode toe) { + HttpRequest *request = reinterpret_cast(*request_cls); + + if (!request) + return; + + delete request; + *request_cls = NULL; + (void) cls; + (void) connection; + (void) toe; +} + + +/* + * HttpRequest object + * Setup the header callback and the post processor if needed. + */ +HttpRequest::HttpRequest(const string &url, + const string &method, + const string &version, + struct MHD_Connection *connection): + m_url(url), + m_method(method), + m_version(version), + m_connection(connection), + m_processor(NULL), + m_in_flight(false) { +} + + +/* + * Initialize this request + * @return true if succesful, false otherwise. + */ +bool HttpRequest::Init() { + MHD_get_connection_values(m_connection, MHD_HEADER_KIND, AddHeaders, this); + + if (m_method == MHD_HTTP_METHOD_POST) { + m_processor = MHD_create_post_processor(m_connection, + K_POST_BUFFER_SIZE, + IteratePost, + reinterpret_cast(this)); + return m_processor; + } + return true; +} + + +/* + * Cleanup this request object + */ +HttpRequest::~HttpRequest() { + if (m_processor) + MHD_destroy_post_processor(m_processor); +} + + +/* + * Add a header to the request object. + * @param key the header name + * @param value the value of the header + */ +void HttpRequest::AddHeader(const string &key, const string &value) { + std::pair pair(key, value); + m_headers.insert(pair); +} + + +/* + * Add a post parameter. This can be called multiple times and the values will + * be appended. + * @param key the parameter name + * @param value the value + */ +void HttpRequest::AddPostParameter(const string &key, const string &value) { + map::iterator iter = m_post_params.find(key); + + if (iter == m_post_params.end()) { + std::pair pair(key, value); + m_post_params.insert(pair); + } else { + iter->second.append(value); + } +} + + +/* + * Process post data + */ +void HttpRequest::ProcessPostData(const char *data, size_t *data_size) { + MHD_post_process(m_processor, data, *data_size); +} + + +/* + * Return the value of the header sent with this request + * @param key the name of the header + * @returns the value of the header or empty string if it doesn't exist. + */ +const string HttpRequest::GetHeader(const string &key) const { + map::const_iterator iter = m_headers.find(key); + + if (iter == m_headers.end()) + return ""; + else + return iter->second; +} + + +/* + * Return the value of a url parameter + * @param key the name of the parameter + * @return the value of the parameter + */ +const string HttpRequest::GetParameter(const string &key) const { + const char *value = MHD_lookup_connection_value(m_connection, + MHD_GET_ARGUMENT_KIND, + key.data()); + if (value) + return string(value); + else + return string(); +} + + +/* + * Lookup a post parameter in this request + * @param key the name of the parameter + * @return the value of the parameter or the empty string if it doesn't exist + */ +const string HttpRequest::GetPostParameter(const string &key) const { + map::const_iterator iter = m_post_params.find(key); + + if (iter == m_post_params.end()) + return ""; + else + return iter->second; +} + + +/* + * Set the content-type header + * @param type, the content type + * @return true if the header was set correctly, false otherwise + */ +void HttpResponse::SetContentType(const string &type) { + SetHeader(MHD_HTTP_HEADER_CONTENT_TYPE, type); +} + + +/* + * Set a header in the response + * @param key the header name + * @param value the header value + * @return true if the header was set correctly, false otherwise + */ +void HttpResponse::SetHeader(const string &key, const string &value) { + std::pair pair(key, value); + m_headers.insert(pair); +} + + +/* + * Send the HTTP response + * @returns true on success, false on error + */ +int HttpResponse::Send() { + map::const_iterator iter; + struct MHD_Response *response = MHD_create_response_from_data( + m_data.length(), + reinterpret_cast(const_cast(m_data.data())), + MHD_NO, + MHD_YES); + for (iter = m_headers.begin(); iter != m_headers.end(); ++iter) + MHD_add_response_header(response, + iter->first.c_str(), + iter->second.c_str()); + int ret = MHD_queue_response(m_connection, m_status_code, response); + MHD_destroy_response(response); + return ret; +} + + +/* + * Setup the HTTP server. + * @param port the port to listen on + * @param data_dir the directory to serve static content from + */ +HttpServer::HttpServer(unsigned int port, const string &data_dir) + : OlaThread(), + m_httpd(NULL), + m_select_server(NULL), + m_default_handler(NULL), + m_port(port), + m_data_dir(data_dir) { + if (m_data_dir.empty()) + m_data_dir = HTTP_DATA_DIR; +} + + +/* + * Destroy this object + */ +HttpServer::~HttpServer() { + Stop(); + + if (m_select_server) + delete m_select_server; + + if (m_httpd) + MHD_stop_daemon(m_httpd); + + map::const_iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) + delete iter->second; + + if (m_default_handler) { + delete m_default_handler; + m_default_handler = NULL; + } + + m_handlers.clear(); +} + + +/* + * Setup the HTTP server + * @return true on success, false on failure + */ +bool HttpServer::Init() { + if (m_httpd || m_select_server) { + OLA_INFO << "Non null pointers found, Init() was probably called twice"; + return false; + } + + m_httpd = MHD_start_daemon(MHD_NO_FLAG, + m_port, + NULL, + NULL, + &HandleRequest, + this, + MHD_OPTION_NOTIFY_COMPLETED, + RequestCompleted, + NULL, + MHD_OPTION_END); + + if (m_httpd) { + m_select_server = new ola::network::SelectServer(); + m_select_server->RunInLoop(NewClosure(this, &HttpServer::UpdateSockets)); + } + + return m_httpd ? true : false; +} + + +/** + * The entry point into the new thread + */ +void *HttpServer::Run() { + if (!(m_httpd || m_select_server)) { + OLA_WARN << "HttpServer::Run called but the server wasn't setup."; + return NULL; + } + + m_select_server->Run(); + + // clean up any remaining sockets + set::iterator iter = + m_sockets.begin(); + for (; iter != m_sockets.end(); ++iter) { + m_select_server->RemoveSocket(*iter); + m_select_server->UnRegisterWriteSocket(*iter); + delete *iter; + } + return NULL; +} + + +/* + * Stop the HTTP server + */ +void HttpServer::Stop() { + if (IsRunning()) { + OLA_INFO << "Notifying HTTP server thread to stop"; + m_select_server->Terminate(); + OLA_INFO << "Waiting for HTTP server thread to exit"; + Join(); + OLA_INFO << "HTTP server thread exited"; + } +} + + +/** + * This is run every loop iteration to update the list of sockets in the + * SelectServer from MHD. + */ +void HttpServer::UpdateSockets() { + // We always call MHD_run so we send any queued responses. This isn't + // inefficient because the only thing that can wake up the select server is + // activity on a http socket or the client socket. The latter almost always + // results in a change to HTTP state. + if (MHD_run(m_httpd) == MHD_NO) { + OLA_WARN << "MHD run failed"; + } + + fd_set r_set, w_set, e_set; + int max_fd = 0; + FD_ZERO(&r_set); + FD_ZERO(&w_set); + + if (MHD_YES != MHD_get_fdset(m_httpd, &r_set, &w_set, &e_set, &max_fd)) { + OLA_WARN << "Failed to get a list of the file descriptors for MHD"; + return; + } + + set::iterator iter = + m_sockets.begin(); + + // This isn't the best plan, talk to the MHD devs about exposing the list of + // FD in a more suitable way + int i = 0; + while (iter != m_sockets.end() && i <= max_fd) { + if ((*iter)->ReadDescriptor() < i) { + // this socket is no longer required so remove it + OLA_DEBUG << "Removing unsed socket " << (*iter)->ReadDescriptor(); + m_select_server->RemoveSocket(*iter); + m_select_server->UnRegisterWriteSocket(*iter); + delete *iter; + m_sockets.erase(iter++); + } else if ((*iter)->ReadDescriptor() == i) { + // this socket may need to be updated + if (FD_ISSET(i, &r_set)) + m_select_server->AddSocket(*iter); + else + m_select_server->RemoveSocket(*iter); + + if (FD_ISSET(i, &w_set)) + m_select_server->RegisterWriteSocket(*iter); + else + m_select_server->UnRegisterWriteSocket(*iter); + iter++; + i++; + } else { + // this is a new socket + if (FD_ISSET(i, &r_set) || FD_ISSET(i, &w_set)) { + OLA_DEBUG << "Adding new socket " << i; + UnmanagedSocket *socket = NewSocket(&r_set, &w_set, i); + m_sockets.insert(socket); + } + i++; + } + } + + while (iter != m_sockets.end()) { + OLA_DEBUG << "Removing " << (*iter)->ReadDescriptor() << + " as it's not longer needed"; + m_select_server->UnRegisterWriteSocket(*iter); + m_select_server->RemoveSocket(*iter); + delete *iter; + m_sockets.erase(iter++); + } + + for (;i <= max_fd; i++) { + // add the remaining sockets to the SS + if (FD_ISSET(i, &r_set) || FD_ISSET(i, &w_set)) { + OLA_DEBUG << "Adding " << i << " as a new socket"; + UnmanagedSocket *socket = NewSocket(&r_set, &w_set, i); + m_sockets.insert(socket); + } + } +} + + +/** + * Called when there is HTTP IO activity to deal with. This is a noop as + * MHD_run is called in UpdateSockets above. + */ +void HttpServer::HandleHTTPIO() {} + + +/* + * Call the appropriate handler. + */ +int HttpServer::DispatchRequest(const HttpRequest *request, + HttpResponse *response) { + map::iterator iter = + m_handlers.find(request->Url()); + + if (iter != m_handlers.end()) + return iter->second->Run(request, response); + + map::iterator file_iter = + m_static_content.find(request->Url()); + + if (file_iter != m_static_content.end()) + return ServeStaticContent(&(file_iter->second), response); + + if (m_default_handler) + return m_default_handler->Run(request, response); + + return ServeNotFound(response); +} + + +/* + * Register a handler + * @param path the url to respond on + * @param handler the Closure to call for this request. These will be freed + * once the HttpServer is destroyed. + */ +bool HttpServer::RegisterHandler(const string &path, BaseHttpClosure *handler) { + map::const_iterator iter = m_handlers.find(path); + if (iter != m_handlers.end()) + return false; + pair pair(path, handler); + m_handlers.insert(pair); + return true; +} + + +/* + * Register a static file + * @param path the path to serve on + * @param file the path to the file to serve + */ +bool HttpServer::RegisterFile(const string &path, + const string &file, + const string &content_type) { + map::const_iterator file_iter = ( + m_static_content.find(path)); + + if (file_iter != m_static_content.end()) + return false; + + static_file_info file_info; + file_info.file_path = file; + file_info.content_type = content_type; + + pair pair(path, file_info); + m_static_content.insert(pair); + return true; +} + + +/* + * Set the default handler. + * @param handler the default handler to call. This will be freed when the + * HttpServer is destroyed. + */ +void HttpServer::RegisterDefaultHandler(BaseHttpClosure *handler) { + m_default_handler = handler; +} + + +/* + * Return a list of all handlers registered + */ +vector HttpServer::Handlers() const { + vector handlers; + map::const_iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) + handlers.push_back(iter->first); + + map::const_iterator file_iter; + for (file_iter = m_static_content.begin(); + file_iter != m_static_content.end(); ++file_iter) + handlers.push_back(file_iter->first); + return handlers; +} + + +/* + * Serve an error. + * @param response the reponse to use. + * @param details the error description + */ +int HttpServer::ServeError(HttpResponse *response, const string &details) { + response->SetStatus(MHD_HTTP_INTERNAL_SERVER_ERROR); + response->SetContentType(CONTENT_TYPE_HTML); + response->Append("500 Server Error"); + if (!details.empty()) { + response->Append("

"); + response->Append(details); + response->Append("

"); + } + int r = response->Send(); + delete response; + return r; +} + + +/* + * Serve a 404 + * @param response the response to use + */ +int HttpServer::ServeNotFound(HttpResponse *response) { + response->SetStatus(MHD_HTTP_NOT_FOUND); + response->SetContentType(CONTENT_TYPE_HTML); + response->SetStatus(404); + response->Append("404 Not Found"); + int r = response->Send(); + delete response; + return r; +} + + +/* + * Serve static content. + * @param file_info details on the file to server + * @param response the response to use + */ +int HttpServer::ServeStaticContent(static_file_info *file_info, + HttpResponse *response) { + char *data; + unsigned int length; + string file_path = m_data_dir; + file_path.append("/"); + file_path.append(file_info->file_path); + ifstream i_stream(file_path.data()); + + if (!i_stream.is_open()) { + OLA_WARN << "Missing file: " << file_path; + return ServeNotFound(response); + } + + i_stream.seekg(0, std::ios::end); + length = i_stream.tellg(); + i_stream.seekg(0, std::ios::beg); + + data = reinterpret_cast(malloc(length * sizeof(char))); + + i_stream.read(data, length); + i_stream.close(); + + struct MHD_Response *mhd_response = MHD_create_response_from_data( + length, + reinterpret_cast(const_cast(data)), + MHD_YES, + MHD_NO); + + if (!file_info->content_type.empty()) + MHD_add_response_header(mhd_response, + MHD_HTTP_HEADER_CONTENT_TYPE, + file_info->content_type.data()); + + int ret = MHD_queue_response(response->Connection(), + MHD_HTTP_OK, + mhd_response); + MHD_destroy_response(mhd_response); + delete response; + return ret; +} + + +UnmanagedSocket *HttpServer::NewSocket(fd_set *r_set, + fd_set *w_set, + int fd) { + UnmanagedSocket *socket = new UnmanagedSocket(fd); + socket->SetOnData(NewClosure(this, &HttpServer::HandleHTTPIO)); + socket->SetOnWritable(NewClosure(this, &HttpServer::HandleHTTPIO)); + + if (FD_ISSET(fd, r_set)) + m_select_server->AddSocket(socket); + + if (FD_ISSET(fd, w_set)) + m_select_server->RegisterWriteSocket(socket); + return socket; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpServer.h b/open-lighting-architecture/ola-0.8.4/olad/HttpServer.h new file mode 100644 index 0000000..5bc6ed9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpServer.h @@ -0,0 +1,185 @@ +/* + * 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 Library 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. + * + * HttpServer.h + * Interface for the OLA HTTP class + * Copyright (C) 2005-2008 Simon Newton + */ + + +#ifndef OLAD_HTTPSERVER_H_ +#define OLAD_HTTPSERVER_H_ + +#include +#include +#include +// 0.4.6 of microhttp doesn't include stdarg so we do it here. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ola { + +using std::map; +using std::multimap; +using std::string; +using std::vector; + +/* + * Represents the HTTP request + */ +class HttpRequest { + public: + HttpRequest(const string &url, + const string &method, + const string &version, + struct MHD_Connection *connection); + ~HttpRequest(); + bool Init(); + + // accessors + const string Url() const { return m_url; } + const string Method() const { return m_method; } + const string Version() const { return m_version; } + + void AddHeader(const string &key, const string &value); + void AddPostParameter(const string &key, const string &value); + void ProcessPostData(const char *data, size_t *data_size); + const string GetHeader(const string &key) const; + const string GetParameter(const string &key) const; + const string GetPostParameter(const string &key) const; + + bool InFlight() const { return m_in_flight; } + void SetInFlight() { m_in_flight = true; } + + private: + string m_url; + string m_method; + string m_version; + struct MHD_Connection *m_connection; + map m_headers; + map m_post_params; + struct MHD_PostProcessor *m_processor; + bool m_in_flight; + + static const unsigned int K_POST_BUFFER_SIZE = 1024; +}; + + +/* + * Represents the HTTP Response + */ +class HttpResponse { + public: + explicit HttpResponse(struct MHD_Connection *connection): + m_connection(connection), + m_status_code(MHD_HTTP_OK) {} + + void Append(const string &data) { m_data.append(data); } + void SetContentType(const string &type); + void SetHeader(const string &key, const string &value); + void SetStatus(unsigned int status) { m_status_code = status; } + int Send(); + struct MHD_Connection *Connection() const { return m_connection; } + private: + string m_data; + struct MHD_Connection *m_connection; + multimap m_headers; + unsigned int m_status_code; +}; + + +/* + * The base HTTP Server + */ +class HttpServer: public OlaThread { + public: + typedef ola::Callback2 + BaseHttpClosure; + + HttpServer(unsigned int port, const string &data_dir); + virtual ~HttpServer(); + bool Init(); + void *Run(); + void Stop(); + void UpdateSockets(); + void HandleHTTPIO(); + + int DispatchRequest(const HttpRequest *request, HttpResponse *response); + bool RegisterHandler(const string &path, BaseHttpClosure *handler); + bool RegisterFile(const string &path, + const string &file, + const string &content_type=""); + void RegisterDefaultHandler(BaseHttpClosure *handler); + vector Handlers() const; + const string DataDir() const { return m_data_dir; } + int ServeError(HttpResponse *response, const string &details=""); + int ServeNotFound(HttpResponse *response); + + typedef struct { + string file_path; + string content_type; + } static_file_info; + + int ServeStaticContent(static_file_info *file_info, + HttpResponse *response); + + static const char CONTENT_TYPE_PLAIN[]; + static const char CONTENT_TYPE_HTML[]; + static const char CONTENT_TYPE_GIF[]; + static const char CONTENT_TYPE_PNG[]; + static const char CONTENT_TYPE_CSS[]; + static const char CONTENT_TYPE_JS[]; + + // Expose the SelectServer + ola::network::SelectServer *SelectServer() const { + return m_select_server; + } + + private : + HttpServer(const HttpServer&); + HttpServer& operator=(const HttpServer&); + + struct unmanaged_socket_lt { + bool operator()(const ola::network::UnmanagedSocket *s1, + const ola::network::UnmanagedSocket *s2) const { + return s1->ReadDescriptor() < s2->ReadDescriptor(); + } + }; + + ola::network::UnmanagedSocket *NewSocket(fd_set *r_set, + fd_set *w_set, + int fd); + + struct MHD_Daemon *m_httpd; + ola::network::SelectServer *m_select_server; + + std::set m_sockets; + + map m_handlers; + map m_static_content; + BaseHttpClosure *m_default_handler; + unsigned int m_port; + string m_data_dir; +}; +} // ola +#endif // OLAD_HTTPSERVER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.cpp b/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.cpp new file mode 100644 index 0000000..3ad82ff --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.cpp @@ -0,0 +1,102 @@ +/* + * 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 Library 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. + * + * HttpServerActions.cpp + * The actions the HTTP server uses to interact with the client. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include + +#include "ola/ActionQueue.h" +#include "ola/Callback.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "olad/HttpServerActions.h" + +namespace ola { + +using std::string; + + +void BaseHttpAction::RequestComplete(bool failure) { + m_failed = failure; + m_on_done->Run(); +} + + +void BaseHttpAction::Perform(SingleUseClosure *on_done) { + m_on_done = on_done; + if (!DoAction()) + RequestComplete(true); +} + +void BaseHttpAction::CallbackComplete(const string &error) { + RequestComplete(!error.empty()); +} + + +bool SetNameAction::DoAction() { + return m_client->SetUniverseName( + m_universe, + m_name, + NewSingleCallback(reinterpret_cast(this), + &SetNameAction::CallbackComplete)); +} + + + +bool SetMergeModeAction::DoAction() { + return m_client->SetUniverseMergeMode( + m_universe, + m_merge_mode, + NewSingleCallback(reinterpret_cast(this), + &SetNameAction::CallbackComplete)); +} + + +bool PatchPortAction::DoAction() { + return m_client->Patch( + m_device_alias, + m_port, + m_direction, + m_action, + m_universe, + NewSingleCallback(reinterpret_cast(this), + &SetNameAction::CallbackComplete)); +} + + +bool PortPriorityInheritAction::DoAction() { + return m_client->SetPortPriorityInherit( + m_device_alias, + m_port, + m_direction, + NewSingleCallback(reinterpret_cast(this), + &SetNameAction::CallbackComplete)); +} + + +bool PortPriorityOverrideAction::DoAction() { + return m_client->SetPortPriorityOverride( + m_device_alias, + m_port, + m_direction, + m_override_value, + NewSingleCallback(reinterpret_cast(this), + &SetNameAction::CallbackComplete)); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.h b/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.h new file mode 100644 index 0000000..e4e726a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/HttpServerActions.h @@ -0,0 +1,221 @@ +/* + * 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 Library 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. + * + * HttpServerActions.h + * The list of actions the Ola Server performs. + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef OLAD_HTTPSERVERACTIONS_H_ +#define OLAD_HTTPSERVERACTIONS_H_ + +#include +#include +#include "ola/ActionQueue.h" +#include "ola/OlaCallbackClient.h" + +namespace ola { + +using std::string; + + +/* + * The base action + */ +class BaseHttpAction: public Action { + public: + explicit BaseHttpAction(OlaCallbackClient *client): + Action(), + m_client(client), + m_failed(false), + m_on_done(NULL) { + } + virtual ~BaseHttpAction() {} + + bool Failed() const { return m_failed; } + void Perform(SingleUseClosure *on_done); + void CallbackComplete(const string &error); + + protected: + OlaCallbackClient *m_client; + + void RequestComplete(bool failure); + virtual bool DoAction() = 0; + + private: + bool m_failed; + SingleUseClosure *m_on_done; + + BaseHttpAction(const BaseHttpAction&); + BaseHttpAction& operator=(const BaseHttpAction&); +}; + + +/* + * An action that sets the name of a universe + */ +class SetNameAction: public BaseHttpAction { + public: + SetNameAction(OlaCallbackClient *client, + unsigned int universe, + const string &name, + bool is_fatal): + BaseHttpAction(client), + m_universe(universe), + m_name(name), + m_is_fatal(is_fatal) { + } + + bool IsFatal() const { return m_is_fatal; } + + protected: + bool DoAction(); + + private: + unsigned int m_universe; + string m_name; + bool m_is_fatal; + + SetNameAction(const SetNameAction&); + SetNameAction& operator=(const SetNameAction&); +}; + + +/* + * An action that sets the merge mode of a universe + */ +class SetMergeModeAction: public BaseHttpAction { + public: + SetMergeModeAction(OlaCallbackClient *client, + unsigned int universe, + OlaUniverse::merge_mode mode): + BaseHttpAction(client), + m_universe(universe), + m_merge_mode(mode) { + } + + bool IsFatal() const { return false; } + + protected: + bool DoAction(); + + private: + unsigned int m_universe; + OlaUniverse::merge_mode m_merge_mode; + + SetMergeModeAction(const SetMergeModeAction&); + SetMergeModeAction& operator=(const SetMergeModeAction&); +}; + + +/* + * An action that adds or removes a port from a universe. + */ +class PatchPortAction: public BaseHttpAction { + public: + PatchPortAction(OlaCallbackClient *client, + unsigned int device_alias, + unsigned int port, + PortDirection direction, + unsigned int universe, + PatchAction action): + BaseHttpAction(client), + m_device_alias(device_alias), + m_port(port), + m_direction(direction), + m_universe(universe), + m_action(action) { + } + + bool IsFatal() const { return false; } + + protected: + bool DoAction(); + + private: + unsigned int m_device_alias; + unsigned int m_port; + PortDirection m_direction; + unsigned int m_universe; + PatchAction m_action; + + PatchPortAction(const PatchPortAction&); + PatchPortAction& operator=(const PatchPortAction&); +}; + + +/* + * An action that sets a port priority to inherit mode. + */ +class PortPriorityInheritAction: public BaseHttpAction { + public: + PortPriorityInheritAction(OlaCallbackClient *client, + unsigned int device_alias, + unsigned int port, + PortDirection direction): + BaseHttpAction(client), + m_device_alias(device_alias), + m_port(port), + m_direction(direction) { + } + + bool IsFatal() const { return false; } + + protected: + bool DoAction(); + + private: + unsigned int m_device_alias; + unsigned int m_port; + PortDirection m_direction; + + PortPriorityInheritAction(const PortPriorityInheritAction&); + PortPriorityInheritAction& operator=(const PortPriorityInheritAction&); +}; + + +/* + * An action that sets a port priority to override mode. + */ +class PortPriorityOverrideAction: public BaseHttpAction { + public: + PortPriorityOverrideAction(OlaCallbackClient *client, + unsigned int device_alias, + unsigned int port, + PortDirection direction, + uint8_t overide_value): + BaseHttpAction(client), + m_device_alias(device_alias), + m_port(port), + m_direction(direction), + m_override_value(overide_value) { + } + + bool IsFatal() const { return false; } + + protected: + bool DoAction(); + + private: + unsigned int m_device_alias; + unsigned int m_port; + PortDirection m_direction; + uint8_t m_override_value; + + PortPriorityOverrideAction(const PortPriorityOverrideAction&); + PortPriorityOverrideAction& operator=(const PortPriorityOverrideAction&); +}; +} // ola +#endif // OLAD_HTTPSERVERACTIONS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.cpp b/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.cpp new file mode 100644 index 0000000..f329e5c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.cpp @@ -0,0 +1,62 @@ +/* + * 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 Library 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. + * + * InternalInputPort.cpp + * An input port used to send RDM commands to a universe + * Copyright (C) 2010 Simon Newton + */ + +#include +#include "ola/DmxBuffer.h" +#include "ola/Logging.h" +#include "olad/InternalInputPort.h" + +namespace ola { + +/* + * This port never generates data so this shouldn't ever be called + */ +const DmxBuffer& InternalInputPort::ReadDMX() const { + OLA_WARN << "Attempt to read DMX from an Internal Port!"; + return m_buffer; +} + + +/* + * Handle an RDM response, this passes it on to the + * InternalInputPortResponseHandler + */ +bool InternalInputPort::HandleRDMResponse( + const ola::rdm::RDMResponse *response) { + if (m_handler) { + if (GetUniverse()) + return m_handler->HandleRDMResponse(GetUniverse()->UniverseId(), + response); + else + OLA_WARN << "No universe for an internal port " << PortId(); + } else { + OLA_WARN << "No handler for internal port " << PortId(); + } + delete response; + return false; +} + + +string InternalInputPort::UniqueId() const { + std::stringstream str; + str << "internal-I-" << PortId(); + return str.str(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.h b/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.h new file mode 100644 index 0000000..7648e70 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/InternalInputPort.h @@ -0,0 +1,66 @@ +/* + * 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 Library 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. + * + * InternalInputPort.h + * An input port used to send RDM commands to a universe + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_INTERNALINPUTPORT_H_ +#define OLAD_INTERNALINPUTPORT_H_ + +#include +#include "ola/Logging.h" +#include "ola/rdm/RDMCommand.h" +#include "olad/Port.h" + +namespace ola { + +/* + * This handles RDM Responses + */ +class InternalInputPortResponseHandler { + public: + virtual ~InternalInputPortResponseHandler() {} + + virtual bool HandleRDMResponse(unsigned int universe, + const ola::rdm::RDMResponse *response) = 0; +}; + + +/* + * This class is a special type of Input port, used to send RDM commands + * generated interally. + */ +class InternalInputPort: public BasicInputPort { + public: + InternalInputPort(unsigned int port_id, + InternalInputPortResponseHandler *handler): + BasicInputPort(NULL, port_id, NULL), + m_handler(handler) {} + + const DmxBuffer &ReadDMX() const; + bool HandleRDMResponse(const ola::rdm::RDMResponse *response); + string UniqueId() const; + string Description() const { return "Internal Port"; } + + private: + DmxBuffer m_buffer; + InternalInputPort(const InternalInputPort&); + InternalInputPort& operator=(const InternalInputPort&); + InternalInputPortResponseHandler *m_handler; +}; +} // ola +#endif // OLAD_INTERNALINPUTPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.cpp b/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.cpp new file mode 100644 index 0000000..272a256 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.cpp @@ -0,0 +1,321 @@ +/* + * 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 Library 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. + * + * InternalRDMController.cpp + * Manager internally generated RDM requests + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include "ola/StringUtils.h" +#include "olad/InternalRDMController.h" + +namespace ola { + +using ola::rdm::RDMCommand; + +const char InternalRDMController::MISMATCHED_RDM_RESPONSE_VAR[] = + "rdm-mismatched-responses"; +const char InternalRDMController::EXPIRED_RDM_REQUESTS_VAR[] = + "rdm-expired-requests"; +const char InternalRDMController::BROADCAST_RDM_REQUESTS_VAR[] = + "rdm-broadcast-requests"; +const char InternalRDMController::FAILED_RDM_REQUESTS_VAR[] = + "rdm-failed-requests"; + +/* + * Create a new OutstandingRDMRequest + */ +OutstandingRDMRequest::OutstandingRDMRequest( + const RDMRequest *request, + rdm_controller_callback *callback): + m_source_uid(request->SourceUID()), + m_sub_device(request->SubDevice()), + m_transaction_number(request->TransactionNumber()), + m_command_class(request->CommandClass()), + m_expires(), + m_callback(callback) { + Clock::CurrentTime(&m_expires); + m_expires += ola::TimeInterval(EXPIRY_TIMEOUT_S, 0); +} + + +/* + * Returns true if this response matches this request + */ +bool OutstandingRDMRequest::Matches(const RDMResponse *response) { + if (!response) + return false; + + if (response->DestinationUID() == m_source_uid && + response->TransactionNumber() == m_transaction_number && + response->SubDevice() == m_sub_device) { + if (response->CommandClass() == RDMCommand::GET_COMMAND_RESPONSE && + m_command_class == RDMCommand::GET_COMMAND) + return true; + if (response->CommandClass() == RDMCommand::SET_COMMAND_RESPONSE && + m_command_class == RDMCommand::SET_COMMAND) + return true; + } + return false; +} + + +/* + * Return true if this request has expired + */ +bool OutstandingRDMRequest::HasExpired(const TimeStamp &now) { + return now > m_expires; +} + + +/* + * Run the callback for this request + */ +void OutstandingRDMRequest::RunCallback(const rdm_response_data &data) { + if (m_callback) + m_callback->Run(data); + m_callback = NULL; +} + + +InternalRDMController::InternalRDMController(const UID &default_uid, + PortManager *port_manager, + class ExportMap *export_map): + m_default_uid(default_uid), + m_port_manager(port_manager), + m_export_map(export_map) { + m_export_map->GetUIntMapVar(MISMATCHED_RDM_RESPONSE_VAR); + m_export_map->GetUIntMapVar(EXPIRED_RDM_REQUESTS_VAR); + m_export_map->GetUIntMapVar(BROADCAST_RDM_REQUESTS_VAR); + m_export_map->GetUIntMapVar(FAILED_RDM_REQUESTS_VAR); +} + + +/* + * Tear down this InternalRDMController + */ +InternalRDMController::~InternalRDMController() { + // delete all ports + map::iterator port_iter; + for (port_iter = m_input_ports.begin(); port_iter != m_input_ports.end(); + ++port_iter) { + m_port_manager->UnPatchPort(port_iter->second); + delete port_iter->second; + } + m_input_ports.clear(); + + // delete out OutstandingRDMRequests + map >::iterator iter; + deque::iterator request_iter; + + rdm_response_data data = {RDM_RESPONSE_TIMED_OUT, NULL}; + for (iter = m_outstanding_requests.begin(); + iter != m_outstanding_requests.end(); ++iter) { + for (request_iter = iter->second.begin(); + request_iter != iter->second.end(); ++request_iter) { + (*request_iter)->RunCallback(data); + delete *request_iter; + } + } + m_transaction_numbers.clear(); +} + + +/* + * Send an RDMRequest, this may run the callback immediately if the send failed + */ +bool InternalRDMController::SendRDMRequest( + Universe *universe, + const UID &destination, + uint8_t sub_device, + uint16_t param_id, + const string &data, + bool is_set, + rdm_controller_callback *callback, + const UID *source) { + map::iterator port_iter = + m_input_ports.find(universe->UniverseId()); + + if (port_iter == m_input_ports.end()) { + // create a new InternalInputPort for this universe + InternalInputPort *input_port = new InternalInputPort( + universe->UniverseId(), + this); + if (!m_port_manager->PatchPort(input_port, universe->UniverseId())) { + OLA_WARN << "Failed to patch internal input port to universe " << + universe->UniverseId() << ", aborting RDM request"; + delete callback; + return false; + } + port_iter = m_input_ports.insert(pair( + universe->UniverseId(), + input_port)).first; + } + + UID source_uid = m_default_uid; + if (source) + source_uid = *source; + + // lookup transaction number + uint8_t transaction_number = 0; + pair transaction_key(universe->UniverseId(), + source_uid); + map, uint8_t>::iterator transaction_iter = + m_transaction_numbers.find(transaction_key); + if (transaction_iter == m_transaction_numbers.end()) + m_transaction_numbers[transaction_key] = 0; + else + transaction_number = ++transaction_iter->second; + + ola::rdm::RDMRequest *request = NULL; + if (is_set) { + request = new ola::rdm::RDMSetRequest( + source_uid, + destination, + transaction_number, + 1, // port id + 0, // message count + sub_device, + param_id, + reinterpret_cast(data.data()), + data.size()); + } else { + request = new ola::rdm::RDMGetRequest( + source_uid, + destination, + transaction_number, + 1, // port id + 0, // message count + sub_device, + param_id, + reinterpret_cast(data.data()), + data.size()); + } + + // this has to be done before the request is deleted below + OutstandingRDMRequest *outstanding_request = + new OutstandingRDMRequest(request, callback); + // We need to push this on now, because HandleRDMResponse could be called + // immediately + deque &request_list = + m_outstanding_requests[universe->UniverseId()]; + if (!destination.IsBroadcast()) + request_list.push_back(outstanding_request); + + if (port_iter->second->HandleRDMRequest(request)) { + if (destination.IsBroadcast()) { + (*m_export_map->GetUIntMapVar(BROADCAST_RDM_REQUESTS_VAR))[ + IntToString(universe->UniverseId())]++; + rdm_response_data data = {RDM_RESPONSE_BROADCAST, NULL}; + callback->Run(data); + delete outstanding_request; + return true; + } else { + return true; + } + } + // the request failed, remove it from the request queue + request_list.pop_back(); + (*m_export_map->GetUIntMapVar(FAILED_RDM_REQUESTS_VAR))[ + IntToString(universe->UniverseId())]++; + delete outstanding_request; + return false; +} + + +/* + * Handle RDM responses + */ +bool InternalRDMController::HandleRDMResponse( + unsigned int universe, + const ola::rdm::RDMResponse *response) { + // try to locate a match + OutstandingRDMRequest *request = NULL; + map >::iterator iter = + m_outstanding_requests.find(universe); + + if (iter == m_outstanding_requests.end()) { + // things have gone horibly wrong + OLA_WARN << "Got a RDMResponse but can't find universe " << universe; + delete response; + return false; + } + + deque::iterator request_iter; + for (request_iter = iter->second.begin(); + request_iter != iter->second.end(); ++request_iter) { + if ((*request_iter)->Matches(response)) { + request = *request_iter; + iter->second.erase(request_iter); + break; + } + } + + if (!request) { + OLA_WARN << "Unable to locate a matching request for RDM response"; + (*m_export_map->GetUIntMapVar(MISMATCHED_RDM_RESPONSE_VAR))[ + IntToString(universe)]++; + delete response; + return false; + } + + rdm_response_data data = {RDM_RESPONSE_OK, response}; + request->RunCallback(data); + delete request; + delete response; + return true; +} + + +/* + * Check for any exprired requests + * @param now the current time + */ +void InternalRDMController::CheckTimeouts(const TimeStamp &now) { + vector > expired_requests; + map >::iterator iter; + deque::iterator request_iter; + vector >::iterator expired_iter; + + for (iter = m_outstanding_requests.begin(); + iter != m_outstanding_requests.end(); ++iter) { + for (request_iter = iter->second.begin(); + request_iter != iter->second.end();) { + if ((*request_iter)->HasExpired(now)) { + expired_requests.push_back( + pair(iter->first, + *request_iter)); + request_iter = iter->second.erase(request_iter); + } else { + request_iter++; + } + } + } + + rdm_response_data data = {RDM_RESPONSE_TIMED_OUT, NULL}; + for (expired_iter = expired_requests.begin(); + expired_iter != expired_requests.end(); ++expired_iter) { + (*m_export_map->GetUIntMapVar(EXPIRED_RDM_REQUESTS_VAR))[ + IntToString(expired_iter->first)]++; + expired_iter->second->RunCallback(data); + delete expired_iter->second; + } + expired_requests.clear(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.h b/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.h new file mode 100644 index 0000000..82eb965 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/InternalRDMController.h @@ -0,0 +1,122 @@ +/* + * 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 Library 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. + * + * InternalRDMController.h + * Manager internally generated RDM requests + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_INTERNALRDMCONTROLLER_H_ +#define OLAD_INTERNALRDMCONTROLLER_H_ + +#include +#include +#include + +#include "ola/Callback.h" +#include "ola/Clock.h" +#include "ola/rdm/RDMCommand.h" +#include "ola/rdm/UID.h" +#include "olad/InternalInputPort.h" +#include "olad/PortManager.h" + +namespace ola { + +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; +using std::deque; + +typedef enum { + RDM_RESPONSE_OK, + RDM_RESPONSE_BROADCAST, + RDM_RESPONSE_TIMED_OUT, +} rdm_response_status; + +typedef struct { + rdm_response_status status; + const RDMResponse *response; +} rdm_response_data; + +typedef ola::SingleUseCallback1 + rdm_controller_callback; + +/* + * This represents an RDMRequest that we haven't got a response for yet + */ +class OutstandingRDMRequest { + public: + OutstandingRDMRequest(const RDMRequest *request, + rdm_controller_callback *callback); + bool Matches(const RDMResponse *response); + bool HasExpired(const TimeStamp &now); + void RunCallback(const rdm_response_data &data); + + private: + OutstandingRDMRequest(const OutstandingRDMRequest&); + OutstandingRDMRequest& operator=(const OutstandingRDMRequest&); + + const UID m_source_uid; + uint8_t m_sub_device; + uint8_t m_transaction_number; + ola::rdm::RDMCommand::RDMCommandClass m_command_class; + TimeStamp m_expires; + rdm_controller_callback *m_callback; + + static const unsigned int EXPIRY_TIMEOUT_S = 3; +}; + + +/* + * This class manages RDM requests generated internally. + */ +class InternalRDMController: public InternalInputPortResponseHandler { + public: + InternalRDMController(const UID &default_uid, + PortManager *port_manager, + class ExportMap *export_map); + ~InternalRDMController(); + + bool SendRDMRequest( + Universe *universe, + const UID &destination, + uint8_t sub_device, + uint16_t param_id, + const string &data, + bool is_set, + rdm_controller_callback *callback, + const UID *source = NULL); + + bool HandleRDMResponse(unsigned int universe, + const ola::rdm::RDMResponse *response); + void CheckTimeouts(const TimeStamp &now); + + private : + InternalRDMController(const InternalRDMController&); + InternalRDMController& operator=(const InternalRDMController&); + + const UID m_default_uid; + PortManager *m_port_manager; + map m_input_ports; + map, uint8_t> m_transaction_numbers; + map > m_outstanding_requests; + class ExportMap *m_export_map; + + static const char MISMATCHED_RDM_RESPONSE_VAR[]; + static const char EXPIRED_RDM_REQUESTS_VAR[]; + static const char BROADCAST_RDM_REQUESTS_VAR[]; + static const char FAILED_RDM_REQUESTS_VAR[]; +}; +} // ola +#endif // OLAD_INTERNALRDMCONTROLLER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/Makefile.am b/open-lighting-architecture/ola-0.8.4/olad/Makefile.am new file mode 100644 index 0000000..0969ef0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Makefile.am @@ -0,0 +1,57 @@ +include $(top_srcdir)/common.mk +SUBDIRS = www testdata + + +OLASERVER_SOURCES = Client.cpp Device.cpp DeviceManager.cpp DmxSource.cpp \ + DynamicPluginLoader.cpp HttpModule.cpp \ + InternalInputPort.cpp InternalRDMController.cpp \ + OlaServerServiceImpl.cpp Plugin.cpp PluginAdaptor.cpp \ + PluginManager.cpp Preferences.cpp Port.cpp PortManager.cpp \ + RDMHttpModule.cpp Universe.cpp UniverseStore.cpp + +# lib olaserver +lib_LTLIBRARIES = libolaserver.la +libolaserver_la_SOURCES = $(OLASERVER_SOURCES) OlaServer.cpp OlaDaemon.cpp +libolaserver_la_LDFLAGS = -lprotobuf ${PLUGIN_LIBS} ${MICROHTTPD_LIBS} + +if HAVE_LIBMICROHTTPD +libolaserver_la_SOURCES += HttpServer.cpp HttpServerActions.cpp \ + OlaHttpServer.cpp +endif + +libolaserver_la_LIBADD = $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/common/web/libolaweb.la \ + $(top_builddir)/ola/libola.la +libolaserver_la_CXXFLAGS = -Wall -Wformat -W @OLAD_DEFINES@ $(libusb_CFLAGS) + +# Header files +pkgincludedir = $(includedir)/olad +pkginclude_HEADERS = OlaDaemon.h OlaServer.h + +EXTRA_DIST = Client.h DeviceManager.h DlOpenPluginLoader.h \ + DynamicPluginLoader.h HttpModule.h \ + HttpServer.h HttpServerActions.h InternalInputPort.h \ + InternalRDMController.h OlaHttpServer.h OlaVersion.h \ + OlaServerServiceImpl.h PluginLoader.h PluginManager.h \ + PortManager.h RDMHttpModule.h TestCommon.h UniverseStore.h + +# Olad Server +bin_PROGRAMS = olad +olad_SOURCES = Olad.cpp +#olad_CXXFLAGS = -Wall -Werror -Wformat -W +olad_CXXFLAGS = -Wall -Wformat -W +olad_LDFLAGS = -rdynamic -ldl -lprotobuf $(UUID_LIBS) +olad_LDADD = @LIBS@ libolaserver.la \ + $(top_builddir)/common/libolacommon.la + +# Test Programs +TESTS = OlaTester +check_PROGRAMS = $(TESTS) +OlaTester_SOURCES = OlaServerTester.cpp \ + UniverseTest.cpp DeviceTest.cpp DeviceManagerTest.cpp \ + DmxSourceTest.cpp PluginManagerTest.cpp \ + PreferencesTest.cpp PortManagerTest.cpp PortTest.cpp \ + OlaServerServiceImplTest.cpp ClientTest.cpp +OlaTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +OlaTester_LDFLAGS = $(CPPUNIT_LIBS) +OlaTester_LDADD = @LIBS@ $(top_builddir)/olad/libolaserver.la diff --git a/open-lighting-architecture/ola-0.8.4/olad/Makefile.in b/open-lighting-architecture/ola-0.8.4/olad/Makefile.in new file mode 100644 index 0000000..6ba943d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Makefile.in @@ -0,0 +1,1225 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/OlaVersion.h.in \ + $(top_srcdir)/common.mk +@HAVE_LIBMICROHTTPD_TRUE@am__append_1 = HttpServer.cpp HttpServerActions.cpp \ +@HAVE_LIBMICROHTTPD_TRUE@ OlaHttpServer.cpp + +bin_PROGRAMS = olad$(EXEEXT) +TESTS = OlaTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = olad +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = OlaVersion.h +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolaserver_la_DEPENDENCIES = $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/common/web/libolaweb.la \ + $(top_builddir)/ola/libola.la +am__libolaserver_la_SOURCES_DIST = Client.cpp Device.cpp \ + DeviceManager.cpp DmxSource.cpp DynamicPluginLoader.cpp \ + HttpModule.cpp InternalInputPort.cpp InternalRDMController.cpp \ + OlaServerServiceImpl.cpp Plugin.cpp PluginAdaptor.cpp \ + PluginManager.cpp Preferences.cpp Port.cpp PortManager.cpp \ + RDMHttpModule.cpp Universe.cpp UniverseStore.cpp OlaServer.cpp \ + OlaDaemon.cpp HttpServer.cpp HttpServerActions.cpp \ + OlaHttpServer.cpp +am__objects_1 = libolaserver_la-Client.lo libolaserver_la-Device.lo \ + libolaserver_la-DeviceManager.lo libolaserver_la-DmxSource.lo \ + libolaserver_la-DynamicPluginLoader.lo \ + libolaserver_la-HttpModule.lo \ + libolaserver_la-InternalInputPort.lo \ + libolaserver_la-InternalRDMController.lo \ + libolaserver_la-OlaServerServiceImpl.lo \ + libolaserver_la-Plugin.lo libolaserver_la-PluginAdaptor.lo \ + libolaserver_la-PluginManager.lo \ + libolaserver_la-Preferences.lo libolaserver_la-Port.lo \ + libolaserver_la-PortManager.lo \ + libolaserver_la-RDMHttpModule.lo libolaserver_la-Universe.lo \ + libolaserver_la-UniverseStore.lo +@HAVE_LIBMICROHTTPD_TRUE@am__objects_2 = \ +@HAVE_LIBMICROHTTPD_TRUE@ libolaserver_la-HttpServer.lo \ +@HAVE_LIBMICROHTTPD_TRUE@ libolaserver_la-HttpServerActions.lo \ +@HAVE_LIBMICROHTTPD_TRUE@ libolaserver_la-OlaHttpServer.lo +am_libolaserver_la_OBJECTS = $(am__objects_1) \ + libolaserver_la-OlaServer.lo libolaserver_la-OlaDaemon.lo \ + $(am__objects_2) +libolaserver_la_OBJECTS = $(am_libolaserver_la_OBJECTS) +libolaserver_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) \ + $(libolaserver_la_LDFLAGS) $(LDFLAGS) -o $@ +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +am__EXEEXT_1 = OlaTester$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) +am_OlaTester_OBJECTS = OlaTester-OlaServerTester.$(OBJEXT) \ + OlaTester-UniverseTest.$(OBJEXT) \ + OlaTester-DeviceTest.$(OBJEXT) \ + OlaTester-DeviceManagerTest.$(OBJEXT) \ + OlaTester-DmxSourceTest.$(OBJEXT) \ + OlaTester-PluginManagerTest.$(OBJEXT) \ + OlaTester-PreferencesTest.$(OBJEXT) \ + OlaTester-PortManagerTest.$(OBJEXT) \ + OlaTester-PortTest.$(OBJEXT) \ + OlaTester-OlaServerServiceImplTest.$(OBJEXT) \ + OlaTester-ClientTest.$(OBJEXT) +OlaTester_OBJECTS = $(am_OlaTester_OBJECTS) +OlaTester_DEPENDENCIES = $(top_builddir)/olad/libolaserver.la +OlaTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(OlaTester_CXXFLAGS) \ + $(CXXFLAGS) $(OlaTester_LDFLAGS) $(LDFLAGS) -o $@ +am_olad_OBJECTS = olad-Olad.$(OBJEXT) +olad_OBJECTS = $(am_olad_OBJECTS) +olad_DEPENDENCIES = libolaserver.la \ + $(top_builddir)/common/libolacommon.la +olad_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(olad_CXXFLAGS) $(CXXFLAGS) \ + $(olad_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaserver_la_SOURCES) $(OlaTester_SOURCES) \ + $(olad_SOURCES) +DIST_SOURCES = $(am__libolaserver_la_SOURCES_DIST) \ + $(OlaTester_SOURCES) $(olad_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(pkginclude_HEADERS) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +# Header files +pkgincludedir = $(includedir)/olad +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +SUBDIRS = www testdata +OLASERVER_SOURCES = Client.cpp Device.cpp DeviceManager.cpp DmxSource.cpp \ + DynamicPluginLoader.cpp HttpModule.cpp \ + InternalInputPort.cpp InternalRDMController.cpp \ + OlaServerServiceImpl.cpp Plugin.cpp PluginAdaptor.cpp \ + PluginManager.cpp Preferences.cpp Port.cpp PortManager.cpp \ + RDMHttpModule.cpp Universe.cpp UniverseStore.cpp + + +# lib olaserver +lib_LTLIBRARIES = libolaserver.la +libolaserver_la_SOURCES = $(OLASERVER_SOURCES) OlaServer.cpp \ + OlaDaemon.cpp $(am__append_1) +libolaserver_la_LDFLAGS = -lprotobuf ${PLUGIN_LIBS} ${MICROHTTPD_LIBS} +libolaserver_la_LIBADD = $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/common/web/libolaweb.la \ + $(top_builddir)/ola/libola.la + +libolaserver_la_CXXFLAGS = -Wall -Wformat -W @OLAD_DEFINES@ $(libusb_CFLAGS) +pkginclude_HEADERS = OlaDaemon.h OlaServer.h +EXTRA_DIST = Client.h DeviceManager.h DlOpenPluginLoader.h \ + DynamicPluginLoader.h HttpModule.h \ + HttpServer.h HttpServerActions.h InternalInputPort.h \ + InternalRDMController.h OlaHttpServer.h OlaVersion.h \ + OlaServerServiceImpl.h PluginLoader.h PluginManager.h \ + PortManager.h RDMHttpModule.h TestCommon.h UniverseStore.h + +olad_SOURCES = Olad.cpp +#olad_CXXFLAGS = -Wall -Werror -Wformat -W +olad_CXXFLAGS = -Wall -Wformat -W +olad_LDFLAGS = -rdynamic -ldl -lprotobuf $(UUID_LIBS) +olad_LDADD = @LIBS@ libolaserver.la \ + $(top_builddir)/common/libolacommon.la + +OlaTester_SOURCES = OlaServerTester.cpp \ + UniverseTest.cpp DeviceTest.cpp DeviceManagerTest.cpp \ + DmxSourceTest.cpp PluginManagerTest.cpp \ + PreferencesTest.cpp PortManagerTest.cpp PortTest.cpp \ + OlaServerServiceImplTest.cpp ClientTest.cpp + +OlaTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +OlaTester_LDFLAGS = $(CPPUNIT_LIBS) +OlaTester_LDADD = @LIBS@ $(top_builddir)/olad/libolaserver.la +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu olad/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu olad/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +OlaVersion.h: $(top_builddir)/config.status $(srcdir)/OlaVersion.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaserver.la: $(libolaserver_la_OBJECTS) $(libolaserver_la_DEPENDENCIES) + $(libolaserver_la_LINK) -rpath $(libdir) $(libolaserver_la_OBJECTS) $(libolaserver_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +OlaTester$(EXEEXT): $(OlaTester_OBJECTS) $(OlaTester_DEPENDENCIES) + @rm -f OlaTester$(EXEEXT) + $(OlaTester_LINK) $(OlaTester_OBJECTS) $(OlaTester_LDADD) $(LIBS) +olad$(EXEEXT): $(olad_OBJECTS) $(olad_DEPENDENCIES) + @rm -f olad$(EXEEXT) + $(olad_LINK) $(olad_OBJECTS) $(olad_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-ClientTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-DeviceManagerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-DeviceTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-DmxSourceTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-OlaServerServiceImplTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-OlaServerTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-PluginManagerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-PortManagerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-PortTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-PreferencesTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaTester-UniverseTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Client.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-DeviceManager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-DmxSource.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-DynamicPluginLoader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-HttpModule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-HttpServer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-HttpServerActions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-InternalInputPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-InternalRDMController.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-OlaDaemon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-OlaHttpServer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-OlaServer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-OlaServerServiceImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Plugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-PluginAdaptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-PluginManager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Port.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-PortManager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Preferences.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-RDMHttpModule.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-Universe.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolaserver_la-UniverseStore.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/olad-Olad.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libolaserver_la-Client.lo: Client.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Client.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Client.Tpo -c -o libolaserver_la-Client.lo `test -f 'Client.cpp' || echo '$(srcdir)/'`Client.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Client.Tpo $(DEPDIR)/libolaserver_la-Client.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Client.cpp' object='libolaserver_la-Client.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Client.lo `test -f 'Client.cpp' || echo '$(srcdir)/'`Client.cpp + +libolaserver_la-Device.lo: Device.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Device.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Device.Tpo -c -o libolaserver_la-Device.lo `test -f 'Device.cpp' || echo '$(srcdir)/'`Device.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Device.Tpo $(DEPDIR)/libolaserver_la-Device.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Device.cpp' object='libolaserver_la-Device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Device.lo `test -f 'Device.cpp' || echo '$(srcdir)/'`Device.cpp + +libolaserver_la-DeviceManager.lo: DeviceManager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-DeviceManager.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-DeviceManager.Tpo -c -o libolaserver_la-DeviceManager.lo `test -f 'DeviceManager.cpp' || echo '$(srcdir)/'`DeviceManager.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-DeviceManager.Tpo $(DEPDIR)/libolaserver_la-DeviceManager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DeviceManager.cpp' object='libolaserver_la-DeviceManager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-DeviceManager.lo `test -f 'DeviceManager.cpp' || echo '$(srcdir)/'`DeviceManager.cpp + +libolaserver_la-DmxSource.lo: DmxSource.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-DmxSource.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-DmxSource.Tpo -c -o libolaserver_la-DmxSource.lo `test -f 'DmxSource.cpp' || echo '$(srcdir)/'`DmxSource.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-DmxSource.Tpo $(DEPDIR)/libolaserver_la-DmxSource.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DmxSource.cpp' object='libolaserver_la-DmxSource.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-DmxSource.lo `test -f 'DmxSource.cpp' || echo '$(srcdir)/'`DmxSource.cpp + +libolaserver_la-DynamicPluginLoader.lo: DynamicPluginLoader.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-DynamicPluginLoader.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-DynamicPluginLoader.Tpo -c -o libolaserver_la-DynamicPluginLoader.lo `test -f 'DynamicPluginLoader.cpp' || echo '$(srcdir)/'`DynamicPluginLoader.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-DynamicPluginLoader.Tpo $(DEPDIR)/libolaserver_la-DynamicPluginLoader.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DynamicPluginLoader.cpp' object='libolaserver_la-DynamicPluginLoader.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-DynamicPluginLoader.lo `test -f 'DynamicPluginLoader.cpp' || echo '$(srcdir)/'`DynamicPluginLoader.cpp + +libolaserver_la-HttpModule.lo: HttpModule.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-HttpModule.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-HttpModule.Tpo -c -o libolaserver_la-HttpModule.lo `test -f 'HttpModule.cpp' || echo '$(srcdir)/'`HttpModule.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-HttpModule.Tpo $(DEPDIR)/libolaserver_la-HttpModule.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpModule.cpp' object='libolaserver_la-HttpModule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-HttpModule.lo `test -f 'HttpModule.cpp' || echo '$(srcdir)/'`HttpModule.cpp + +libolaserver_la-InternalInputPort.lo: InternalInputPort.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-InternalInputPort.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-InternalInputPort.Tpo -c -o libolaserver_la-InternalInputPort.lo `test -f 'InternalInputPort.cpp' || echo '$(srcdir)/'`InternalInputPort.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-InternalInputPort.Tpo $(DEPDIR)/libolaserver_la-InternalInputPort.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InternalInputPort.cpp' object='libolaserver_la-InternalInputPort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-InternalInputPort.lo `test -f 'InternalInputPort.cpp' || echo '$(srcdir)/'`InternalInputPort.cpp + +libolaserver_la-InternalRDMController.lo: InternalRDMController.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-InternalRDMController.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-InternalRDMController.Tpo -c -o libolaserver_la-InternalRDMController.lo `test -f 'InternalRDMController.cpp' || echo '$(srcdir)/'`InternalRDMController.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-InternalRDMController.Tpo $(DEPDIR)/libolaserver_la-InternalRDMController.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='InternalRDMController.cpp' object='libolaserver_la-InternalRDMController.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-InternalRDMController.lo `test -f 'InternalRDMController.cpp' || echo '$(srcdir)/'`InternalRDMController.cpp + +libolaserver_la-OlaServerServiceImpl.lo: OlaServerServiceImpl.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-OlaServerServiceImpl.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-OlaServerServiceImpl.Tpo -c -o libolaserver_la-OlaServerServiceImpl.lo `test -f 'OlaServerServiceImpl.cpp' || echo '$(srcdir)/'`OlaServerServiceImpl.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-OlaServerServiceImpl.Tpo $(DEPDIR)/libolaserver_la-OlaServerServiceImpl.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServerServiceImpl.cpp' object='libolaserver_la-OlaServerServiceImpl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-OlaServerServiceImpl.lo `test -f 'OlaServerServiceImpl.cpp' || echo '$(srcdir)/'`OlaServerServiceImpl.cpp + +libolaserver_la-Plugin.lo: Plugin.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Plugin.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Plugin.Tpo -c -o libolaserver_la-Plugin.lo `test -f 'Plugin.cpp' || echo '$(srcdir)/'`Plugin.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Plugin.Tpo $(DEPDIR)/libolaserver_la-Plugin.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Plugin.cpp' object='libolaserver_la-Plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Plugin.lo `test -f 'Plugin.cpp' || echo '$(srcdir)/'`Plugin.cpp + +libolaserver_la-PluginAdaptor.lo: PluginAdaptor.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-PluginAdaptor.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-PluginAdaptor.Tpo -c -o libolaserver_la-PluginAdaptor.lo `test -f 'PluginAdaptor.cpp' || echo '$(srcdir)/'`PluginAdaptor.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-PluginAdaptor.Tpo $(DEPDIR)/libolaserver_la-PluginAdaptor.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PluginAdaptor.cpp' object='libolaserver_la-PluginAdaptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-PluginAdaptor.lo `test -f 'PluginAdaptor.cpp' || echo '$(srcdir)/'`PluginAdaptor.cpp + +libolaserver_la-PluginManager.lo: PluginManager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-PluginManager.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-PluginManager.Tpo -c -o libolaserver_la-PluginManager.lo `test -f 'PluginManager.cpp' || echo '$(srcdir)/'`PluginManager.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-PluginManager.Tpo $(DEPDIR)/libolaserver_la-PluginManager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PluginManager.cpp' object='libolaserver_la-PluginManager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-PluginManager.lo `test -f 'PluginManager.cpp' || echo '$(srcdir)/'`PluginManager.cpp + +libolaserver_la-Preferences.lo: Preferences.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Preferences.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Preferences.Tpo -c -o libolaserver_la-Preferences.lo `test -f 'Preferences.cpp' || echo '$(srcdir)/'`Preferences.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Preferences.Tpo $(DEPDIR)/libolaserver_la-Preferences.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Preferences.cpp' object='libolaserver_la-Preferences.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Preferences.lo `test -f 'Preferences.cpp' || echo '$(srcdir)/'`Preferences.cpp + +libolaserver_la-Port.lo: Port.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Port.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Port.Tpo -c -o libolaserver_la-Port.lo `test -f 'Port.cpp' || echo '$(srcdir)/'`Port.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Port.Tpo $(DEPDIR)/libolaserver_la-Port.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Port.cpp' object='libolaserver_la-Port.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Port.lo `test -f 'Port.cpp' || echo '$(srcdir)/'`Port.cpp + +libolaserver_la-PortManager.lo: PortManager.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-PortManager.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-PortManager.Tpo -c -o libolaserver_la-PortManager.lo `test -f 'PortManager.cpp' || echo '$(srcdir)/'`PortManager.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-PortManager.Tpo $(DEPDIR)/libolaserver_la-PortManager.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PortManager.cpp' object='libolaserver_la-PortManager.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-PortManager.lo `test -f 'PortManager.cpp' || echo '$(srcdir)/'`PortManager.cpp + +libolaserver_la-RDMHttpModule.lo: RDMHttpModule.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-RDMHttpModule.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-RDMHttpModule.Tpo -c -o libolaserver_la-RDMHttpModule.lo `test -f 'RDMHttpModule.cpp' || echo '$(srcdir)/'`RDMHttpModule.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-RDMHttpModule.Tpo $(DEPDIR)/libolaserver_la-RDMHttpModule.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RDMHttpModule.cpp' object='libolaserver_la-RDMHttpModule.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-RDMHttpModule.lo `test -f 'RDMHttpModule.cpp' || echo '$(srcdir)/'`RDMHttpModule.cpp + +libolaserver_la-Universe.lo: Universe.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-Universe.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-Universe.Tpo -c -o libolaserver_la-Universe.lo `test -f 'Universe.cpp' || echo '$(srcdir)/'`Universe.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-Universe.Tpo $(DEPDIR)/libolaserver_la-Universe.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Universe.cpp' object='libolaserver_la-Universe.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-Universe.lo `test -f 'Universe.cpp' || echo '$(srcdir)/'`Universe.cpp + +libolaserver_la-UniverseStore.lo: UniverseStore.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-UniverseStore.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-UniverseStore.Tpo -c -o libolaserver_la-UniverseStore.lo `test -f 'UniverseStore.cpp' || echo '$(srcdir)/'`UniverseStore.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-UniverseStore.Tpo $(DEPDIR)/libolaserver_la-UniverseStore.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UniverseStore.cpp' object='libolaserver_la-UniverseStore.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-UniverseStore.lo `test -f 'UniverseStore.cpp' || echo '$(srcdir)/'`UniverseStore.cpp + +libolaserver_la-OlaServer.lo: OlaServer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-OlaServer.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-OlaServer.Tpo -c -o libolaserver_la-OlaServer.lo `test -f 'OlaServer.cpp' || echo '$(srcdir)/'`OlaServer.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-OlaServer.Tpo $(DEPDIR)/libolaserver_la-OlaServer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServer.cpp' object='libolaserver_la-OlaServer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-OlaServer.lo `test -f 'OlaServer.cpp' || echo '$(srcdir)/'`OlaServer.cpp + +libolaserver_la-OlaDaemon.lo: OlaDaemon.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-OlaDaemon.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-OlaDaemon.Tpo -c -o libolaserver_la-OlaDaemon.lo `test -f 'OlaDaemon.cpp' || echo '$(srcdir)/'`OlaDaemon.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-OlaDaemon.Tpo $(DEPDIR)/libolaserver_la-OlaDaemon.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaDaemon.cpp' object='libolaserver_la-OlaDaemon.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-OlaDaemon.lo `test -f 'OlaDaemon.cpp' || echo '$(srcdir)/'`OlaDaemon.cpp + +libolaserver_la-HttpServer.lo: HttpServer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-HttpServer.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-HttpServer.Tpo -c -o libolaserver_la-HttpServer.lo `test -f 'HttpServer.cpp' || echo '$(srcdir)/'`HttpServer.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-HttpServer.Tpo $(DEPDIR)/libolaserver_la-HttpServer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpServer.cpp' object='libolaserver_la-HttpServer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-HttpServer.lo `test -f 'HttpServer.cpp' || echo '$(srcdir)/'`HttpServer.cpp + +libolaserver_la-HttpServerActions.lo: HttpServerActions.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-HttpServerActions.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-HttpServerActions.Tpo -c -o libolaserver_la-HttpServerActions.lo `test -f 'HttpServerActions.cpp' || echo '$(srcdir)/'`HttpServerActions.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-HttpServerActions.Tpo $(DEPDIR)/libolaserver_la-HttpServerActions.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HttpServerActions.cpp' object='libolaserver_la-HttpServerActions.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-HttpServerActions.lo `test -f 'HttpServerActions.cpp' || echo '$(srcdir)/'`HttpServerActions.cpp + +libolaserver_la-OlaHttpServer.lo: OlaHttpServer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -MT libolaserver_la-OlaHttpServer.lo -MD -MP -MF $(DEPDIR)/libolaserver_la-OlaHttpServer.Tpo -c -o libolaserver_la-OlaHttpServer.lo `test -f 'OlaHttpServer.cpp' || echo '$(srcdir)/'`OlaHttpServer.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolaserver_la-OlaHttpServer.Tpo $(DEPDIR)/libolaserver_la-OlaHttpServer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaHttpServer.cpp' object='libolaserver_la-OlaHttpServer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolaserver_la_CXXFLAGS) $(CXXFLAGS) -c -o libolaserver_la-OlaHttpServer.lo `test -f 'OlaHttpServer.cpp' || echo '$(srcdir)/'`OlaHttpServer.cpp + +OlaTester-OlaServerTester.o: OlaServerTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-OlaServerTester.o -MD -MP -MF $(DEPDIR)/OlaTester-OlaServerTester.Tpo -c -o OlaTester-OlaServerTester.o `test -f 'OlaServerTester.cpp' || echo '$(srcdir)/'`OlaServerTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-OlaServerTester.Tpo $(DEPDIR)/OlaTester-OlaServerTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServerTester.cpp' object='OlaTester-OlaServerTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-OlaServerTester.o `test -f 'OlaServerTester.cpp' || echo '$(srcdir)/'`OlaServerTester.cpp + +OlaTester-OlaServerTester.obj: OlaServerTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-OlaServerTester.obj -MD -MP -MF $(DEPDIR)/OlaTester-OlaServerTester.Tpo -c -o OlaTester-OlaServerTester.obj `if test -f 'OlaServerTester.cpp'; then $(CYGPATH_W) 'OlaServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaServerTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-OlaServerTester.Tpo $(DEPDIR)/OlaTester-OlaServerTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServerTester.cpp' object='OlaTester-OlaServerTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-OlaServerTester.obj `if test -f 'OlaServerTester.cpp'; then $(CYGPATH_W) 'OlaServerTester.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaServerTester.cpp'; fi` + +OlaTester-UniverseTest.o: UniverseTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-UniverseTest.o -MD -MP -MF $(DEPDIR)/OlaTester-UniverseTest.Tpo -c -o OlaTester-UniverseTest.o `test -f 'UniverseTest.cpp' || echo '$(srcdir)/'`UniverseTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-UniverseTest.Tpo $(DEPDIR)/OlaTester-UniverseTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UniverseTest.cpp' object='OlaTester-UniverseTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-UniverseTest.o `test -f 'UniverseTest.cpp' || echo '$(srcdir)/'`UniverseTest.cpp + +OlaTester-UniverseTest.obj: UniverseTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-UniverseTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-UniverseTest.Tpo -c -o OlaTester-UniverseTest.obj `if test -f 'UniverseTest.cpp'; then $(CYGPATH_W) 'UniverseTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UniverseTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-UniverseTest.Tpo $(DEPDIR)/OlaTester-UniverseTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UniverseTest.cpp' object='OlaTester-UniverseTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-UniverseTest.obj `if test -f 'UniverseTest.cpp'; then $(CYGPATH_W) 'UniverseTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UniverseTest.cpp'; fi` + +OlaTester-DeviceTest.o: DeviceTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DeviceTest.o -MD -MP -MF $(DEPDIR)/OlaTester-DeviceTest.Tpo -c -o OlaTester-DeviceTest.o `test -f 'DeviceTest.cpp' || echo '$(srcdir)/'`DeviceTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DeviceTest.Tpo $(DEPDIR)/OlaTester-DeviceTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DeviceTest.cpp' object='OlaTester-DeviceTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DeviceTest.o `test -f 'DeviceTest.cpp' || echo '$(srcdir)/'`DeviceTest.cpp + +OlaTester-DeviceTest.obj: DeviceTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DeviceTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-DeviceTest.Tpo -c -o OlaTester-DeviceTest.obj `if test -f 'DeviceTest.cpp'; then $(CYGPATH_W) 'DeviceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DeviceTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DeviceTest.Tpo $(DEPDIR)/OlaTester-DeviceTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DeviceTest.cpp' object='OlaTester-DeviceTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DeviceTest.obj `if test -f 'DeviceTest.cpp'; then $(CYGPATH_W) 'DeviceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DeviceTest.cpp'; fi` + +OlaTester-DeviceManagerTest.o: DeviceManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DeviceManagerTest.o -MD -MP -MF $(DEPDIR)/OlaTester-DeviceManagerTest.Tpo -c -o OlaTester-DeviceManagerTest.o `test -f 'DeviceManagerTest.cpp' || echo '$(srcdir)/'`DeviceManagerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DeviceManagerTest.Tpo $(DEPDIR)/OlaTester-DeviceManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DeviceManagerTest.cpp' object='OlaTester-DeviceManagerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DeviceManagerTest.o `test -f 'DeviceManagerTest.cpp' || echo '$(srcdir)/'`DeviceManagerTest.cpp + +OlaTester-DeviceManagerTest.obj: DeviceManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DeviceManagerTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-DeviceManagerTest.Tpo -c -o OlaTester-DeviceManagerTest.obj `if test -f 'DeviceManagerTest.cpp'; then $(CYGPATH_W) 'DeviceManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DeviceManagerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DeviceManagerTest.Tpo $(DEPDIR)/OlaTester-DeviceManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DeviceManagerTest.cpp' object='OlaTester-DeviceManagerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DeviceManagerTest.obj `if test -f 'DeviceManagerTest.cpp'; then $(CYGPATH_W) 'DeviceManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DeviceManagerTest.cpp'; fi` + +OlaTester-DmxSourceTest.o: DmxSourceTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DmxSourceTest.o -MD -MP -MF $(DEPDIR)/OlaTester-DmxSourceTest.Tpo -c -o OlaTester-DmxSourceTest.o `test -f 'DmxSourceTest.cpp' || echo '$(srcdir)/'`DmxSourceTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DmxSourceTest.Tpo $(DEPDIR)/OlaTester-DmxSourceTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DmxSourceTest.cpp' object='OlaTester-DmxSourceTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DmxSourceTest.o `test -f 'DmxSourceTest.cpp' || echo '$(srcdir)/'`DmxSourceTest.cpp + +OlaTester-DmxSourceTest.obj: DmxSourceTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-DmxSourceTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-DmxSourceTest.Tpo -c -o OlaTester-DmxSourceTest.obj `if test -f 'DmxSourceTest.cpp'; then $(CYGPATH_W) 'DmxSourceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DmxSourceTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-DmxSourceTest.Tpo $(DEPDIR)/OlaTester-DmxSourceTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DmxSourceTest.cpp' object='OlaTester-DmxSourceTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-DmxSourceTest.obj `if test -f 'DmxSourceTest.cpp'; then $(CYGPATH_W) 'DmxSourceTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DmxSourceTest.cpp'; fi` + +OlaTester-PluginManagerTest.o: PluginManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PluginManagerTest.o -MD -MP -MF $(DEPDIR)/OlaTester-PluginManagerTest.Tpo -c -o OlaTester-PluginManagerTest.o `test -f 'PluginManagerTest.cpp' || echo '$(srcdir)/'`PluginManagerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PluginManagerTest.Tpo $(DEPDIR)/OlaTester-PluginManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PluginManagerTest.cpp' object='OlaTester-PluginManagerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PluginManagerTest.o `test -f 'PluginManagerTest.cpp' || echo '$(srcdir)/'`PluginManagerTest.cpp + +OlaTester-PluginManagerTest.obj: PluginManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PluginManagerTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-PluginManagerTest.Tpo -c -o OlaTester-PluginManagerTest.obj `if test -f 'PluginManagerTest.cpp'; then $(CYGPATH_W) 'PluginManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PluginManagerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PluginManagerTest.Tpo $(DEPDIR)/OlaTester-PluginManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PluginManagerTest.cpp' object='OlaTester-PluginManagerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PluginManagerTest.obj `if test -f 'PluginManagerTest.cpp'; then $(CYGPATH_W) 'PluginManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PluginManagerTest.cpp'; fi` + +OlaTester-PreferencesTest.o: PreferencesTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PreferencesTest.o -MD -MP -MF $(DEPDIR)/OlaTester-PreferencesTest.Tpo -c -o OlaTester-PreferencesTest.o `test -f 'PreferencesTest.cpp' || echo '$(srcdir)/'`PreferencesTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PreferencesTest.Tpo $(DEPDIR)/OlaTester-PreferencesTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PreferencesTest.cpp' object='OlaTester-PreferencesTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PreferencesTest.o `test -f 'PreferencesTest.cpp' || echo '$(srcdir)/'`PreferencesTest.cpp + +OlaTester-PreferencesTest.obj: PreferencesTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PreferencesTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-PreferencesTest.Tpo -c -o OlaTester-PreferencesTest.obj `if test -f 'PreferencesTest.cpp'; then $(CYGPATH_W) 'PreferencesTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PreferencesTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PreferencesTest.Tpo $(DEPDIR)/OlaTester-PreferencesTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PreferencesTest.cpp' object='OlaTester-PreferencesTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PreferencesTest.obj `if test -f 'PreferencesTest.cpp'; then $(CYGPATH_W) 'PreferencesTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PreferencesTest.cpp'; fi` + +OlaTester-PortManagerTest.o: PortManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PortManagerTest.o -MD -MP -MF $(DEPDIR)/OlaTester-PortManagerTest.Tpo -c -o OlaTester-PortManagerTest.o `test -f 'PortManagerTest.cpp' || echo '$(srcdir)/'`PortManagerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PortManagerTest.Tpo $(DEPDIR)/OlaTester-PortManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PortManagerTest.cpp' object='OlaTester-PortManagerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PortManagerTest.o `test -f 'PortManagerTest.cpp' || echo '$(srcdir)/'`PortManagerTest.cpp + +OlaTester-PortManagerTest.obj: PortManagerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PortManagerTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-PortManagerTest.Tpo -c -o OlaTester-PortManagerTest.obj `if test -f 'PortManagerTest.cpp'; then $(CYGPATH_W) 'PortManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PortManagerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PortManagerTest.Tpo $(DEPDIR)/OlaTester-PortManagerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PortManagerTest.cpp' object='OlaTester-PortManagerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PortManagerTest.obj `if test -f 'PortManagerTest.cpp'; then $(CYGPATH_W) 'PortManagerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PortManagerTest.cpp'; fi` + +OlaTester-PortTest.o: PortTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PortTest.o -MD -MP -MF $(DEPDIR)/OlaTester-PortTest.Tpo -c -o OlaTester-PortTest.o `test -f 'PortTest.cpp' || echo '$(srcdir)/'`PortTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PortTest.Tpo $(DEPDIR)/OlaTester-PortTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PortTest.cpp' object='OlaTester-PortTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PortTest.o `test -f 'PortTest.cpp' || echo '$(srcdir)/'`PortTest.cpp + +OlaTester-PortTest.obj: PortTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-PortTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-PortTest.Tpo -c -o OlaTester-PortTest.obj `if test -f 'PortTest.cpp'; then $(CYGPATH_W) 'PortTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PortTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-PortTest.Tpo $(DEPDIR)/OlaTester-PortTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PortTest.cpp' object='OlaTester-PortTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-PortTest.obj `if test -f 'PortTest.cpp'; then $(CYGPATH_W) 'PortTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PortTest.cpp'; fi` + +OlaTester-OlaServerServiceImplTest.o: OlaServerServiceImplTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-OlaServerServiceImplTest.o -MD -MP -MF $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Tpo -c -o OlaTester-OlaServerServiceImplTest.o `test -f 'OlaServerServiceImplTest.cpp' || echo '$(srcdir)/'`OlaServerServiceImplTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Tpo $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServerServiceImplTest.cpp' object='OlaTester-OlaServerServiceImplTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-OlaServerServiceImplTest.o `test -f 'OlaServerServiceImplTest.cpp' || echo '$(srcdir)/'`OlaServerServiceImplTest.cpp + +OlaTester-OlaServerServiceImplTest.obj: OlaServerServiceImplTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-OlaServerServiceImplTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Tpo -c -o OlaTester-OlaServerServiceImplTest.obj `if test -f 'OlaServerServiceImplTest.cpp'; then $(CYGPATH_W) 'OlaServerServiceImplTest.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaServerServiceImplTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Tpo $(DEPDIR)/OlaTester-OlaServerServiceImplTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OlaServerServiceImplTest.cpp' object='OlaTester-OlaServerServiceImplTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-OlaServerServiceImplTest.obj `if test -f 'OlaServerServiceImplTest.cpp'; then $(CYGPATH_W) 'OlaServerServiceImplTest.cpp'; else $(CYGPATH_W) '$(srcdir)/OlaServerServiceImplTest.cpp'; fi` + +OlaTester-ClientTest.o: ClientTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-ClientTest.o -MD -MP -MF $(DEPDIR)/OlaTester-ClientTest.Tpo -c -o OlaTester-ClientTest.o `test -f 'ClientTest.cpp' || echo '$(srcdir)/'`ClientTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-ClientTest.Tpo $(DEPDIR)/OlaTester-ClientTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClientTest.cpp' object='OlaTester-ClientTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-ClientTest.o `test -f 'ClientTest.cpp' || echo '$(srcdir)/'`ClientTest.cpp + +OlaTester-ClientTest.obj: ClientTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -MT OlaTester-ClientTest.obj -MD -MP -MF $(DEPDIR)/OlaTester-ClientTest.Tpo -c -o OlaTester-ClientTest.obj `if test -f 'ClientTest.cpp'; then $(CYGPATH_W) 'ClientTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClientTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/OlaTester-ClientTest.Tpo $(DEPDIR)/OlaTester-ClientTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ClientTest.cpp' object='OlaTester-ClientTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(OlaTester_CXXFLAGS) $(CXXFLAGS) -c -o OlaTester-ClientTest.obj `if test -f 'ClientTest.cpp'; then $(CYGPATH_W) 'ClientTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ClientTest.cpp'; fi` + +olad-Olad.o: Olad.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(olad_CXXFLAGS) $(CXXFLAGS) -MT olad-Olad.o -MD -MP -MF $(DEPDIR)/olad-Olad.Tpo -c -o olad-Olad.o `test -f 'Olad.cpp' || echo '$(srcdir)/'`Olad.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/olad-Olad.Tpo $(DEPDIR)/olad-Olad.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Olad.cpp' object='olad-Olad.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(olad_CXXFLAGS) $(CXXFLAGS) -c -o olad-Olad.o `test -f 'Olad.cpp' || echo '$(srcdir)/'`Olad.cpp + +olad-Olad.obj: Olad.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(olad_CXXFLAGS) $(CXXFLAGS) -MT olad-Olad.obj -MD -MP -MF $(DEPDIR)/olad-Olad.Tpo -c -o olad-Olad.obj `if test -f 'Olad.cpp'; then $(CYGPATH_W) 'Olad.cpp'; else $(CYGPATH_W) '$(srcdir)/Olad.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/olad-Olad.Tpo $(DEPDIR)/olad-Olad.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Olad.cpp' object='olad-Olad.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(olad_CXXFLAGS) $(CXXFLAGS) -c -o olad-Olad.obj `if test -f 'Olad.cpp'; then $(CYGPATH_W) 'Olad.cpp'; else $(CYGPATH_W) '$(srcdir)/Olad.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ + clean-libLTLIBRARIES clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-pkgincludeHEADERS + +install-dvi: install-dvi-recursive + +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-pkgincludeHEADERS + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-TESTS check-am clean clean-binPROGRAMS \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags ctags-recursive distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-pkgincludeHEADERS install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-pkgincludeHEADERS + +# 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/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.cpp new file mode 100644 index 0000000..8fdcac4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.cpp @@ -0,0 +1,153 @@ +/* + * 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 Library 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. + * + * OlaDaemon.cpp + * This is the main ola daemon + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +#include "config.h" +#include "ola/ExportMap.h" + +#include "olad/DynamicPluginLoader.h" +#include "olad/OlaDaemon.h" +#include "olad/OlaServerServiceImpl.h" +#include "olad/PluginLoader.h" +#include "olad/Preferences.h" + +namespace ola { + +using ola::network::TcpAcceptingSocket; +using ola::network::AcceptingSocket; +using ola::network::SelectServer; + +const char OlaDaemon::K_RPC_PORT_VAR[] = "rpc-port"; + +/* + * Create a new OlaDaemon + * @param PluginLoader what to use to access the plugins + */ +OlaDaemon::OlaDaemon(const ola_server_options &options, + ExportMap *export_map, + unsigned int rpc_port) + : m_ss(NULL), + m_server(NULL), + m_preferences_factory(NULL), + m_accepting_socket(NULL), + m_service_factory(NULL), + m_options(options), + m_export_map(export_map), + m_rpc_port(rpc_port) { + if (m_export_map) { + IntegerVariable *var = m_export_map->GetIntegerVar(K_RPC_PORT_VAR); + var->Set(rpc_port); + } +} + + +/* + * Destroy this object + * + */ +OlaDaemon::~OlaDaemon() { + Shutdown(); +} + + +/* + * Initialise this object + * @return true on success, false on failure + */ +bool OlaDaemon::Init() { + if (m_server || m_service_factory || m_preferences_factory || + m_accepting_socket || m_server) + return false; + + m_ss = new SelectServer(m_export_map); + m_service_factory = new OlaServerServiceImplFactory(); + + // Order is important here as we won't load the same plugin twice. + m_plugin_loaders.push_back(new DynamicPluginLoader()); + + m_preferences_factory = new FileBackedPreferencesFactory(); + m_accepting_socket = new TcpAcceptingSocket("127.0.0.1", m_rpc_port); + + m_server = new OlaServer(m_service_factory, + m_plugin_loaders, + m_preferences_factory, + m_ss, + &m_options, + m_accepting_socket, + m_export_map); + return m_server->Init(); +} + + +/* + * Shutdown the daemon + */ +void OlaDaemon::Shutdown() { + if (m_server) + delete m_server; + if (m_service_factory) + delete m_service_factory; + if (m_preferences_factory) + delete m_preferences_factory; + if (m_ss) + delete m_ss; + if (m_accepting_socket) + delete m_accepting_socket; + m_accepting_socket = NULL; + m_preferences_factory = NULL; + m_server = NULL; + m_service_factory = NULL; + m_ss = NULL; + + vector::iterator iter; + for (iter = m_plugin_loaders.begin(); iter != m_plugin_loaders.end(); ++iter) + delete *iter; + m_plugin_loaders.clear(); +} + + +/* + * Run the daemon + */ +void OlaDaemon::Run() { + if (m_ss) + m_ss->Run(); +} + + +/* + * Stop the daemon + */ +void OlaDaemon::Terminate() { + if (m_ss) + m_ss->Terminate(); +} + +/* + * Reload plugins + */ +void OlaDaemon::ReloadPlugins() { + if (m_server) + m_server->ReloadPlugins(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.h b/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.h new file mode 100644 index 0000000..1cabfb3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaDaemon.h @@ -0,0 +1,70 @@ +/* + * 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 Library 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. + * + * OlaDaemon.h + * Interface for the OLA Daemon class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_OLADAEMON_H_ +#define OLAD_OLADAEMON_H_ + +#include +#include +#include "ola/BaseTypes.h" +#include "ola/ExportMap.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "olad/OlaServer.h" + +namespace ola { + +using ola::network::AcceptingSocket; +using ola::network::SelectServer; + +class OlaDaemon { + public: + OlaDaemon(const ola_server_options &options, + ExportMap *export_map = NULL, + unsigned int rpc_port = OLA_DEFAULT_PORT); + ~OlaDaemon(); + bool Init(); + void Shutdown(); + void Run(); + void Terminate(); + void ReloadPlugins(); + class SelectServer* GetSelectServer() const { return m_ss; } + class OlaServer *GetOlaServer() const { return m_server; } + + static const unsigned int DEFAULT_RPC_PORT = OLA_DEFAULT_PORT; + + private: + OlaDaemon(const OlaDaemon&); + OlaDaemon& operator=(const OlaDaemon&); + + vector m_plugin_loaders; + class SelectServer *m_ss; + class OlaServer *m_server; + class PreferencesFactory *m_preferences_factory; + class AcceptingSocket *m_accepting_socket; + class OlaServerServiceImplFactory *m_service_factory; + ola_server_options m_options; + class ExportMap *m_export_map; + unsigned int m_rpc_port; + + static const char K_RPC_PORT_VAR[]; +}; +} // ola +#endif // OLAD_OLADAEMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.cpp new file mode 100644 index 0000000..6b87859 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.cpp @@ -0,0 +1,1019 @@ +/* + * 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 Library 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. + * + * OlaHttpServer.cpp + * Ola HTTP class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "ola/ActionQueue.h" +#include "ola/Callback.h" +#include "ola/DmxBuffer.h" +#include "olad/HttpServerActions.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "ola/network/NetworkUtils.h" +#include "olad/OlaHttpServer.h" +#include "olad/OlaServer.h" +#include "olad/OlaVersion.h" + + +namespace ola { + +using ola::network::ConnectedSocket; +using std::cout; +using std::endl; +using std::string; +using std::stringstream; +using std::vector; + +const char OlaHttpServer::K_DATA_DIR_VAR[] = "http_data_dir"; +const char OlaHttpServer::K_UPTIME_VAR[] = "uptime-in-ms"; +const char OlaHttpServer::K_BACKEND_DISCONNECTED_ERROR[] = + "Failed to send request, client isn't connected"; +const char OlaHttpServer::K_PRIORITY_VALUE_SUFFIX[] = "_priority_value"; +const char OlaHttpServer::K_PRIORITY_MODE_SUFFIX[] = "_priority_mode"; + + +/** + * Create a new OLA HTTP server + * @param export_map the ExportMap to display when /debug is called + * @param client_socket A ConnectedSocket which is used to communicate with the + * server. + * @param + */ +OlaHttpServer::OlaHttpServer(ExportMap *export_map, + ConnectedSocket *client_socket, + OlaServer *ola_server, + unsigned int port, + bool enable_quit, + const string &data_dir, + const ola::network::Interface &interface) + : m_server(port, data_dir), + m_export_map(export_map), + m_client_socket(client_socket), + m_client(client_socket), + m_ola_server(ola_server), + m_enable_quit(enable_quit), + m_interface(interface), + m_rdm_module(&m_server, &m_client) { + // The main handlers + RegisterHandler("/", &OlaHttpServer::DisplayIndex); + RegisterHandler("/debug", &OlaHttpServer::DisplayDebug); + RegisterHandler("/help", &OlaHttpServer::DisplayHandlers); + RegisterHandler("/quit", &OlaHttpServer::DisplayQuit); + RegisterHandler("/reload", &OlaHttpServer::ReloadPlugins); + RegisterHandler("/new_universe", &OlaHttpServer::CreateNewUniverse); + RegisterHandler("/modify_universe", &OlaHttpServer::ModifyUniverse); + RegisterHandler("/set_dmx", &OlaHttpServer::HandleSetDmx); + + // json endpoints for the new UI + RegisterHandler("/json/server_stats", &OlaHttpServer::JsonServerStats); + RegisterHandler("/json/universe_plugin_list", + &OlaHttpServer::JsonUniversePluginList); + RegisterHandler("/json/plugin_info", &OlaHttpServer::JsonPluginInfo); + RegisterHandler("/json/get_ports", &OlaHttpServer::JsonAvailablePorts); + RegisterHandler("/json/universe_info", &OlaHttpServer::JsonUniverseInfo); + + // these are the static files for the new UI + RegisterFile("blank.gif", HttpServer::CONTENT_TYPE_GIF); + RegisterFile("button-bg.png", HttpServer::CONTENT_TYPE_PNG); + RegisterFile("custombutton.css", HttpServer::CONTENT_TYPE_CSS); + RegisterFile("expander.png", HttpServer::CONTENT_TYPE_PNG); + RegisterFile("handle.vertical.png", HttpServer::CONTENT_TYPE_PNG); + RegisterFile("loader.gif", HttpServer::CONTENT_TYPE_GIF); + RegisterFile("logo.png", HttpServer::CONTENT_TYPE_PNG); + RegisterFile("ola.html", HttpServer::CONTENT_TYPE_HTML); + RegisterFile("ola.js", HttpServer::CONTENT_TYPE_JS); + RegisterFile("tick.gif", HttpServer::CONTENT_TYPE_GIF); + RegisterFile("toolbar-bg.png", HttpServer::CONTENT_TYPE_PNG); + RegisterFile("toolbar.css", HttpServer::CONTENT_TYPE_CSS); + RegisterFile("vertical.gif", HttpServer::CONTENT_TYPE_GIF); + + StringVariable *data_dir_var = export_map->GetStringVar(K_DATA_DIR_VAR); + data_dir_var->Set(m_server.DataDir()); + Clock::CurrentTime(&m_start_time); + m_start_time_t = time(NULL); + export_map->GetStringVar(K_UPTIME_VAR); +} + + +/* + * Teardown + */ +OlaHttpServer::~OlaHttpServer() { + if (m_client_socket) + m_server.SelectServer()->RemoveSocket(m_client_socket); + m_client.Stop(); + if (m_client_socket) + delete m_client_socket; +} + + +/** + * Setup the OLA HTTP server + * @return true if this worked, false otherwise. + */ +bool OlaHttpServer::Init() { + bool ret = m_server.Init(); + if (ret) { + if (!m_client.Setup()) { + return false; + } + /* + Setup disconnect notifications. + m_socket->SetOnClose( + ola::NewSingleClosure(this, &SimpleClient::SocketClosed)); + */ + m_server.SelectServer()->AddSocket(m_client_socket); + } + return ret; +} + + +/* + * Print the server stats json + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::JsonServerStats(const HttpRequest *request, + HttpResponse *response) { + struct tm start_time; + char start_time_str[50]; + localtime_r(&m_start_time_t, &start_time); + strftime(start_time_str, sizeof(start_time_str), "%c", &start_time); + + stringstream str; + str << "{" << endl; + str << " \"hostname\": \"" << EscapeString(ola::network::FullHostname()) << + "\"," << endl; + str << " \"ip\": \"" << + ola::network::AddressToString(m_interface.ip_address) << "\"," << endl; + str << " \"broadcast\": \"" << + ola::network::AddressToString(m_interface.bcast_address) << "\"," << endl; + str << " \"subnet\": \"" << + ola::network::AddressToString(m_interface.subnet_address) << "\"," << endl; + str << " \"hw_address\": \"" << + ola::network::HardwareAddressToString(m_interface.hw_address) << "\"," + << endl; + str << " \"version\": \"" << OLA_VERSION << "\"," << endl; + str << " \"up_since\": \"" << start_time_str << "\"," << endl; + str << " \"quit_enabled\": " << m_enable_quit << "," << endl; + str << "}"; + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + int r = response->Send(); + delete response; + return r; + (void) request; +} + + +/* + * Print the list of universes / plugins as a json string + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::JsonUniversePluginList(const HttpRequest *request, + HttpResponse *response) { + bool ok = m_client.FetchPluginList( + NewSingleCallback(this, + &OlaHttpServer::HandlePluginList, + response)); + + if (!ok) + return m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return MHD_YES; + (void) request; +} + + +/** + * Print the plugin info as a json string + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::JsonPluginInfo(const HttpRequest *request, + HttpResponse *response) { + string val = request->GetParameter("id"); + int plugin_id = atoi(val.data()); + + bool ok = m_client.FetchPluginDescription( + (ola_plugin_id) plugin_id, + NewSingleCallback(this, + &OlaHttpServer::HandlePluginInfo, + response)); + + if (!ok) + return m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/** + * Return information about a universe + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::JsonUniverseInfo(const HttpRequest *request, + HttpResponse *response) { + string uni_id = request->GetParameter("id"); + unsigned int universe_id; + if (!StringToUInt(uni_id, &universe_id)) + return m_server.ServeNotFound(response); + + bool ok = m_client.FetchUniverseInfo( + universe_id, + NewSingleCallback(this, + &OlaHttpServer::HandleUniverseInfo, + response)); + + if (!ok) + return m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return MHD_YES; + (void) request; +} + + +/** + * Return a list of unbound ports + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::JsonAvailablePorts(const HttpRequest *request, + HttpResponse *response) { + string uni_id = request->GetParameter("id"); + bool ok = false; + + if (uni_id.empty()) { + // get all available ports + ok = m_client.FetchCandidatePorts( + NewSingleCallback(this, + &OlaHttpServer::HandleCandidatePorts, + response)); + } else { + unsigned int universe_id; + if (!StringToUInt(uni_id, &universe_id)) + return m_server.ServeNotFound(response); + + ok = m_client.FetchCandidatePorts( + universe_id, + NewSingleCallback(this, + &OlaHttpServer::HandleCandidatePorts, + response)); + } + + if (!ok) + return m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/* + * Create a new universe by binding one or more ports. + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::CreateNewUniverse(const HttpRequest *request, + HttpResponse *response) { + string uni_id = request->GetPostParameter("id"); + string name = request->GetPostParameter("name"); + + if (name.size() > K_UNIVERSE_NAME_LIMIT) + name = name.substr(K_UNIVERSE_NAME_LIMIT); + + unsigned int universe_id; + if (!StringToUInt(uni_id, &universe_id)) + return m_server.ServeNotFound(response); + + ActionQueue *action_queue = new ActionQueue( + NewSingleCallback(this, + &OlaHttpServer::CreateUniverseComplete, + response, + universe_id, + !name.empty())); + + // add patch actions here + string add_port_ids = request->GetPostParameter("add_ports"); + AddPatchActions(action_queue, add_port_ids, universe_id, PATCH); + + + if (!name.empty()) + action_queue->AddAction( + new SetNameAction(&m_client, universe_id, name, false)); + + action_queue->NextAction(); + return MHD_YES; +} + + +/* + * Modify an existing universe. + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::ModifyUniverse(const HttpRequest *request, + HttpResponse *response) { + string uni_id = request->GetPostParameter("id"); + string name = request->GetPostParameter("name"); + string merge_mode = request->GetPostParameter("merge_mode"); + + unsigned int universe_id; + if (!StringToUInt(uni_id, &universe_id)) + return m_server.ServeNotFound(response); + + if (name.empty()) + return m_server.ServeError(response, "No name supplied"); + + if (name.size() > K_UNIVERSE_NAME_LIMIT) + name = name.substr(K_UNIVERSE_NAME_LIMIT); + + ActionQueue *action_queue = new ActionQueue( + NewSingleCallback(this, + &OlaHttpServer::ModifyUniverseComplete, + response)); + + action_queue->AddAction( + new SetNameAction(&m_client, universe_id, name, true)); + + if (merge_mode == "LTP" || merge_mode == "HTP") { + OlaUniverse::merge_mode mode = ( + merge_mode == "LTP" ? OlaUniverse::MERGE_LTP : OlaUniverse::MERGE_HTP); + action_queue->AddAction( + new SetMergeModeAction(&m_client, universe_id, mode)); + } + + string remove_port_ids = request->GetPostParameter("remove_ports"); + AddPatchActions(action_queue, remove_port_ids, universe_id, UNPATCH); + + string add_port_ids = request->GetPostParameter("add_ports"); + AddPatchActions(action_queue, add_port_ids, universe_id, PATCH); + + AddPriorityActions(action_queue, request); + + action_queue->NextAction(); + return MHD_YES; +} + + +/* + * Display the index page + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::DisplayIndex(const HttpRequest *request, + HttpResponse *response) { + HttpServer::static_file_info file_info; + file_info.file_path = "ola.html"; + file_info.content_type = HttpServer::CONTENT_TYPE_HTML; + return m_server.ServeStaticContent(&file_info, response); + (void) request; +} + + +/* + * Handle the set dmx command + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::HandleSetDmx(const HttpRequest *request, + HttpResponse *response) { + string dmx_data_str = request->GetPostParameter("d"); + string uni_id = request->GetPostParameter("u"); + unsigned int universe_id; + if (!StringToUInt(uni_id, &universe_id)) + return m_server.ServeNotFound(response); + + DmxBuffer buffer; + buffer.SetFromString(dmx_data_str); + if (!buffer.Size()) + return m_server.ServeError(response, "Invalid DMX string"); + + bool ok = m_client.SendDmx( + universe_id, + buffer, + NewSingleCallback(this, &OlaHttpServer::HandleBoolResponse, response)); + + if (!ok) + return m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/* + * Display the debug page + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::DisplayDebug(const HttpRequest *request, + HttpResponse *response) { + TimeStamp now; + Clock::CurrentTime(&now); + TimeInterval diff = now - m_start_time; + stringstream str; + str << (diff.AsInt() / 1000); + m_export_map->GetStringVar(K_UPTIME_VAR)->Set(str.str()); + + vector variables = m_export_map->AllVariables(); + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + + vector::iterator iter; + for (iter = variables.begin(); iter != variables.end(); ++iter) { + stringstream out; + out << (*iter)->Name() << ": " << (*iter)->Value() << "\n"; + response->Append(out.str()); + } + int r = response->Send(); + delete response; + return r; + (void) request; +} + + +/* + * Cause the server to shutdown + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::DisplayQuit(const HttpRequest *request, + HttpResponse *response) { + if (m_enable_quit) { + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("ok"); + m_ola_server->StopServer(); + } else { + response->SetStatus(403); + response->SetContentType(HttpServer::CONTENT_TYPE_HTML); + response->Append("403 Unauthorized"); + } + int r = response->Send(); + delete response; + return r; + (void) request; +} + + +/* + * Reload all plugins + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int OlaHttpServer::ReloadPlugins(const HttpRequest *request, + HttpResponse *response) { + m_ola_server->ReloadPlugins(); + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("ok"); + int r = response->Send(); + delete response; + return r; + (void) request; +} + + +/* + * Display a list of registered handlers + */ +int OlaHttpServer::DisplayHandlers(const HttpRequest *request, + HttpResponse *response) { + vector handlers = m_server.Handlers(); + vector::const_iterator iter; + response->SetContentType(HttpServer::CONTENT_TYPE_HTML); + response->Append("Registered Handlers
    "); + for (iter = handlers.begin(); iter != handlers.end(); ++iter) { + response->Append("
  • " + *iter + "
  • "); + } + response->Append("
"); + int r = response->Send(); + delete response; + return r; + (void) request; +} + + +/* + * Handle the plugin list callback + * @param response the HttpResponse that is associated with the request. + * @param plugins a list of plugins + * @param error an error string. + */ +void OlaHttpServer::HandlePluginList(HttpResponse *response, + const vector &plugins, + const string &error) { + if (!error.empty()) { + m_server.ServeError(response, error); + return; + } + + // fire off the universe request now. the main server is running in a + // separate thread. + bool ok = m_client.FetchUniverseList( + NewSingleCallback(this, + &OlaHttpServer::HandleUniverseList, + response)); + + if (!ok) { + m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return; + } + + stringstream str; + str << "{" << endl; + str << " \"plugins\": [" << endl; + + vector::const_iterator iter; + for (iter = plugins.begin(); iter != plugins.end(); ++iter) { + str << " {\"name\": \"" << EscapeString(iter->Name()) << + "\", \"id\": " << iter->Id() << "}," << endl; + } + + str << " ]," << endl; + response->Append(str.str()); +} + + +/* + * Handle the universe list callback + * @param response the HttpResponse that is associated with the request. + * @param plugins a list of plugins + * @param error an error string. + */ +void OlaHttpServer::HandleUniverseList(HttpResponse *response, + const vector &universes, + const string &error) { + stringstream str; + if (error.empty()) { + str << " \"universes\": [" << endl; + + vector::const_iterator iter; + for (iter = universes.begin(); iter != universes.end(); ++iter) { + str << " {" << endl; + str << " \"id\": " << iter->Id() << "," << endl; + str << " \"input_ports\": " << iter->InputPortCount() << "," << + endl; + str << " \"name\": \"" << EscapeString(iter->Name()) << "\"," << + endl; + str << " \"output_ports\": " << iter->OutputPortCount() << "," << + endl; + str << " \"rdm_devices\": " << iter->RDMDeviceCount() << "," << + endl; + str << " }," << endl; + } + str << " ]," << endl; + } + + str << "}"; + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete response; +} + + +/* + * Handle the plugin description response. + * @param response the HttpResponse that is associated with the request. + * @param description the plugin description. + * @param error an error string. + */ +void OlaHttpServer::HandlePluginInfo(HttpResponse *response, + const string &description, + const string &error) { + if (!error.empty()) { + m_server.ServeError(response, error); + return; + } + string escaped_description = description; + Escape(&escaped_description); + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("{\"description\": \""); + response->Append(escaped_description); + response->Append("\"}"); + response->Send(); + delete response; +} + + +/* + * Handle the universe info + * @param response the HttpResponse that is associated with the request. + * @param universe the OlaUniverse object + * @param error an error string. + */ +void OlaHttpServer::HandleUniverseInfo(HttpResponse *response, + OlaUniverse &universe, + const string &error) { + if (!error.empty()) { + m_server.ServeError(response, error); + return; + } + + // fire off the device/port request now. the main server is running in a + // separate thread. + bool ok = m_client.FetchDeviceInfo( + ola::OLA_PLUGIN_ALL, + NewSingleCallback(this, + &OlaHttpServer::HandlePortsForUniverse, + response, + universe.Id())); + + if (!ok) { + m_server.ServeError(response, K_BACKEND_DISCONNECTED_ERROR); + return; + } + + stringstream str; + str << "{" << endl; + str << " \"id\": " << universe.Id() << "," << endl; + str << " \"name\": \"" << EscapeString(universe.Name()) << "\"," << endl; + str << " \"merge_mode\": \"" << + (universe.MergeMode() == OlaUniverse::MERGE_HTP ? "HTP" : "LTP") << "\"," + << endl; + + response->Append(str.str()); +} + + +void OlaHttpServer::HandlePortsForUniverse( + HttpResponse *response, + unsigned int universe_id, + const vector &devices, + const string &error) { + if (error.empty()) { + stringstream input_str, output_str; + vector::const_iterator iter = devices.begin(); + vector::const_iterator input_iter; + vector::const_iterator output_iter; + + input_str << " \"input_ports\": [" << endl; + output_str << " \"output_ports\": [" << endl; + for (; iter != devices.end(); ++iter) { + const vector &input_ports = iter->InputPorts(); + for (input_iter = input_ports.begin(); input_iter != input_ports.end(); + ++input_iter) { + if (input_iter->IsActive() && input_iter->Universe() == universe_id) + PortToJson(*iter, *input_iter, &input_str, false); + } + + const vector &output_ports = iter->OutputPorts(); + for (output_iter = output_ports.begin(); + output_iter != output_ports.end(); ++output_iter) { + if (output_iter->IsActive() && output_iter->Universe() == universe_id) + PortToJson(*iter, *output_iter, &output_str, true); + } + } + input_str << " ]," << endl; + output_str << " ]," << endl; + response->Append(input_str.str()); + response->Append(output_str.str()); + } + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("}"); + response->Send(); + delete response; +} + + +/* + * Handle the list of candidate ports + * @param response the HttpResponse that is associated with the request. + * @param devices the possbile devices & ports + * @param error an error string. + */ +void OlaHttpServer::HandleCandidatePorts( + HttpResponse *response, + const vector &devices, + const string &error) { + if (!error.empty()) { + m_server.ServeError(response, error); + return; + } + + stringstream str; + str << "[" << endl; + + vector::const_iterator iter = devices.begin(); + vector::const_iterator input_iter; + vector::const_iterator output_iter; + + for (; iter != devices.end(); ++iter) { + const vector &input_ports = iter->InputPorts(); + for (input_iter = input_ports.begin(); input_iter != input_ports.end(); + ++input_iter) { + PortToJson(*iter, *input_iter, &str, false); + } + + const vector &output_ports = iter->OutputPorts(); + for (output_iter = output_ports.begin(); + output_iter != output_ports.end(); ++output_iter) { + PortToJson(*iter, *output_iter, &str, true); + } + } + str << "]" << endl; + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete response; +} + + +/* + * Schedule a callback to send the new universe response to the client + */ +void OlaHttpServer::CreateUniverseComplete(HttpResponse *response, + unsigned int universe_id, + bool included_name, + class ActionQueue *action_queue) { + // this is a trick to unwind the stack and return control to a method outside + // the Action + m_server.SelectServer()->RegisterSingleTimeout( + 0, + NewSingleClosure(this, &OlaHttpServer::SendCreateUniverseResponse, + response, universe_id, included_name, action_queue)); +} + + + +/* + * Send the response to a new universe request + */ +void OlaHttpServer::SendCreateUniverseResponse( + HttpResponse *response, + unsigned int universe_id, + bool included_name, + class ActionQueue *action_queue) { + unsigned int action_count = action_queue->ActionCount(); + if (included_name) + action_count--; + bool failed = true; + // it only takes one port patch to pass + for (unsigned int i = 0; i < action_count; i++) { + failed &= action_queue->GetAction(i)->Failed(); + } + + stringstream str; + str << "{" << endl; + str << " \"ok\": " << !failed << "," << endl; + str << " \"universe\": " << universe_id << "," << endl; + str << " \"message\": \"" << (failed ? "Failed to patch any ports" : "") << + "\"," << endl; + str << "}"; + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete action_queue; + delete response; +} + + +/* + * Schedule a callback to send the modify universe response to the client + */ +void OlaHttpServer::ModifyUniverseComplete(HttpResponse *response, + ActionQueue *action_queue) { + // this is a trick to unwind the stack and return control to a method outside + // the Action + m_server.SelectServer()->RegisterSingleTimeout( + 0, + NewSingleClosure(this, &OlaHttpServer::SendModifyUniverseResponse, + response, action_queue)); +} + + +/* + * Send the response to a modify universe request. + */ +void OlaHttpServer::SendModifyUniverseResponse(HttpResponse *response, + ActionQueue *action_queue) { + if (!action_queue->WasSuccessful()) { + delete action_queue; + m_server.ServeError(response, "Update failed"); + } else { + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("ok"); + response->Send(); + delete action_queue; + delete response; + } +} + + +/* + * Handle the set DMX response. + * @param response the HttpResponse that is associated with the request. + * @param error an error string. + */ +void OlaHttpServer::HandleBoolResponse(HttpResponse *response, + const string &error) { + if (!error.empty()) { + m_server.ServeError(response, error); + return; + } + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("ok"); + response->Send(); + delete response; +} + + +/* + * Register a handler + */ +inline void OlaHttpServer::RegisterHandler( + const string &path, + int (OlaHttpServer::*method)(const HttpRequest*, HttpResponse*)) { + m_server.RegisterHandler( + path, + NewCallback( + this, + method)); +} + + +/* + * Register a static file + */ +inline void OlaHttpServer::RegisterFile(const string &file, + const string &content_type) { + m_server.RegisterFile("/" + file, file, content_type); +} + + +/** + * Add the json representation of this port to the stringstream + */ +void OlaHttpServer::PortToJson(const OlaDevice &device, + const OlaPort &port, + stringstream *str, + bool is_output) { + *str << " {" << endl; + *str << " \"device\": \"" << EscapeString(device.Name()) + << "\"," << endl; + *str << " \"description\": \"" << + EscapeString(port.Description()) << "\"," << endl; + *str << " \"id\": \"" << device.Alias() << "-" << + (is_output ? "O" : "I") << "-" << port.Id() << "\"," << endl; + *str << " \"is_output\": " << (is_output ? "true" : "false") << "," << + endl; + + if (port.PriorityCapability() != CAPABILITY_NONE) { + *str << " \"priority\": {" << endl; + *str << " \"value\": " << static_cast(port.Priority()) << + "," << endl; + if (port.PriorityCapability() == CAPABILITY_FULL) { + *str << " \"current_mode\": \"" << + (port.PriorityMode() == PRIORITY_MODE_INHERIT ? + "inherit" : "override") << "\"," << + endl; + } + *str << " }" << endl; + } + *str << " }," << endl; +} + + +/* + * Add the Patch Actions to the ActionQueue. + * @param action_queue the ActionQueue to add the actions to. + * @param port_id_string a string to ports to add/remove. + * @param universe the universe id to add these ports if + * @param port_action either PATCH or UNPATCH. + */ +void OlaHttpServer::AddPatchActions(ActionQueue *action_queue, + const string port_id_string, + unsigned int universe, + PatchAction port_action) { + vector ports; + vector::const_iterator iter; + DecodePortIds(port_id_string, &ports); + + if (!ports.size()) + return; + + for (iter = ports.begin(); iter != ports.end(); ++iter) { + action_queue->AddAction(new PatchPortAction( + &m_client, + iter->device_alias, + iter->port, + iter->direction, + universe, + port_action)); + } +} + + +/* + * Add the Priority Actions to the ActionQueue. + * @param action_queue the ActionQueue to add the actions to. + * @param request the HttpRequest to read the url params from. + */ +void OlaHttpServer::AddPriorityActions(ActionQueue *action_queue, + const HttpRequest *request) { + string port_ids = request->GetPostParameter("modify_ports"); + vector ports; + vector::const_iterator iter; + DecodePortIds(port_ids, &ports); + + if (!ports.size()) + return; + + for (iter = ports.begin(); iter != ports.end(); ++iter) { + string priority_mode_id = iter->string_id + K_PRIORITY_MODE_SUFFIX; + string priority_id = iter->string_id + K_PRIORITY_VALUE_SUFFIX; + string mode = request->GetPostParameter(priority_mode_id); + + if (mode == "0") { + action_queue->AddAction(new PortPriorityInheritAction( + &m_client, + iter->device_alias, + iter->port, + iter->direction)); + } else if (mode == "1" || mode == "") { + // an empty mode param means this is a static port + string value = request->GetPostParameter(priority_id); + uint8_t priority_value; + if (StringToUInt8(value, &priority_value)) { + action_queue->AddAction(new PortPriorityOverrideAction( + &m_client, + iter->device_alias, + iter->port, + iter->direction, + priority_value)); + } + } + } +} + + +/* + * Decode port ids in a string. + * This converts a string like "4-I-1,2-O-3" into a vector of port identifiers. + * @param port_ids the port ids in a , separated string + * @param ports a vector of port_identifiers that will be filled. + */ +void OlaHttpServer::DecodePortIds(const string &port_ids, + vector *ports) { + vector port_strings; + StringSplit(port_ids, port_strings, ","); + vector::const_iterator iter; + vector tokens; + + for (iter = port_strings.begin(); iter != port_strings.end(); ++iter) { + if (iter->empty()) + continue; + + tokens.clear(); + StringSplit(*iter, tokens, "-"); + + if (tokens.size() != 3 || (tokens[1] != "I" && tokens[1] != "O")) { + OLA_INFO << "Not a valid port id " << *iter; + continue; + } + + unsigned int device_alias, port; + if (!StringToUInt(tokens[0], &device_alias) || + !StringToUInt(tokens[2], &port)) { + OLA_INFO << "Not a valid port id " << *iter; + continue; + } + + PortDirection direction = tokens[1] == "I" ? INPUT_PORT : OUTPUT_PORT; + port_identifier port_id = {device_alias, port, direction, *iter}; + ports->push_back(port_id); + } +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.h b/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.h new file mode 100644 index 0000000..487d767 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaHttpServer.h @@ -0,0 +1,165 @@ +/* + * 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 Library 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. + * + * OlaHttpServer.h + * Interface for the OLA HTTP class + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef OLAD_OLAHTTPSERVER_H_ +#define OLAD_OLAHTTPSERVER_H_ + +#include +#include +#include +#include "ola/ExportMap.h" +#include "ola/OlaCallbackClient.h" +#include "ola/network/Interface.h" +#include "olad/HttpServer.h" +#include "olad/RDMHttpModule.h" + +namespace ola { + +using std::string; + + +/* + * This is the main OLA HTTP Server + */ +class OlaHttpServer { + public: + OlaHttpServer(ExportMap *export_map, + ola::network::ConnectedSocket *client_socket, + class OlaServer *ola_server, + unsigned int port, + bool enable_quit, + const string &data_dir, + const ola::network::Interface &interface); + ~OlaHttpServer(); + + bool Init(); + bool Start() { return m_server.Start(); } + void Stop() { return m_server.Stop(); } + + int JsonServerStats(const HttpRequest *request, HttpResponse *response); + int JsonUniversePluginList(const HttpRequest *request, + HttpResponse *response); + int JsonPluginInfo(const HttpRequest *request, HttpResponse *response); + int JsonUniverseInfo(const HttpRequest *request, HttpResponse *response); + int JsonAvailablePorts(const HttpRequest *request, HttpResponse *response); + int CreateNewUniverse(const HttpRequest *request, HttpResponse *response); + int ModifyUniverse(const HttpRequest *request, HttpResponse *response); + + int DisplayIndex(const HttpRequest *request, HttpResponse *response); + int HandleSetDmx(const HttpRequest *request, HttpResponse *response); + int DisplayDebug(const HttpRequest *request, HttpResponse *response); + int DisplayQuit(const HttpRequest *request, HttpResponse *response); + int ReloadPlugins(const HttpRequest *request, HttpResponse *response); + int DisplayHandlers(const HttpRequest *request, HttpResponse *response); + + void HandlePluginList(HttpResponse *response, + const vector &plugins, + const string &error); + + void HandleUniverseList(HttpResponse *response, + const vector &universes, + const string &error); + + void HandlePluginInfo(HttpResponse *response, + const string &description, + const string &error); + + void HandleUniverseInfo(HttpResponse *response, + class OlaUniverse &universe, + const string &error); + + void HandlePortsForUniverse(HttpResponse *response, + unsigned int universe_id, + const vector &devices, + const string &error); + + void HandleCandidatePorts(HttpResponse *response, + const vector &devices, + const string &error); + + void CreateUniverseComplete(HttpResponse *response, + unsigned int universe_id, + bool included_name, + class ActionQueue *action_queue); + + void SendCreateUniverseResponse(HttpResponse *response, + unsigned int universe_id, + bool included_name, + class ActionQueue *action_queue); + + void ModifyUniverseComplete(HttpResponse *response, + class ActionQueue *action_queue); + void SendModifyUniverseResponse(HttpResponse *response, + class ActionQueue *action_queue); + + private: + class HttpServer m_server; + ExportMap *m_export_map; + class ola::network::ConnectedSocket *m_client_socket; + ola::OlaCallbackClient m_client; + class OlaServer *m_ola_server; + bool m_enable_quit; + TimeStamp m_start_time; + ola::network::Interface m_interface; + RDMHttpModule m_rdm_module; + time_t m_start_time_t; + + OlaHttpServer(const OlaHttpServer&); + OlaHttpServer& operator=(const OlaHttpServer&); + + void HandleBoolResponse(HttpResponse *response, + const string &error); + + void RegisterHandler(const string &path, + int (OlaHttpServer::*method)(const HttpRequest*, + HttpResponse*)); + void RegisterFile(const string &file, const string &content_type); + + void PortToJson(const class OlaDevice &device, + const class OlaPort &port, + stringstream *str, + bool is_output); + + void AddPatchActions(ActionQueue *action_queue, + const string port_id_string, + unsigned int universe, + PatchAction port_action); + + void AddPriorityActions(ActionQueue *action_queue, + const HttpRequest *request); + + typedef struct { + unsigned int device_alias; + unsigned int port; + PortDirection direction; + string string_id; + } port_identifier; + + void DecodePortIds(const string &port_ids, vector *ports); + + static const char K_DATA_DIR_VAR[]; + static const char K_UPTIME_VAR[]; + static const char K_BACKEND_DISCONNECTED_ERROR[]; + static const unsigned int K_UNIVERSE_NAME_LIMIT = 100; + static const char K_PRIORITY_VALUE_SUFFIX[]; + static const char K_PRIORITY_MODE_SUFFIX[]; +}; +} // ola +#endif // OLAD_OLAHTTPSERVER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServer.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaServer.cpp new file mode 100644 index 0000000..2d1bb9e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServer.cpp @@ -0,0 +1,434 @@ +/* + * 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 Library 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. + * + * OlaServer.cpp + * OlaServer is the main OLA Server class + * Copyright (C) 2005-2008 Simon Newton + */ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include +#include +#include + +#include "common/protocol/Ola.pb.h" +#include "common/rpc/StreamRpcChannel.h" +#include "ola/BaseTypes.h" +#include "ola/ExportMap.h" +#include "ola/Logging.h" +#include "ola/network/InterfacePicker.h" +#include "ola/rdm/UID.h" +#include "olad/Client.h" +#include "olad/DeviceManager.h" +#include "olad/InternalRDMController.h" +#include "olad/OlaServer.h" +#include "olad/OlaServerServiceImpl.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/PluginManager.h" +#include "olad/Port.h" +#include "olad/PortManager.h" +#include "olad/Preferences.h" +#include "olad/Universe.h" +#include "olad/UniverseStore.h" + +#ifdef HAVE_LIBMICROHTTPD +#include "olad/OlaHttpServer.h" +#endif + +namespace ola { + +using ola::rpc::StreamRpcChannel; +using std::pair; + +const char OlaServer::UNIVERSE_PREFERENCES[] = "universe"; +const char OlaServer::K_CLIENT_VAR[] = "clients-connected"; +const char OlaServer::K_UID_VAR[] = "server-uid"; +const unsigned int OlaServer::K_HOUSEKEEPING_TIMEOUT_MS = 1000; + + +/* + * Create a new OlaServer + * @param factory the factory to use to create OlaService objects + * @param m_plugin_loader the loader to use for the plugins + * @param socket the socket to listen on for new connections + */ +OlaServer::OlaServer(OlaServerServiceImplFactory *factory, + const vector &plugin_loaders, + PreferencesFactory *preferences_factory, + ola::network::SelectServer *select_server, + ola_server_options *ola_options, + ola::network::AcceptingSocket *socket, + ExportMap *export_map) + : m_service_factory(factory), + m_plugin_loaders(plugin_loaders), + m_ss(select_server), + m_accepting_socket(socket), + m_device_manager(NULL), + m_plugin_manager(NULL), + m_plugin_adaptor(NULL), + m_preferences_factory(preferences_factory), + m_universe_preferences(NULL), + m_universe_store(NULL), + m_export_map(export_map), + m_port_manager(NULL), + m_reload_plugins(false), + m_init_run(false), + m_free_export_map(false), + m_housekeeping_timeout(ola::network::INVALID_TIMEOUT), + m_httpd(NULL), + m_options(*ola_options), + m_rdm_controller(NULL) { + if (!m_export_map) { + m_export_map = new ExportMap(); + m_free_export_map = true; + } + + if (!m_options.http_port) + m_options.http_port = DEFAULT_HTTP_PORT; + + m_export_map->GetIntegerVar(K_CLIENT_VAR); +} + + +/* + * Shutdown the server + */ +OlaServer::~OlaServer() { +#ifdef HAVE_LIBMICROHTTPD + if (m_httpd) { + m_httpd->Stop(); + delete m_httpd; + m_httpd = NULL; + } +#endif + + if (m_housekeeping_timeout != ola::network::INVALID_TIMEOUT) + m_ss->RemoveTimeout(m_housekeeping_timeout); + + StopPlugins(); + + // this will remove any input ports and fail any outstanding rdm requests + if (m_rdm_controller) + delete m_rdm_controller; + + map::iterator iter; + for (iter = m_sd_to_service.begin(); iter != m_sd_to_service.end(); ++iter) { + CleanupConnection(iter->second); + // TODO(simon): close the socket here + + /*Socket *socket = ; + m_ss->RemoveSocket(socket); + socket->Close(); + */ + } + + if (m_accepting_socket + && m_accepting_socket->ReadDescriptor() != Socket::INVALID_SOCKET) + m_ss->RemoveSocket(m_accepting_socket); + + if (m_universe_store) { + m_universe_store->DeleteAll(); + delete m_universe_store; + } + + if (m_universe_preferences) { + m_universe_preferences->Save(); + } + + delete m_port_manager; + delete m_plugin_adaptor; + delete m_device_manager; + delete m_plugin_manager; + + if (m_free_export_map) + delete m_export_map; +} + + +/* + * Initialise the server + * * @return true on success, false on failure + */ +bool OlaServer::Init() { + if (m_init_run) + return false; + + if (!m_service_factory || !m_ss) + return false; + + // TODO(simon): run without preferences & PluginLoader + if (!m_plugin_loaders.size() || !m_preferences_factory) + return false; + + if (m_accepting_socket) { + if (!m_accepting_socket->Listen()) + return false; + m_accepting_socket->SetOnData( + ola::NewClosure(this, &OlaServer::AcceptNewConnection, + m_accepting_socket)); + m_ss->AddSocket(m_accepting_socket); + } + + signal(SIGPIPE, SIG_IGN); + + // fetch the interface info + ola::rdm::UID default_uid(OPEN_LIGHTING_ESTA_CODE, 0); + ola::network::Interface interface; + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&interface, "")) { + OLA_WARN << "No network interface found"; + } else { + // default to using the ip as a id + default_uid = ola::rdm::UID(OPEN_LIGHTING_ESTA_CODE, + interface.ip_address.s_addr); + } + delete picker; + m_export_map->GetStringVar(K_UID_VAR)->Set(default_uid.ToString()); + OLA_INFO << "Server UID is " << default_uid; + + m_universe_preferences = m_preferences_factory->NewPreference( + UNIVERSE_PREFERENCES); + m_universe_preferences->Load(); + m_universe_store = new UniverseStore(m_universe_preferences, m_export_map); + + m_port_manager = new PortManager(m_universe_store); + m_rdm_controller = new InternalRDMController(default_uid, + m_port_manager, + m_export_map); + + // setup the objects + m_device_manager = new DeviceManager(m_preferences_factory, m_port_manager); + m_plugin_adaptor = new PluginAdaptor(m_device_manager, + m_ss, + m_preferences_factory); + + m_plugin_manager = new PluginManager(m_plugin_loaders, m_plugin_adaptor); + + if (!m_universe_store || !m_device_manager || !m_plugin_adaptor || + !m_port_manager || !m_plugin_manager) { + delete m_plugin_adaptor; + delete m_device_manager; + delete m_port_manager; + delete m_universe_store; + delete m_plugin_manager; + return false; + } + + m_plugin_manager->LoadAll(); + +#ifdef HAVE_LIBMICROHTTPD + if (!StartHttpServer(interface)) + OLA_WARN << "Failed to start the HTTP server."; +#endif + + m_housekeeping_timeout = m_ss->RegisterRepeatingTimeout( + K_HOUSEKEEPING_TIMEOUT_MS, + ola::NewClosure(this, &OlaServer::RunHousekeeping)); + m_ss->RunInLoop(ola::NewClosure(this, &OlaServer::CheckForReload)); + + m_init_run = true; + return true; +} + + +/* + * Reload all plugins, this can be called from a separate thread or in an + * interrupt handler. + */ +void OlaServer::ReloadPlugins() { + m_reload_plugins = true; +} + + +/* + * Add a new ConnectedSocket to this Server. + * @param accepting_socket the AcceptingSocket with the new connection pending. + */ +void OlaServer::AcceptNewConnection( + ola::network::AcceptingSocket *accepting_socket) { + ola::network::ConnectedSocket *socket = accepting_socket->Accept(); + + if (socket) + NewConnection(socket); +} + + +/* + * Add a new ConnectedSocket to this Server. + * @param socket the new ConnectedSocket + */ +bool OlaServer::NewConnection(ola::network::ConnectedSocket *socket) { + if (!socket) + return false; + + StreamRpcChannel *channel = new StreamRpcChannel(NULL, socket, m_export_map); + socket->SetOnClose(NewSingleClosure(this, &OlaServer::SocketClosed, socket)); + OlaClientService_Stub *stub = new OlaClientService_Stub(channel); + Client *client = new Client(stub); + OlaServerServiceImpl *service = m_service_factory->New(m_universe_store, + m_device_manager, + m_plugin_manager, + client, + m_export_map, + m_port_manager, + m_rdm_controller, + m_ss->WakeUpTime()); + channel->SetService(service); + + map::const_iterator iter; + iter = m_sd_to_service.find(socket->ReadDescriptor()); + + if (iter != m_sd_to_service.end()) + OLA_INFO << "New socket but the client already exists!"; + + pair pair(socket->ReadDescriptor(), service); + m_sd_to_service.insert(pair); + + // This hands off ownership to the select server + m_ss->AddSocket(socket, true); + (*m_export_map->GetIntegerVar(K_CLIENT_VAR))++; + return 0; +} + + +/* + * Called when a socket is closed + */ +void OlaServer::SocketClosed(ola::network::ConnectedSocket *socket) { + map::iterator iter; + iter = m_sd_to_service.find(socket->ReadDescriptor()); + + if (iter == m_sd_to_service.end()) + OLA_INFO << "A socket was closed but we didn't find the client"; + + (*m_export_map->GetIntegerVar(K_CLIENT_VAR))--; + CleanupConnection(iter->second); + m_sd_to_service.erase(iter); +} + + +/* + * Run the garbage collector + */ +bool OlaServer::RunHousekeeping() { + OLA_DEBUG << "Garbage collecting"; + m_universe_store->GarbageCollectUniverses(); + m_rdm_controller->CheckTimeouts(*m_ss->WakeUpTime()); + return true; +} + + +/* + * Called once per loop iteration + */ +void OlaServer::CheckForReload() { + if (m_reload_plugins) { + m_reload_plugins = false; + OLA_INFO << "Reloading plugins"; + StopPlugins(); + m_plugin_manager->LoadAll(); + } +} + + +/* + * Setup the HTTP server if required. + * @param interface the primary interface that the server is using. + */ +#ifdef HAVE_LIBMICROHTTPD +bool OlaServer::StartHttpServer(const ola::network::Interface &interface) { + if (!m_options.http_enable) + return true; + + // create a pipe socket for the http server to communicate with the main + // server on. + ola::network::PipeSocket *socket = new ola::network::PipeSocket(); + if (!socket->Init()) { + delete socket; + return false; + } + + // ownership of the socket is transferred here. + m_httpd = new OlaHttpServer(m_export_map, + socket->OppositeEnd(), + this, + m_options.http_port, + m_options.http_enable_quit, + m_options.http_data_dir, + interface); + + if (m_httpd->Init()) { + m_httpd->Start(); + // register the pipe socket as a client + NewConnection(socket); + return true; + } else { + socket->Close(); + delete socket; + delete m_httpd; + m_httpd = NULL; + return false; + } +} +#endif + + +/* + * Stop and unload all the plugins + */ +void OlaServer::StopPlugins() { + if (m_plugin_manager) + m_plugin_manager->UnloadAll(); + if (m_device_manager) { + if (m_device_manager->DeviceCount()) { + OLA_WARN << "Some devices failed to unload, we're probably leaking " + << "memory now"; + } + m_device_manager->UnregisterAllDevices(); + } +} + + +/* + * Cleanup everything related to a client connection + */ +void OlaServer::CleanupConnection(OlaServerServiceImpl *service) { + Client *client = service->GetClient(); + + vector universe_list; + m_universe_store->GetList(&universe_list); + vector::iterator uni_iter; + + // O(universes * clients). Clean this up sometime. + for (uni_iter = universe_list.begin(); + uni_iter != universe_list.end(); + ++uni_iter) { + (*uni_iter)->RemoveSourceClient(client); + (*uni_iter)->RemoveSinkClient(client); + } + delete client->Stub()->channel(); + delete client->Stub(); + delete client; + delete service; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServer.h b/open-lighting-architecture/ola-0.8.4/olad/OlaServer.h new file mode 100644 index 0000000..2a6844e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServer.h @@ -0,0 +1,118 @@ +/* + * 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 Library 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. + * + * OlaServer.h + * Interface for the ola server class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_OLASERVER_H_ +#define OLAD_OLASERVER_H_ + +#if HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "ola/ExportMap.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "ola/plugin_id.h" + +namespace ola { + +#ifdef HAVE_LIBMICROHTTPD +typedef class OlaHttpServer OlaHttpServer_t; +#else +typedef int OlaHttpServer_t; +#endif + +typedef struct { + bool http_enable; // run the http server + bool http_localhost_only; // restrict access to localhost only + bool http_enable_quit; // enable /quit + unsigned int http_port; // port to run the http server on + std::string http_data_dir; // directory that contains the static content +} ola_server_options; + + +/* + * The main OlaServer class + */ +class OlaServer { + public: + OlaServer(class OlaServerServiceImplFactory *factory, + const vector &plugin_loaders, + class PreferencesFactory *preferences_factory, + ola::network::SelectServer *ss, + ola_server_options *ola_options, + ola::network::AcceptingSocket *socket = NULL, + ExportMap *export_map = NULL); + ~OlaServer(); + bool Init(); + void ReloadPlugins(); + void StopServer() { m_ss->Terminate(); } + void AcceptNewConnection(ola::network::AcceptingSocket *socket); + bool NewConnection(ola::network::ConnectedSocket *socket); + void SocketClosed(ola::network::ConnectedSocket *socket); + bool RunHousekeeping(); + void CheckForReload(); + + static const unsigned int DEFAULT_HTTP_PORT = 9090; + + private : + OlaServer(const OlaServer&); + OlaServer& operator=(const OlaServer&); + +#ifdef HAVE_LIBMICROHTTPD + bool StartHttpServer(const ola::network::Interface &interface); +#endif + void StopPlugins(); + void CleanupConnection(class OlaServerServiceImpl *service); + + class OlaServerServiceImplFactory *m_service_factory; + vector m_plugin_loaders; + ola::network::SelectServer *m_ss; + ola::network::AcceptingSocket *m_accepting_socket; + + class DeviceManager *m_device_manager; + class PluginManager *m_plugin_manager; + class PluginAdaptor *m_plugin_adaptor; + class PreferencesFactory *m_preferences_factory; + class Preferences *m_universe_preferences; + class UniverseStore *m_universe_store; + class ExportMap *m_export_map; + class PortManager *m_port_manager; + + bool m_reload_plugins; + bool m_init_run; + bool m_free_export_map; + ola::network::timeout_id m_housekeeping_timeout; + std::map m_sd_to_service; + OlaHttpServer_t *m_httpd; + ola_server_options m_options; + class InternalRDMController *m_rdm_controller; + + static const char UNIVERSE_PREFERENCES[]; + static const char K_CLIENT_VAR[]; + static const char K_UID_VAR[]; + static const unsigned int K_HOUSEKEEPING_TIMEOUT_MS; +}; +} // ola +#endif // OLAD_OLASERVER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.cpp new file mode 100644 index 0000000..fa1e891 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.cpp @@ -0,0 +1,847 @@ +/* + * 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 Library 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. + * + * OlaServerServiceImpl.cpp + * Implemtation of the OlaServerService interface. This is the class that + * handles all the RPCs on the server side. + * Copyright (C) 2005 - 2008 Simon Newton + */ + +#include +#include +#include +#include "common/protocol/Ola.pb.h" +#include "ola/Callback.h" +#include "ola/DmxBuffer.h" +#include "ola/ExportMap.h" +#include "ola/Logging.h" +#include "ola/rdm/UIDSet.h" +#include "olad/Client.h" +#include "olad/Device.h" +#include "olad/DeviceManager.h" +#include "olad/DmxSource.h" +#include "olad/InternalRDMController.h" +#include "olad/OlaServerServiceImpl.h" +#include "olad/Plugin.h" +#include "olad/PluginManager.h" +#include "olad/Port.h" +#include "olad/PortManager.h" +#include "olad/Universe.h" +#include "olad/UniverseStore.h" + +namespace ola { + +using google::protobuf::RpcController; +using ola::proto::Ack; +using ola::proto::DeviceConfigReply; +using ola::proto::DeviceConfigRequest; +using ola::proto::DeviceInfo; +using ola::proto::DeviceInfoReply; +using ola::proto::DeviceInfoRequest; +using ola::proto::DmxData; +using ola::proto::MergeModeRequest; +using ola::proto::OptionalUniverseRequest; +using ola::proto::PatchPortRequest; +using ola::proto::PluginDescriptionReply; +using ola::proto::PluginDescriptionRequest; +using ola::proto::PluginInfo; +using ola::proto::PluginListReply; +using ola::proto::PluginListRequest; +using ola::proto::PortInfo; +using ola::proto::RegisterDmxRequest; +using ola::proto::UniverseInfo; +using ola::proto::UniverseInfoReply; +using ola::proto::UniverseNameRequest; +using ola::proto::UniverseRequest; +using ola::rdm::UIDSet; + + +OlaServerServiceImpl::~OlaServerServiceImpl() { + if (m_uid) + delete m_uid; +} + + +/* + * Returns the current DMX values for a particular universe + */ +void OlaServerServiceImpl::GetDmx( + RpcController* controller, + const UniverseRequest* request, + DmxData* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + const DmxBuffer buffer = universe->GetDMX(); + response->set_data(buffer.Get()); + response->set_universe(request->universe()); + done->Run(); +} + + + +/* + * Register a client to receive DMX data. + */ +void OlaServerServiceImpl::RegisterForDmx( + RpcController* controller, + const RegisterDmxRequest* request, + Ack* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverseOrCreate( + request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + if (request->action() == ola::proto::REGISTER) { + universe->AddSinkClient(m_client); + } else { + universe->RemoveSinkClient(m_client); + } + done->Run(); + + (void) response; +} + + +/* + * Update the DMX values for a particular universe + */ +void OlaServerServiceImpl::UpdateDmxData( + RpcController* controller, + const DmxData* request, + Ack* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + if (m_client) { + DmxBuffer buffer; + buffer.Set(request->data()); + + uint8_t priority = DmxSource::PRIORITY_DEFAULT; + if (request->has_priority()) { + priority = request->priority(); + priority = std::max(DmxSource::PRIORITY_MIN, priority); + priority = std::min(DmxSource::PRIORITY_MAX, priority); + } + DmxSource source(buffer, *m_wake_up_time, priority); + m_client->DMXRecieved(request->universe(), source); + universe->SourceClientDataChanged(m_client); + } + done->Run(); + (void) response; +} + + +/* + * Handle a streaming DMX update, we don't send responses for this + */ +void OlaServerServiceImpl::StreamDmxData( + RpcController* controller, + const ::ola::proto::DmxData* request, + ::ola::proto::STREAMING_NO_RESPONSE* response, + ::google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + + if (!universe) + return; + + if (m_client) { + DmxBuffer buffer; + buffer.Set(request->data()); + + uint8_t priority = DmxSource::PRIORITY_DEFAULT; + if (request->has_priority()) { + priority = request->priority(); + priority = std::max(DmxSource::PRIORITY_MIN, priority); + priority = std::min(DmxSource::PRIORITY_MAX, priority); + } + DmxSource source(buffer, *m_wake_up_time, priority); + m_client->DMXRecieved(request->universe(), source); + universe->SourceClientDataChanged(m_client); + } + (void) controller; + (void) response; + (void) done; +} + + +/* + * Sets the name of a universe + */ +void OlaServerServiceImpl::SetUniverseName( + RpcController* controller, + const UniverseNameRequest* request, + Ack* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + universe->SetName(request->name()); + done->Run(); + (void) response; +} + + +/* + * Set the merge mode for a universe + */ +void OlaServerServiceImpl::SetMergeMode( + RpcController* controller, + const MergeModeRequest* request, + Ack* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + Universe::merge_mode mode = request->merge_mode() == ola::proto::HTP ? + Universe::MERGE_HTP : Universe::MERGE_LTP; + universe->SetMergeMode(mode); + done->Run(); + (void) response; +} + + +/* + * Patch a port to a universe + */ +void OlaServerServiceImpl::PatchPort( + RpcController* controller, + const PatchPortRequest* request, + Ack* response, + google::protobuf::Closure* done) { + + AbstractDevice *device = + m_device_manager->GetDevice(request->device_alias()); + + if (!device) + return MissingDeviceError(controller, done); + + bool result; + if (request->is_output()) { + OutputPort *port = device->GetOutputPort(request->port_id()); + if (!port) + return MissingPortError(controller, done); + + if (request->action() == ola::proto::PATCH) + result = m_port_manager->PatchPort(port, request->universe()); + else + result = m_port_manager->UnPatchPort(port); + } else { + InputPort *port = device->GetInputPort(request->port_id()); + if (!port) + return MissingPortError(controller, done); + + if (request->action() == ola::proto::PATCH) + result = m_port_manager->PatchPort(port, request->universe()); + else + result = m_port_manager->UnPatchPort(port); + } + + if (!result) + controller->SetFailed("Patch port request failed"); + (void) response; + done->Run(); +} + + +/* + * Set the priority of a set of ports + */ +void OlaServerServiceImpl::SetPortPriority( + RpcController* controller, + const ola::proto::PortPriorityRequest* request, + Ack* response, + google::protobuf::Closure* done) { + + AbstractDevice *device = + m_device_manager->GetDevice(request->device_alias()); + + if (!device) + return MissingDeviceError(controller, done); + + bool status; + + bool inherit_mode = true; + uint8_t value = 0; + if (request->priority_mode() == PRIORITY_MODE_OVERRIDE) { + if (request->has_priority()) { + inherit_mode = false; + value = request->priority(); + } else { + OLA_INFO << "In Set Port Priority, override mode was set but the value " + "wasn't specified"; + controller->SetFailed( + "Invalid SetPortPriority request, see logs for more info"); + done->Run(); + return; + } + } + + if (request->is_output()) { + OutputPort *port = device->GetOutputPort(request->port_id()); + if (!port) + return MissingPortError(controller, done); + + if (inherit_mode) + status = m_port_manager->SetPriorityInherit(port); + else + status = m_port_manager->SetPriorityOverride(port, value); + } else { + InputPort *port = device->GetInputPort(request->port_id()); + if (!port) + return MissingPortError(controller, done); + + if (inherit_mode) + status = m_port_manager->SetPriorityInherit(port); + else + status = m_port_manager->SetPriorityOverride(port, value); + } + + if (!status) + controller->SetFailed( + "Invalid SetPortPriority request, see logs for more info"); + done->Run(); + (void) response; +} + + +/* + * Returns information on the active universes. + */ +void OlaServerServiceImpl::GetUniverseInfo( + RpcController* controller, + const OptionalUniverseRequest* request, + UniverseInfoReply* response, + google::protobuf::Closure* done) { + + UniverseInfo *universe_info; + + if (request->has_universe()) { + // return info for a single universe + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + universe_info = response->add_universe(); + universe_info->set_universe(universe->UniverseId()); + universe_info->set_name(universe->Name()); + universe_info->set_merge_mode(universe->MergeMode() == Universe::MERGE_HTP + ? ola::proto::HTP: ola::proto::LTP); + universe_info->set_input_port_count(universe->InputPortCount()); + universe_info->set_output_port_count(universe->OutputPortCount()); + universe_info->set_rdm_devices(universe->UIDCount()); + } else { + // return all + vector uni_list; + m_universe_store->GetList(&uni_list); + vector::const_iterator iter; + + for (iter = uni_list.begin(); iter != uni_list.end(); ++iter) { + universe_info = response->add_universe(); + universe_info->set_universe((*iter)->UniverseId()); + universe_info->set_name((*iter)->Name()); + universe_info->set_merge_mode((*iter)->MergeMode() == Universe::MERGE_HTP + ? ola::proto::HTP: ola::proto::LTP); + universe_info->set_input_port_count((*iter)->InputPortCount()); + universe_info->set_output_port_count((*iter)->OutputPortCount()); + universe_info->set_rdm_devices((*iter)->UIDCount()); + } + } + done->Run(); +} + + +/* + * Return info on available plugins + */ +void OlaServerServiceImpl::GetPlugins( + RpcController* controller, + const PluginListRequest* request, + PluginListReply* response, + google::protobuf::Closure* done) { + vector plugin_list; + vector::const_iterator iter; + m_plugin_manager->Plugins(&plugin_list); + + for (iter = plugin_list.begin(); iter != plugin_list.end(); ++iter) + AddPlugin(*iter, response); + done->Run(); + (void) request; + (void) controller; +} + + +/* + * Return the description for a plugin. + */ +void OlaServerServiceImpl::GetPluginDescription( + RpcController* controller, + const ola::proto::PluginDescriptionRequest* request, + ola::proto::PluginDescriptionReply* response, + google::protobuf::Closure* done) { + + AbstractPlugin *plugin = + m_plugin_manager->GetPlugin((ola_plugin_id) request->plugin_id()); + + if (plugin) { + response->set_name(plugin->Name()); + response->set_description(plugin->Description()); + } else { + controller->SetFailed("Plugin not loaded"); + } + done->Run(); +} + + +/* + * Return information on available devices + */ +void OlaServerServiceImpl::GetDeviceInfo(RpcController* controller, + const DeviceInfoRequest* request, + DeviceInfoReply* response, + google::protobuf::Closure* done) { + vector device_list = m_device_manager->Devices(); + vector::const_iterator iter; + + for (iter = device_list.begin(); iter != device_list.end(); ++iter) { + if (request->has_plugin_id()) { + if (iter->device->Owner()->Id() == request->plugin_id() || + request->plugin_id() == ola::OLA_PLUGIN_ALL) + AddDevice(iter->device, iter->alias, response); + } else { + AddDevice(iter->device, iter->alias, response); + } + } + (void) controller; + done->Run(); +} + + +/* + * Handle a GetCandidatePorts request + */ +void OlaServerServiceImpl::GetCandidatePorts( + RpcController* controller, + const ola::proto::OptionalUniverseRequest* request, + ola::proto::DeviceInfoReply* response, + google::protobuf::Closure* done) { + vector device_list = m_device_manager->Devices(); + vector::const_iterator iter; + + Universe *universe = NULL; + + if (request->has_universe()) { + universe = m_universe_store->GetUniverse(request->universe()); + + if (!universe) + return MissingUniverseError(controller, done); + } + + vector input_ports; + vector output_ports; + vector::const_iterator input_iter; + vector::const_iterator output_iter; + + for (iter = device_list.begin(); iter != device_list.end(); ++iter) { + AbstractDevice *device = iter->device; + input_ports.clear(); + output_ports.clear(); + device->InputPorts(&input_ports); + device->OutputPorts(&output_ports); + + bool seen_input_port = false; + bool seen_output_port = false; + unsigned int unpatched_input_ports = 0; + unsigned int unpatched_output_ports = 0; + + if (universe) { + for (input_iter = input_ports.begin(); input_iter != input_ports.end(); + input_iter++) { + if ((*input_iter)->GetUniverse() == universe) + seen_input_port = true; + else if (!(*input_iter)->GetUniverse()) + unpatched_input_ports++; + } + + for (output_iter = output_ports.begin(); + output_iter != output_ports.end(); output_iter++) { + if ((*output_iter)->GetUniverse() == universe) + seen_output_port = true; + else if (!(*output_iter)->GetUniverse()) + unpatched_output_ports++; + } + } else { + unpatched_input_ports = input_ports.size(); + unpatched_output_ports = output_ports.size(); + } + + bool can_bind_more_input_ports = ( + (!seen_output_port || device->AllowLooping()) && + (!seen_input_port || device->AllowMultiPortPatching())); + + bool can_bind_more_output_ports = ( + (!seen_input_port || device->AllowLooping()) && + (!seen_output_port || device->AllowMultiPortPatching())); + + if ((unpatched_input_ports == 0 || !can_bind_more_input_ports) && + (unpatched_output_ports == 0 || !can_bind_more_output_ports)) + continue; + + // go ahead and create the device at this point + DeviceInfo *device_info = response->add_device(); + device_info->set_device_alias(iter->alias); + device_info->set_device_name(device->Name()); + device_info->set_device_id(device->UniqueId()); + + if (device->Owner()) + device_info->set_plugin_id(device->Owner()->Id()); + + for (input_iter = input_ports.begin(); input_iter != input_ports.end(); + ++input_iter) { + if ((*input_iter)->GetUniverse()) + continue; + if (!can_bind_more_input_ports) + break; + + PortInfo *port_info = device_info->add_input_port(); + PopulatePort(**input_iter, port_info); + + if (!device->AllowMultiPortPatching()) + break; + } + + for (output_iter = output_ports.begin(); output_iter != output_ports.end(); + ++output_iter) { + if ((*output_iter)->GetUniverse()) + continue; + if (!can_bind_more_output_ports) + break; + + PortInfo *port_info = device_info->add_output_port(); + PopulatePort(**output_iter, port_info); + + if (!device->AllowMultiPortPatching()) + break; + } + } + done->Run(); +} + + +/* + * Handle a ConfigureDevice request + */ +void OlaServerServiceImpl::ConfigureDevice(RpcController* controller, + const DeviceConfigRequest* request, + DeviceConfigReply* response, + google::protobuf::Closure* done) { + AbstractDevice *device = + m_device_manager->GetDevice(request->device_alias()); + if (!device) + return MissingDeviceError(controller, done); + + device->Configure(controller, + request->data(), + response->mutable_data(), done); +} + + +/* + * Fetch the UID list for a universe + */ +void OlaServerServiceImpl::GetUIDs(RpcController* controller, + const ola::proto::UniverseRequest* request, + ola::proto::UIDListReply* response, + google::protobuf::Closure* done) { + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + response->set_universe(request->universe()); + UIDSet uid_set; + universe->GetUIDs(&uid_set); + + UIDSet::Iterator iter = uid_set.Begin(); + for (; iter != uid_set.End(); ++iter) { + ola::proto::UID *uid = response->add_uid(); + uid->set_esta_id(iter->ManufacturerId()); + uid->set_device_id(iter->DeviceId()); + } + done->Run(); +} + + +/* + * Force RDM discovery for a universe + */ +void OlaServerServiceImpl::ForceDiscovery( + RpcController* controller, + const ola::proto::UniverseRequest* request, + ola::proto::Ack* response, + google::protobuf::Closure* done) { + + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + universe->RunRDMDiscovery(); + done->Run(); + (void) response; +} + + +/* + * Handle an RDM Command + */ +void OlaServerServiceImpl::RDMCommand( + RpcController* controller, + const ::ola::proto::RDMRequest* request, + ola::proto::RDMResponse* response, + google::protobuf::Closure* done) { + Universe *universe = m_universe_store->GetUniverse(request->universe()); + if (!universe) + return MissingUniverseError(controller, done); + + UID destination(request->uid().esta_id(), + request->uid().device_id()); + + SingleUseCallback1 *callback = + NewSingleCallback( + this, + &OlaServerServiceImpl::HandleRDMResponse, + controller, + response, + done); + bool r = m_rdm_controller->SendRDMRequest( + universe, + destination, + request->sub_device(), + request->param_id(), + request->data(), + request->is_set(), + callback, + m_uid); + if (!r) { + controller->SetFailed("Failed to send RDM command"); + delete callback; + done->Run(); + } +} + + +/* + * Set this client's source UID + */ +void OlaServerServiceImpl::SetSourceUID( + RpcController* controller, + const ::ola::proto::UID* request, + ola::proto::Ack* response, + google::protobuf::Closure* done) { + + UID source_uid(request->esta_id(), request->device_id()); + if (!m_uid) + m_uid = new UID(source_uid); + else + *m_uid = source_uid; + done->Run(); + (void) controller; + (void) response; +} + + +/* + * Handle an RDM Response, this includes broadcast messages, messages that + * timed out and normal response messages. + */ +void OlaServerServiceImpl::HandleRDMResponse( + RpcController* controller, + ola::proto::RDMResponse* response, + google::protobuf::Closure* done, + const rdm_response_data &status) { + + // check for time out errors + if (status.status == RDM_RESPONSE_TIMED_OUT) { + controller->SetFailed("RDM command timed out"); + done->Run(); + return; + } + + if (status.status == RDM_RESPONSE_OK) { + if (status.response) { + response->set_response_code(status.response->ResponseType()); + response->set_message_count(status.response->MessageCount()); + response->set_was_broadcast(false); + + if (status.response->ParamData() && status.response->ParamDataSize()) { + const string data( + reinterpret_cast(status.response->ParamData()), + status.response->ParamDataSize()); + response->set_data(data); + } else { + response->set_data(""); + } + } else { + OLA_WARN << "RDM state was ok but response was NULL"; + controller->SetFailed("Missing Response"); + } + } else if (status.status == RDM_RESPONSE_BROADCAST) { + response->set_was_broadcast(true); + // fill these in with dummy values + response->set_response_code(0); + response->set_message_count(0); + response->set_data(""); + } else { + OLA_WARN << "unknown response status " << status.status; + controller->SetFailed("Unknown status, see the logs"); + } + + done->Run(); +} + + +// Private methods +//----------------------------------------------------------------------------- +void OlaServerServiceImpl::MissingUniverseError( + RpcController* controller, + google::protobuf::Closure* done) { + controller->SetFailed("Universe doesn't exist"); + done->Run(); +} + +void OlaServerServiceImpl::MissingDeviceError( + RpcController* controller, + google::protobuf::Closure* done) { + controller->SetFailed("Device doesn't exist"); + done->Run(); +} + + +void OlaServerServiceImpl::MissingPluginError( + RpcController* controller, + google::protobuf::Closure* done) { + controller->SetFailed("Plugin doesn't exist"); + done->Run(); +} + + +void OlaServerServiceImpl::MissingPortError(RpcController* controller, + google::protobuf::Closure* done) { + controller->SetFailed("Port doesn't exist"); + done->Run(); +} + + +/* + * Add this device to the DeviceInfo response + */ +void OlaServerServiceImpl::AddPlugin(AbstractPlugin *plugin, + PluginListReply* response) const { + PluginInfo *plugin_info = response->add_plugin(); + plugin_info->set_plugin_id(plugin->Id()); + plugin_info->set_name(plugin->Name()); +} + + +/* + * Add this device to the DeviceInfo response + */ +void OlaServerServiceImpl::AddDevice(AbstractDevice *device, + unsigned int alias, + DeviceInfoReply* response) const { + DeviceInfo *device_info = response->add_device(); + device_info->set_device_alias(alias); + device_info->set_device_name(device->Name()); + device_info->set_device_id(device->UniqueId()); + + if (device->Owner()) + device_info->set_plugin_id(device->Owner()->Id()); + + vector input_ports; + device->InputPorts(&input_ports); + vector::const_iterator input_iter; + + for (input_iter = input_ports.begin(); input_iter != input_ports.end(); + ++input_iter) { + PortInfo *port_info = device_info->add_input_port(); + PopulatePort(**input_iter, port_info); + } + + vector output_ports; + device->OutputPorts(&output_ports); + vector::const_iterator output_iter; + + for (output_iter = output_ports.begin(); output_iter != output_ports.end(); + ++output_iter) { + PortInfo *port_info = device_info->add_output_port(); + PopulatePort(**output_iter, port_info); + } +} + + +template +void OlaServerServiceImpl::PopulatePort(const PortClass &port, + PortInfo *port_info) const { + port_info->set_port_id(port.PortId()); + port_info->set_priority_capability(port.PriorityCapability()); + port_info->set_description(port.Description()); + + if (port.GetUniverse()) { + port_info->set_active(true); + port_info->set_universe(port.GetUniverse()->UniverseId()); + } else { + port_info->set_active(false); + } + + if (port.PriorityCapability() != CAPABILITY_NONE) + port_info->set_priority(port.GetPriority()); + if (port.PriorityCapability() == CAPABILITY_FULL) + port_info->set_priority_mode(port.GetPriorityMode()); +} + + +// OlaServerServiceImplFactory +// ---------------------------------------------------------------------------- +OlaServerServiceImpl *OlaServerServiceImplFactory::New( + UniverseStore *universe_store, + DeviceManager *device_manager, + PluginManager *plugin_manager, + Client *client, + ExportMap *export_map, + PortManager *port_manager, + InternalRDMController *rdm_controller, + const TimeStamp *wake_up_time) { + return new OlaServerServiceImpl(universe_store, + device_manager, + plugin_manager, + client, + export_map, + port_manager, + rdm_controller, + wake_up_time); +}; +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.h b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.h new file mode 100644 index 0000000..91d4f05 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImpl.h @@ -0,0 +1,180 @@ +/* + * 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 Library 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. + * + * OlaServerServiceImpl.h + * Implemtation of the OlaService interface + * Copyright (C) 2005 - 2008 Simon Newton + */ + +#include "common/protocol/Ola.pb.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/RDMCommand.h" +#include "olad/InternalRDMController.h" + +#ifndef OLAD_OLASERVERSERVICEIMPL_H_ +#define OLAD_OLASERVERSERVICEIMPL_H_ + +namespace ola { + +using google::protobuf::RpcController; +using ola::proto::Ack; + +class OlaServerServiceImpl: public ola::proto::OlaServerService { + public: + OlaServerServiceImpl(class UniverseStore *universe_store, + class DeviceManager *device_manager, + class PluginManager *plugin_manager, + class Client *client, + class ExportMap *export_map, + class PortManager *port_manager, + class InternalRDMController *rdm_controller, + const class TimeStamp *wake_up_time): + m_universe_store(universe_store), + m_device_manager(device_manager), + m_plugin_manager(plugin_manager), + m_client(client), + m_export_map(export_map), + m_port_manager(port_manager), + m_rdm_controller(rdm_controller), + m_wake_up_time(wake_up_time), + m_uid(NULL) {} + ~OlaServerServiceImpl(); + + void GetDmx(RpcController* controller, + const ola::proto::UniverseRequest* request, + ola::proto::DmxData* response, + google::protobuf::Closure* done); + void RegisterForDmx(RpcController* controller, + const ola::proto::RegisterDmxRequest* request, + Ack* response, + google::protobuf::Closure* done); + void UpdateDmxData(RpcController* controller, + const ola::proto::DmxData* request, + Ack* response, + google::protobuf::Closure* done); + void StreamDmxData(RpcController* controller, + const ::ola::proto::DmxData* request, + ::ola::proto::STREAMING_NO_RESPONSE* response, + ::google::protobuf::Closure* done); + void SetUniverseName(RpcController* controller, + const ola::proto::UniverseNameRequest* request, + Ack* response, + google::protobuf::Closure* done); + void SetMergeMode(RpcController* controller, + const ola::proto::MergeModeRequest* request, + Ack* response, + google::protobuf::Closure* done); + void PatchPort(RpcController* controller, + const ola::proto::PatchPortRequest* request, + Ack* response, + google::protobuf::Closure* done); + void SetPortPriority(RpcController* controller, + const ola::proto::PortPriorityRequest* request, + Ack* response, + google::protobuf::Closure* done); + void GetUniverseInfo(RpcController* controller, + const ola::proto::OptionalUniverseRequest* request, + ola::proto::UniverseInfoReply* response, + google::protobuf::Closure* done); + void GetPlugins(RpcController* controller, + const ola::proto::PluginListRequest* request, + ola::proto::PluginListReply* response, + google::protobuf::Closure* done); + void GetPluginDescription( + RpcController* controller, + const ola::proto::PluginDescriptionRequest* request, + ola::proto::PluginDescriptionReply* response, + google::protobuf::Closure* done); + void GetDeviceInfo(RpcController* controller, + const ola::proto::DeviceInfoRequest* request, + ola::proto::DeviceInfoReply* response, + google::protobuf::Closure* done); + void GetCandidatePorts(RpcController* controller, + const ola::proto::OptionalUniverseRequest* request, + ola::proto::DeviceInfoReply* response, + google::protobuf::Closure* done); + void ConfigureDevice(RpcController* controller, + const ola::proto::DeviceConfigRequest* request, + ola::proto::DeviceConfigReply* response, + google::protobuf::Closure* done); + void GetUIDs(RpcController* controller, + const ola::proto::UniverseRequest* request, + ola::proto::UIDListReply* response, + google::protobuf::Closure* done); + void ForceDiscovery(RpcController* controller, + const ola::proto::UniverseRequest* request, + ola::proto::Ack* response, + google::protobuf::Closure* done); + void RDMCommand(RpcController* controller, + const ::ola::proto::RDMRequest* request, + ola::proto::RDMResponse* response, + google::protobuf::Closure* done); + void SetSourceUID(RpcController* controller, + const ::ola::proto::UID* request, + ola::proto::Ack* response, + google::protobuf::Closure* done); + + Client *GetClient() const { return m_client; } + + void HandleRDMResponse(RpcController* controller, + ola::proto::RDMResponse* response, + google::protobuf::Closure* done, + const rdm_response_data &status); + + private: + void MissingUniverseError(RpcController* controller, + google::protobuf::Closure* done); + void MissingPluginError(RpcController* controller, + google::protobuf::Closure* done); + void MissingDeviceError(RpcController* controller, + google::protobuf::Closure* done); + void MissingPortError(RpcController* controller, + google::protobuf::Closure* done); + + void AddPlugin(class AbstractPlugin *plugin, + ola::proto::PluginListReply* response) const; + void AddDevice(class AbstractDevice *device, + unsigned int alias, + ola::proto::DeviceInfoReply* response) const; + + template + void PopulatePort(const PortClass &port, + ola::proto::PortInfo *port_info) const; + + UniverseStore *m_universe_store; + DeviceManager *m_device_manager; + class PluginManager *m_plugin_manager; + class Client *m_client; + class ExportMap *m_export_map; + class PortManager *m_port_manager; + class InternalRDMController *m_rdm_controller; + const class TimeStamp *m_wake_up_time; + ola::rdm::UID *m_uid; +}; + + +class OlaServerServiceImplFactory { + public: + OlaServerServiceImpl *New(UniverseStore *universe_store, + DeviceManager *device_manager, + PluginManager *plugin_manager, + Client *client, + ExportMap *export_map, + PortManager *port_manager, + InternalRDMController *rdm_controller, + const TimeStamp *wake_up_time); +}; +} // ola +#endif // OLAD_OLASERVERSERVICEIMPL_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImplTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImplTest.cpp new file mode 100644 index 0000000..b84aeac --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServerServiceImplTest.cpp @@ -0,0 +1,586 @@ +/* + * 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 Library 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. + * + * OlaServerServiceImplTest.cpp + * Test fixture for the OlaServerServiceImpl class + * Copyright (C) 2005-2009 Simon Newton + * + * How this file is organized: + * We test each rpc method in OlaServerServiceImpl, for each method, we have a + * series of Check objects which validate the rpc response. + */ + +#include +#include +#include + +#include "common/rpc/SimpleRpcController.h" +#include "ola/Clock.h" +#include "ola/DmxBuffer.h" +#include "ola/ExportMap.h" +#include "ola/Logging.h" +#include "olad/Client.h" +#include "olad/DeviceManager.h" +#include "olad/OlaServerServiceImpl.h" +#include "olad/PluginLoader.h" +#include "olad/Universe.h" +#include "olad/UniverseStore.h" + +using google::protobuf::Closure; +using google::protobuf::NewCallback; +using ola::DmxBuffer; +using ola::OlaServerServiceImpl; +using ola::Universe; +using ola::UniverseStore; +using ola::rpc::SimpleRpcController; +using std::string; + + +class OlaServerServiceImplTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(OlaServerServiceImplTest); + CPPUNIT_TEST(testGetDmx); + CPPUNIT_TEST(testRegisterForDmx); + CPPUNIT_TEST(testUpdateDmxData); + CPPUNIT_TEST(testSetUniverseName); + CPPUNIT_TEST(testSetMergeMode); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetDmx(); + void testRegisterForDmx(); + void testUpdateDmxData(); + void testSetUniverseName(); + void testSetMergeMode(); + + private: + void CallGetDmx(OlaServerServiceImpl *impl, + int universe_id, + class GetDmxCheck &check); + void CallRegisterForDmx(OlaServerServiceImpl *impl, + int universe_id, + ola::proto::RegisterAction action, + class RegisterForDmxCheck &check); + void CallUpdateDmxData(OlaServerServiceImpl *impl, + int universe_id, + const DmxBuffer &data, + class UpdateDmxDataCheck &check); + void CallSetUniverseName(OlaServerServiceImpl *impl, + int universe_id, + const string &name, + class SetUniverseNameCheck &check); + void CallSetMergeMode(OlaServerServiceImpl *impl, + int universe_id, + ola::proto::MergeMode merge_mode, + class SetMergeModeCheck &check); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(OlaServerServiceImplTest); + +static const uint8_t SAMPLE_DMX_DATA[] = {1, 2, 3, 4, 5}; + +/* + * The GetDmx Checks + */ +class GetDmxCheck { + public: + virtual ~GetDmxCheck() {} + virtual void Check(SimpleRpcController *controller, + ola::proto::DmxData *reply) = 0; +}; + + +/* + * Assert that the data is all 0 + */ +class GetDmxNoDataCheck: public GetDmxCheck { + public: + void Check(SimpleRpcController *controller, + ola::proto::DmxData *reply) { + DmxBuffer empty_buffer; + CPPUNIT_ASSERT(!controller->Failed()); + CPPUNIT_ASSERT(empty_buffer == DmxBuffer(reply->data())); + } +}; + + +/* + * Assert that the data matches the test data. + */ +class GetDmxValidDataCheck: public GetDmxCheck { + public: + void Check(SimpleRpcController *controller, + ola::proto::DmxData *reply) { + CPPUNIT_ASSERT(!controller->Failed()); + CPPUNIT_ASSERT(DmxBuffer(SAMPLE_DMX_DATA, sizeof(SAMPLE_DMX_DATA)) == + DmxBuffer(reply->data())); + } +}; + + +/* + * RegisterForDmxChecks + */ +class RegisterForDmxCheck { + public: + virtual ~RegisterForDmxCheck() {} + virtual void Check(SimpleRpcController *controller, + ola::proto::Ack *reply) = 0; +}; + + +/* + * UpdateDmxDataCheck + */ +class UpdateDmxDataCheck { + public: + virtual ~UpdateDmxDataCheck() {} + virtual void Check(SimpleRpcController *controller, + ola::proto::Ack *reply) = 0; +}; + + +/* + * SetUniverseNameCheck + */ +class SetUniverseNameCheck { + public: + virtual ~SetUniverseNameCheck() {} + virtual void Check(SimpleRpcController *controller, + ola::proto::Ack *reply) = 0; +}; + + +/* + * SetMergeModeCheck + */ +class SetMergeModeCheck { + public: + virtual ~SetMergeModeCheck() {} + virtual void Check(SimpleRpcController *controller, + ola::proto::Ack *reply) = 0; +}; + + +/* + * Assert that we got a missing universe error + */ +template +class GenericMissingUniverseCheck: public parent { + public: + void Check(SimpleRpcController *controller, + reply *r) { + CPPUNIT_ASSERT(controller->Failed()); + CPPUNIT_ASSERT_EQUAL(string("Universe doesn't exist"), + controller->ErrorText()); + (void) r; + } +}; + + +/* + * Assert that we got an ack + */ +template +class GenericAckCheck: public parent { + public: + void Check(SimpleRpcController *controller, + ola::proto::Ack *r) { + CPPUNIT_ASSERT(!controller->Failed()); + (void) r; + } +}; + + +/* + * Check that the GetDmx method works + */ +void OlaServerServiceImplTest::testGetDmx() { + UniverseStore store(NULL, NULL); + OlaServerServiceImpl impl(&store, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + + GenericMissingUniverseCheck + missing_universe_check; + GetDmxNoDataCheck empty_data_check; + GetDmxValidDataCheck valid_data_check; + + // test a universe that doesn't exist + unsigned int universe_id = 0; + CallGetDmx(&impl, universe_id, missing_universe_check); + + // test a new universe + Universe *universe = store.GetUniverseOrCreate(universe_id); + CPPUNIT_ASSERT(universe); + CallGetDmx(&impl, universe_id, empty_data_check); + + // Set the universe data + DmxBuffer buffer(SAMPLE_DMX_DATA, sizeof(SAMPLE_DMX_DATA)); + universe->SetDMX(buffer); + CallGetDmx(&impl, universe_id, valid_data_check); + + // remove the universe and try again + store.AddUniverseGarbageCollection(universe); + store.GarbageCollectUniverses(); + CallGetDmx(&impl, universe_id, missing_universe_check); +} + + +/* + * Call the GetDmx method + * @param impl the OlaServerServiceImpl to use + * @param universe_id the universe_id in the request + * @param check the GetDmxCheck class to use for the callback check + */ +void OlaServerServiceImplTest::CallGetDmx(OlaServerServiceImpl *impl, + int universe_id, + GetDmxCheck &check) { + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::UniverseRequest *request = new ola::proto::UniverseRequest(); + ola::proto::DmxData *response = new ola::proto::DmxData(); + Closure *closure = NewCallback( + &check, + &GetDmxCheck::Check, + controller, + response); + + request->set_universe(universe_id); + impl->GetDmx(controller, request, response, closure); + delete controller; + delete request; + delete response; +} + + +/* + * Check the RegisterForDmx method works + */ +void OlaServerServiceImplTest::testRegisterForDmx() { + UniverseStore store(NULL, NULL); + OlaServerServiceImpl impl(&store, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + + // Register for a universe that doesn't exist + unsigned int universe_id = 0; + unsigned int second_universe_id = 99; + GenericAckCheck ack_check; + CallRegisterForDmx(&impl, universe_id, ola::proto::REGISTER, ack_check); + + // The universe should exist now and the client should be bound + Universe *universe = store.GetUniverse(universe_id); + CPPUNIT_ASSERT(universe); + CPPUNIT_ASSERT(universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, universe->SinkClientCount()); + + // Try to register again + CallRegisterForDmx(&impl, universe_id, ola::proto::REGISTER, ack_check); + CPPUNIT_ASSERT(universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, universe->SinkClientCount()); + + // Register a second universe + CallRegisterForDmx(&impl, second_universe_id, ola::proto::REGISTER, + ack_check); + Universe *second_universe = store.GetUniverse(universe_id); + CPPUNIT_ASSERT(second_universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, second_universe->SinkClientCount()); + + // Unregister the first universe + CallRegisterForDmx(&impl, universe_id, ola::proto::UNREGISTER, ack_check); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + + // Unregister the second universe + CallRegisterForDmx(&impl, second_universe_id, ola::proto::UNREGISTER, + ack_check); + CPPUNIT_ASSERT(!second_universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, second_universe->SinkClientCount()); + + // Unregister again + CallRegisterForDmx(&impl, universe_id, ola::proto::UNREGISTER, ack_check); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(NULL)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); +} + + +/* + * Call the RegisterForDmx method + * @param impl the OlaServerServiceImpl to use + * @param universe_id the universe_id in the request + * @param action the action to use REGISTER or UNREGISTER + * @param check the RegisterForDmxCheck to use for the callback check + */ +void OlaServerServiceImplTest::CallRegisterForDmx( + OlaServerServiceImpl *impl, + int universe_id, + ola::proto::RegisterAction action, + RegisterForDmxCheck &check) { + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::RegisterDmxRequest *request = ( + new ola::proto::RegisterDmxRequest()); + ola::proto::Ack *response = new ola::proto::Ack(); + Closure *closure = NewCallback( + &check, + &RegisterForDmxCheck::Check, + controller, + response); + + request->set_universe(universe_id); + request->set_action(action); + impl->RegisterForDmx(controller, request, response, closure); + delete controller; + delete request; + delete response; +} + + +/* + * Check the UpdateDmxData method works + */ +void OlaServerServiceImplTest::testUpdateDmxData() { + UniverseStore store(NULL, NULL); + ola::TimeStamp time1, time2; + ola::Client client(NULL); + ola::Client client2(NULL); + OlaServerServiceImpl impl(&store, + NULL, + NULL, + &client, + NULL, + NULL, + NULL, + &time1); + OlaServerServiceImpl impl2(&store, + NULL, + NULL, + &client2, + NULL, + NULL, + NULL, + &time2); + + GenericMissingUniverseCheck + missing_universe_check; + GenericAckCheck ack_check; + unsigned int universe_id = 0; + DmxBuffer dmx_data("this is a test"); + DmxBuffer dmx_data2("different data hmm"); + + // Update a universe that doesn't exist + ola::Clock::CurrentTime(&time1); + CallUpdateDmxData(&impl, universe_id, dmx_data, missing_universe_check); + Universe *universe = store.GetUniverse(universe_id); + CPPUNIT_ASSERT(!universe); + + // Update a universe that exists + ola::Clock::CurrentTime(&time1); + universe = store.GetUniverseOrCreate(universe_id); + CallUpdateDmxData(&impl, universe_id, dmx_data, ack_check); + CPPUNIT_ASSERT(dmx_data == universe->GetDMX()); + + // Update a second client with an older timestamp + // make sure we're in ltp mode + CPPUNIT_ASSERT_EQUAL(universe->MergeMode(), Universe::MERGE_LTP); + time2 = time1 - ola::TimeInterval(1000000); + CallUpdateDmxData(&impl2, universe_id, dmx_data2, ack_check); + CPPUNIT_ASSERT_EQUAL(dmx_data.Size(), universe->GetDMX().Size()); + // Should continue to hold the old data + CPPUNIT_ASSERT(dmx_data == universe->GetDMX()); + + // Now send a new update + ola::Clock::CurrentTime(&time2); + CallUpdateDmxData(&impl2, universe_id, dmx_data2, ack_check); + CPPUNIT_ASSERT(dmx_data2 == universe->GetDMX()); +} + + +/* + * Call the UpdateDmxDataCheck method + * @param impl the OlaServerServiceImpl to use + * @param universe_id the universe_id in the request + * @param data the DmxBuffer to use as data + * @param check the SetUniverseNameCheck to use for the callback check + */ +void OlaServerServiceImplTest::CallUpdateDmxData( + OlaServerServiceImpl *impl, + int universe_id, + const DmxBuffer &data, + UpdateDmxDataCheck &check) { + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::DmxData *request = new + ola::proto::DmxData(); + ola::proto::Ack *response = new ola::proto::Ack(); + Closure *closure = NewCallback( + &check, + &UpdateDmxDataCheck::Check, + controller, + response); + + request->set_universe(universe_id); + request->set_data(data.Get()); + impl->UpdateDmxData(controller, request, response, closure); + delete controller; + delete request; + delete response; +} + + +/* + * Check the SetUniverseName method works + */ +void OlaServerServiceImplTest::testSetUniverseName() { + UniverseStore store(NULL, NULL); + OlaServerServiceImpl impl(&store, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + + unsigned int universe_id = 0; + string universe_name = "test 1"; + string universe_name2 = "test 1-2"; + + GenericAckCheck ack_check; + GenericMissingUniverseCheck + missing_universe_check; + + // Check we get an error for a missing universe + CallSetUniverseName(&impl, universe_id, universe_name, + missing_universe_check); + Universe *universe = store.GetUniverse(universe_id); + CPPUNIT_ASSERT(!universe); + + // Check SetUniverseName works on an existing univserse + universe = store.GetUniverseOrCreate(universe_id); + CallSetUniverseName(&impl, universe_id, universe_name, ack_check); + CPPUNIT_ASSERT_EQUAL(universe_name, universe->Name()); + + // Run it again with a new name + CallSetUniverseName(&impl, universe_id, universe_name2, ack_check); + CPPUNIT_ASSERT_EQUAL(universe_name2, universe->Name()); +} + + +/* + * Call the SetUniverseName method + * @param impl the OlaServerServiceImpl to use + * @param universe_id the universe_id in the request + * @param name the name to use + * @param check the SetUniverseNameCheck to use for the callback check + */ +void OlaServerServiceImplTest::CallSetUniverseName( + OlaServerServiceImpl *impl, + int universe_id, + const string &name, + SetUniverseNameCheck &check) { + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::UniverseNameRequest *request = new + ola::proto::UniverseNameRequest(); + ola::proto::Ack *response = new ola::proto::Ack(); + Closure *closure = NewCallback( + &check, + &SetUniverseNameCheck::Check, + controller, + response); + + request->set_universe(universe_id); + request->set_name(name); + impl->SetUniverseName(controller, request, response, closure); + + delete controller; + delete request; + delete response; +} + + +/* + * Check the SetMergeMode method works + */ +void OlaServerServiceImplTest::testSetMergeMode() { + UniverseStore store(NULL, NULL); + OlaServerServiceImpl impl(&store, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL); + + unsigned int universe_id = 0; + + GenericAckCheck ack_check; + GenericMissingUniverseCheck + missing_universe_check; + + // Check we get an error for a missing universe + CallSetMergeMode(&impl, universe_id, ola::proto::HTP, missing_universe_check); + Universe *universe = store.GetUniverse(universe_id); + CPPUNIT_ASSERT(!universe); + + // Check SetUniverseName works + universe = store.GetUniverseOrCreate(universe_id); + CallSetMergeMode(&impl, universe_id, ola::proto::HTP, ack_check); + CPPUNIT_ASSERT(Universe::MERGE_HTP == universe->MergeMode()); + + // Run it again + CallSetMergeMode(&impl, universe_id, ola::proto::LTP, ack_check); + CPPUNIT_ASSERT(Universe::MERGE_LTP == universe->MergeMode()); +} + + +/* + * Call the SetMergeMode method + * @param impl the OlaServerServiceImpl to use + * @param universe_id the universe_id in the request + * @param mode the merge_mode to use + * @param check the SetMergeModeCheck to use for the callback check + */ +void OlaServerServiceImplTest::CallSetMergeMode( + OlaServerServiceImpl *impl, + int universe_id, + ola::proto::MergeMode merge_mode, + SetMergeModeCheck &check) { + SimpleRpcController *controller = new SimpleRpcController(); + ola::proto::MergeModeRequest *request = new + ola::proto::MergeModeRequest(); + ola::proto::Ack *response = new ola::proto::Ack(); + Closure *closure = NewCallback( + &check, + &SetMergeModeCheck::Check, + controller, + response); + + request->set_universe(universe_id); + request->set_merge_mode(merge_mode); + impl->SetMergeMode(controller, request, response, closure); + + delete controller; + delete request; + delete response; +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaServerTester.cpp b/open-lighting-architecture/ola-0.8.4/olad/OlaServerTester.cpp new file mode 100644 index 0000000..b9a6068 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaServerTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * OlaServerTester.cpp + * Runs all the Ola tests + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h b/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h new file mode 100644 index 0000000..3006fa7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h @@ -0,0 +1,29 @@ +/* + * 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 Library 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. + * + * OlaVersion.h + * Contains the build version as a string + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_OLAVERSION_H_ +#define OLAD_OLAVERSION_H_ + +namespace ola { + +static const char OLA_VERSION[] = "0.8.4"; + +} // ola +#endif // OLAD_OLAVERSION_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h.in b/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h.in new file mode 100644 index 0000000..a1b7900 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/OlaVersion.h.in @@ -0,0 +1,29 @@ +/* + * 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 Library 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. + * + * OlaVersion.h + * Contains the build version as a string + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_OLAVERSION_H_ +#define OLAD_OLAVERSION_H_ + +namespace ola { + +static const char OLA_VERSION[] = "@VERSION@"; + +} // ola +#endif // OLAD_OLAVERSION_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/Olad.cpp b/open-lighting-architecture/ola-0.8.4/olad/Olad.cpp new file mode 100644 index 0000000..eae243e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Olad.cpp @@ -0,0 +1,403 @@ +/* + * 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 Library 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. + * + * Olad.cpp + * Main file for olad, parses the options, forks if required and runs the + * daemon. + * Copyright (C) 2005-2007 Simon Newton + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/OlaDaemon.h" + +using ola::OlaDaemon; +using std::string; +using std::cout; +using std::endl; + +// the daemon +OlaDaemon *olad; + +// options struct +typedef struct { + ola::log_level level; + ola::log_output output; + bool daemon; + bool help; + int httpd; + int http_quit; + int http_port; + int rpc_port; + string http_data_dir; +} ola_options; + + +/* + * Print a stack trace on seg fault + */ +static void sig_segv(int signo) { + enum {STACK_SIZE = 64}; + void *array[STACK_SIZE]; + size_t size = backtrace(array, STACK_SIZE); + + cout << "Recieved SIGSEGV or SIGBUS" << endl; + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); + (void) signo; +} + +/* + * Terminate cleanly on interrupt + */ +static void sig_interupt(int signo) { + signo = 0; + olad->Terminate(); +} + +/* + * Reload plugins + */ +static void sig_hup(int signo) { + signo = 0; + olad->ReloadPlugins(); +} + +/* + * Change logging level + * + * need to fix race conditions here + */ +static void sig_user1(int signo) { + signo = 0; + ola::IncrementLogLevel(); +} + + + +/* + * Set up the interrupt signal + * + * @return true on success, false on failure + */ +static bool InstallSignals() { + struct sigaction act, oact; + + act.sa_handler = sig_interupt; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; + + if (sigaction(SIGINT, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGINT"; + return false; + } + + if (sigaction(SIGTERM, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGTERM"; + return false; + } + + act.sa_handler = sig_segv; + if (sigaction(SIGSEGV, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGSEGV"; + return false; + } + if (sigaction(SIGBUS, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGSEGV"; + return false; + } + + act.sa_handler = sig_hup; + + if (sigaction(SIGHUP, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGHUP"; + return false; + } + + act.sa_handler = sig_user1; + + if (sigaction(SIGUSR1, &act, &oact) < 0) { + OLA_WARN << "Failed to install signal SIGUSR1"; + return false; + } + return true; +} + + +/* + * Display the help message + */ +static void DisplayHelp() { + cout << + "Usage: olad [options]\n" + "\n" + "Start the ola daemon.\n" + "\n" + " -d, --http-data-dir Path to the static content.\n" + " -f, --daemon Fork into background.\n" + " -h, --help Display this help message and exit.\n" + " -l, --log-level Set the loggging level 0 .. 4 .\n" + " -p, --http-port Port to run the http server on (default " << + ola::OlaServer::DEFAULT_HTTP_PORT << ")\n" << + " -r, --rpc-port Port to listen for RPCs on (default " << + ola::OlaDaemon::DEFAULT_RPC_PORT << ")\n" << + " -s, --syslog Log to syslog rather than stderr.\n" + " --no-http Don't run the http server\n" + " --no-http-quit Disable the /quit handler\n" + << endl; +} + + +/* + * Parse the command line options + * + * @param argc + * @param argv + * @param opts pointer to the options struct + */ +static void ParseOptions(int argc, char *argv[], ola_options *opts) { + static struct option long_options[] = { + {"help", no_argument, 0, 'h'}, + {"http-data-dir", required_argument, 0, 'd'}, + {"http-port", required_argument, 0, 'p'}, + {"log-level", required_argument, 0, 'l'}, + {"no-daemon", no_argument, 0, 'f'}, + {"no-http", no_argument, &opts->httpd, 0}, + {"no-http-quit", no_argument, &opts->http_quit, 0}, + {"rpc-port", required_argument, 0, 'r'}, + {"syslog", no_argument, 0, 's'}, + {0, 0, 0, 0} + }; + + int c, ll; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "l:p:fd:hsr:", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->http_data_dir = optarg; + break; + case 'f': + opts->daemon = true; + break; + case 'h': + opts->help = true; + break; + case 's': + opts->output = ola::OLA_LOG_SYSLOG; + break; + case 'l': + ll = atoi(optarg); + switch (ll) { + case 0: + // nothing is written at this level + // so this turns logging off + opts->level = ola::OLA_LOG_NONE; + break; + case 1: + opts->level = ola::OLA_LOG_FATAL; + break; + case 2: + opts->level = ola::OLA_LOG_WARN; + break; + case 3: + opts->level = ola::OLA_LOG_INFO; + break; + case 4: + opts->level = ola::OLA_LOG_DEBUG; + break; + default : + break; + } + break; + case 'p': + opts->http_port = atoi(optarg); + break; + case 'r': + opts->rpc_port = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } +} + + +/* + * Run as a daemon + */ +static int Daemonise() { + pid_t pid; + unsigned int i; + int fd0, fd1, fd2; + struct rlimit rl; + struct sigaction sa; + + if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { + cout << "Could not determine file limit" << endl; + exit(1); + } + + // fork + if ((pid = fork()) < 0) { + cout << "Could not fork\n" << endl; + exit(1); + } else if (pid != 0) { + exit(0); + } + + // start a new session + setsid(); + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + + if (sigaction(SIGHUP, &sa, NULL) < 0) { + cout << "Could not install signal\n" << endl; + exit(1); + } + + if ((pid= fork()) < 0) { + cout << "Could not fork\n" << endl; + exit(1); + } else if (pid != 0) { + exit(0); + } + + // close all fds + if (rl.rlim_max == RLIM_INFINITY) + rl.rlim_max = 1024; + for (i = 0; i < rl.rlim_max; i++) + close(i); + + // send stdout, in and err to /dev/null + fd0 = open("/dev/null", O_RDWR); + fd1 = dup(0); + fd2 = dup(0); + + return 0; +} + + +/* + * Parse the options, and take action + * + * @param argc + * @param argv + * @param opts a pointer to the ola_options struct + */ +static void Setup(int argc, char*argv[], ola_options *opts) { + opts->level = ola::OLA_LOG_WARN; + opts->output = ola::OLA_LOG_STDERR; + opts->daemon = false; + opts->help = false; + opts->httpd = 1; + opts->http_quit = 1; + opts->http_port = ola::OlaServer::DEFAULT_HTTP_PORT; + opts->rpc_port = ola::OlaDaemon::DEFAULT_RPC_PORT; + opts->http_data_dir = ""; + + ParseOptions(argc, argv, opts); + + if (opts->help) { + DisplayHelp(); + exit(0); + } + + // setup the logging + ola::InitLogging(opts->level, opts->output); + + if (opts->daemon) + Daemonise(); +} + + +static void InitExportMap(ola::ExportMap *export_map, int argc, char*argv[]) { + struct rlimit rl; + ola::StringVariable *var = export_map->GetStringVar("binary"); + var->Set(argv[0]); + + var = export_map->GetStringVar("cmd-line"); + + std::stringstream out; + for (int i = 1; i < argc; i++) { + out << argv[i] << " "; + } + var->Set(out.str()); + + var = export_map->GetStringVar("fd-limit"); + if (getrlimit(RLIMIT_NOFILE, &rl) < 0) { + var->Set("undertermined"); + } else { + std::stringstream out; + out << rl.rlim_cur; + var->Set(out.str()); + } +} + +/* + * Main + * + */ +int main(int argc, char *argv[]) { + ola_options opts; + ola::ExportMap export_map; + Setup(argc, argv, &opts); + + if (!geteuid()) { + OLA_FATAL << "Attempting to run as root, aborting."; + return -1; + } + + InitExportMap(&export_map, argc, argv); + + if (!InstallSignals()) + OLA_WARN << "Failed to install signal handlers"; + + ola::ola_server_options ola_options; + ola_options.http_enable = opts.httpd; + ola_options.http_enable_quit = opts.http_quit; + ola_options.http_port = opts.http_port; + ola_options.http_data_dir = opts.http_data_dir; + + olad = new OlaDaemon(ola_options, &export_map, opts.rpc_port); + bool ret = olad->Init(); + + if (ret) { + olad->Run(); + } + delete olad; + return ret ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/Plugin.cpp b/open-lighting-architecture/ola-0.8.4/olad/Plugin.cpp new file mode 100644 index 0000000..3f97e47 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Plugin.cpp @@ -0,0 +1,108 @@ +/* + * 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 Library 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. + * + * Plugin.cpp + * Base plugin class for ola + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include "ola/Logging.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" + +namespace ola { + +const char Plugin::ENABLED_KEY[] = "enabled"; + +/* + * Returns true if we should try to start this plugin + */ +bool Plugin::ShouldStart() { + if (!LoadPreferences()) + return false; + + return !(m_preferences->GetValue(ENABLED_KEY) == "false"); +} + +/* + * Start the plugin. Calls start_hook() which can be over-ridden by the + * derrived classes. + * @returns true if started sucessfully, false otherwise. + */ +bool Plugin::Start() { + string enabled; + + if (m_enabled) + return false; + + // setup prefs + if (!LoadPreferences()) + return false; + + if (!StartHook()) { + return false; + } + + m_enabled = true; + return true; +} + + +/* + * Stop the plugin. Calls stop_hook which can be over-ridden by the + * derrived classes. + * + * @returns true if stopped sucessfully, false otherwise. + */ +bool Plugin::Stop() { + if (!m_enabled) + return false; + + bool ret = StopHook(); + + m_enabled = false; + return ret; +} + + +/* + * Load the preferences and set defaults + */ +bool Plugin::LoadPreferences() { + if (m_preferences) + return true; + + if (PluginPrefix() == "") { + OLA_WARN << Name() << ", no prefix provided"; + return false; + } + + m_preferences = m_plugin_adaptor->NewPreference(PluginPrefix()); + + if (!m_preferences) + return false; + + m_preferences->Load(); + + if (!SetDefaultPreferences()) { + OLA_INFO << Name() << ", SetDefaultPreferences failed"; + return false; + } + + return true; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PluginAdaptor.cpp b/open-lighting-architecture/ola-0.8.4/olad/PluginAdaptor.cpp new file mode 100644 index 0000000..920c443 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PluginAdaptor.cpp @@ -0,0 +1,153 @@ +/* + * 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 Library 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. + * + * PluginAdaptor.cpp + * Provides a wrapper for the DeviceManager and SelectServer objects so that + * the plugins can register devices and file handles for events + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include "olad/DeviceManager.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" + +namespace ola { + +using ola::network::SelectServer; + +/* + * Create a new PluginAdaptor + * @param device_manager pointer to a DeviceManager object + * @param select_server pointer to the SelectServer object + * @param preferences_factory pointer to the PreferencesFactory object + */ +PluginAdaptor::PluginAdaptor(DeviceManager *device_manager, + SelectServer *select_server, + PreferencesFactory *preferences_factory): + m_device_manager(device_manager), + m_ss(select_server), + m_preferences_factory(preferences_factory) { +} + + +/* + * Register a socket with the select server. + * @param socket the socket to register + * @return true on sucess, false on failure. + */ +bool PluginAdaptor::AddSocket(class Socket *socket) const { + return m_ss->AddSocket(socket); +} + +/* + * Register a connected socket with the select server. + * @param socket the socket to register + * @return true on sucess, false on failure. + */ +bool PluginAdaptor::AddSocket(class ConnectedSocket *socket, + bool delete_on_close) const { + return m_ss->AddSocket(socket, delete_on_close); +} + + +/* + * Remove a socket from the select server + */ +bool PluginAdaptor::RemoveSocket(class Socket *socket) const { + return m_ss->RemoveSocket(socket); +} + + +/* + * Remove a socket from the select server + */ +bool PluginAdaptor::RemoveSocket(class ConnectedSocket *socket) const { + return m_ss->RemoveSocket(socket); +} + + +/* + * Register a repeating timeout + * @param ms the time between function calls + * @param closure the OlaClosure to call when the timeout expires + * @return a timeout_id on success or K_INVALID_TIMEOUT on failure + */ +timeout_id PluginAdaptor::RegisterRepeatingTimeout( + unsigned int ms, + Closure *closure) const { + return m_ss->RegisterRepeatingTimeout(ms, closure); +} + + +/* + * Register a single timeout + * @param ms the time between function calls + * @param closure the OlaClosure to call when the timeout expires + * @return a timeout_id on success or K_INVALID_TIMEOUT on failure + */ +timeout_id PluginAdaptor::RegisterSingleTimeout( + unsigned int ms, + SingleUseClosure *closure) const { + return m_ss->RegisterSingleTimeout(ms, closure); +} + + +/* + * Remove a timeout + * @param id the id of the timeout to remove + */ +void PluginAdaptor::RemoveTimeout(timeout_id id) const { + m_ss->RemoveTimeout(id); +} + + +/* + * Register a device + * @param dev the device to register + * @return true on success, false on error + */ +bool PluginAdaptor::RegisterDevice(AbstractDevice *device) const { + return m_device_manager->RegisterDevice(device); +} + + +/* + * Unregister a device + * @param dev the device to unregister + * @return true on success, false on error + */ +bool PluginAdaptor::UnregisterDevice(AbstractDevice *device) const { + return m_device_manager->UnregisterDevice(device); +} + + +/* + * Create a new preferences container + * @return a Preferences object + */ +Preferences *PluginAdaptor::NewPreference(const string &name) const { + return m_preferences_factory->NewPreference(name); +} + + +/* + * Return the wake up time for the select server + * @return a TimeStamp object + */ +const TimeStamp *PluginAdaptor::WakeUpTime() const { + return m_ss->WakeUpTime(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PluginLoader.h b/open-lighting-architecture/ola-0.8.4/olad/PluginLoader.h new file mode 100644 index 0000000..8ed7f58 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PluginLoader.h @@ -0,0 +1,43 @@ +/* + * 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 Library 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. + * + * PluginLoader.h + * Interface for the PluginLoader classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_PLUGINLOADER_H_ +#define OLAD_PLUGINLOADER_H_ + +#include + +namespace ola { + +class PluginLoader { + public: + PluginLoader() {} + virtual ~PluginLoader() {} + + void SetPluginAdaptor(class PluginAdaptor *adaptor) { + m_plugin_adaptor = adaptor; + } + virtual std::vector LoadPlugins() = 0; + virtual void UnloadPlugins() = 0; + + protected: + class PluginAdaptor *m_plugin_adaptor; +}; +} // ola +#endif // OLAD_PLUGINLOADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/PluginManager.cpp b/open-lighting-architecture/ola-0.8.4/olad/PluginManager.cpp new file mode 100644 index 0000000..2e0fec2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PluginManager.cpp @@ -0,0 +1,126 @@ +/* + * 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 Library 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. + * + * PluginManager.cpp + * This class is responsible for loading and unloading the plugins + * Copyright (C) 2005-2007 Simon Newton + */ + +#include +#include "ola/Logging.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/PluginLoader.h" +#include "olad/PluginManager.h" + +namespace ola { + +using std::vector; + +PluginManager::PluginManager(const vector &plugin_loaders, + class PluginAdaptor *plugin_adaptor) + : m_plugin_loaders(plugin_loaders), + m_plugin_adaptor(plugin_adaptor) { +} + + +PluginManager::~PluginManager() { + UnloadAll(); +} + + +/* + * Load all the plugins and start them. + */ +void PluginManager::LoadAll() { + vector::iterator iter; + vector::iterator plugin_iter; + + for (iter = m_plugin_loaders.begin(); iter != m_plugin_loaders.end(); + ++iter) { + (*iter)->SetPluginAdaptor(m_plugin_adaptor); + vector plugins = (*iter)->LoadPlugins(); + + for (plugin_iter = plugins.begin(); plugin_iter != plugins.end(); + ++plugin_iter) { + if (GetPlugin((*plugin_iter)->Id())) + OLA_WARN << "Skipping plugin " << (*plugin_iter)->Name() << + " because it's already been loaded"; + else + m_plugins.push_back(*plugin_iter); + } + } + + for (plugin_iter = m_plugins.begin(); plugin_iter != m_plugins.end(); + ++plugin_iter) { + if (!(*plugin_iter)->ShouldStart()) { + OLA_INFO << "Skipping " << (*plugin_iter)->Name() << + " because it was disabled"; + continue; + } + + OLA_INFO << "Trying to start " << (*plugin_iter)->Name(); + if (!(*plugin_iter)->Start()) + OLA_WARN << "Failed to start " << (*plugin_iter)->Name(); + else + OLA_INFO << "Started " << (*plugin_iter)->Name(); + } +} + + +/* + * Unload all the plugins. + */ +void PluginManager::UnloadAll() { + vector::iterator iter; + vector::iterator plugin_iter; + + for (plugin_iter = m_plugins.begin(); plugin_iter != m_plugins.end(); + ++plugin_iter) { + (*plugin_iter)->Stop(); + delete *plugin_iter; + } + m_plugins.clear(); + + for (iter = m_plugin_loaders.begin(); iter != m_plugin_loaders.end(); + ++iter) { + (*iter)->SetPluginAdaptor(NULL); + (*iter)->UnloadPlugins(); + } +} + + +/* + * Return the list of plugins loaded + */ +void PluginManager::Plugins(vector *plugins) const { + *plugins = m_plugins; +} + + +/* + * Get a particular plugin + * @param plugin_id the id of the plugin to find + * @return the plugin matching the id or NULL if not found. + */ +AbstractPlugin* PluginManager::GetPlugin(ola_plugin_id plugin_id) const { + vector::const_iterator iter; + + for (iter = m_plugins.begin(); iter != m_plugins.end(); ++iter) + if ((*iter)->Id() == plugin_id) + return *iter; + return NULL; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PluginManager.h b/open-lighting-architecture/ola-0.8.4/olad/PluginManager.h new file mode 100644 index 0000000..9f51758 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PluginManager.h @@ -0,0 +1,54 @@ +/* + * 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 Library 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. + * + * PluginManager.h + * Interface to the PluginManager class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef OLAD_PLUGINMANAGER_H_ +#define OLAD_PLUGINMANAGER_H_ + +#include + +namespace ola { + +using std::vector; + +class PluginLoader; +class PluginAdaptor; +class AbstractPlugin; + +class PluginManager { + public: + PluginManager(const vector &plugin_loaders, + PluginAdaptor *plugin_adaptor); + ~PluginManager(); + + void LoadAll(); + void UnloadAll(); + void Plugins(vector *plugins) const; + AbstractPlugin* GetPlugin(ola_plugin_id plugin_id) const; + + private: + PluginManager(const PluginManager&); + PluginManager operator=(const PluginManager&); + + vector m_plugin_loaders; + PluginAdaptor *m_plugin_adaptor; + vector m_plugins; +}; +} // ola +#endif // OLAD_PLUGINMANAGER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/PluginManagerTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/PluginManagerTest.cpp new file mode 100644 index 0000000..a2aa05c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PluginManagerTest.cpp @@ -0,0 +1,111 @@ +/* + * 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 Library 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. + * + * PluginManagerTest.cpp + * Test fixture for the PluginManager classes + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/PluginLoader.h" +#include "olad/PluginManager.h" +#include "olad/Preferences.h" +#include "olad/TestCommon.h" + +using ola::AbstractPlugin; +using ola::PluginLoader; +using ola::PluginManager; +using std::string; +using std::vector; + + +class PluginManagerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(PluginManagerTest); + CPPUNIT_TEST(testPluginManager); + CPPUNIT_TEST_SUITE_END(); + + public: + void testPluginManager(); + + private: +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(PluginManagerTest); + +/* + * A Mock Loader + */ +class MockLoader: public ola::PluginLoader { + public: + MockLoader(): + PluginLoader() { + } + + vector LoadPlugins() { + m_plugins.push_back(new TestMockPlugin(m_plugin_adaptor, + ola::OLA_PLUGIN_ARTNET)); + m_plugins.push_back(new TestMockPlugin(m_plugin_adaptor, + ola::OLA_PLUGIN_ESPNET, + false)); + vector plugins; + vector::iterator iter; + for (iter = m_plugins.begin(); iter != m_plugins.end(); ++iter) + plugins.push_back(*iter); + return plugins; + } + void UnloadPlugins() {} + + void VerifyStartStates() { + CPPUNIT_ASSERT_EQUAL((size_t) 2, m_plugins.size()); + CPPUNIT_ASSERT(m_plugins[0]->WasStarted()); + CPPUNIT_ASSERT(!m_plugins[1]->WasStarted()); + } + + private: + vector m_plugins; +}; + + +/* + * Check that we can load & unload plugins correctly. + */ +void PluginManagerTest::testPluginManager() { + vector loaders; + MockLoader loader; + loaders.push_back(&loader); + + ola::MemoryPreferencesFactory factory; + ola::PluginAdaptor adaptor(NULL, NULL, &factory); + PluginManager manager(loaders, &adaptor); + + manager.LoadAll(); + vector plugins; + manager.Plugins(&plugins); + CPPUNIT_ASSERT_EQUAL((size_t) 2, plugins.size()); + CPPUNIT_ASSERT_EQUAL(string("foo"), plugins[0]->Name()); + CPPUNIT_ASSERT_EQUAL(string("foo"), plugins[1]->Name()); + + loader.VerifyStartStates(); + + manager.UnloadAll(); + manager.Plugins(&plugins); + CPPUNIT_ASSERT_EQUAL((size_t) 0, plugins.size()); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/Port.cpp b/open-lighting-architecture/ola-0.8.4/olad/Port.cpp new file mode 100644 index 0000000..e943057 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Port.cpp @@ -0,0 +1,240 @@ +/* + * 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 Library 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. + * + * Port.cpp + * Base implementation of the Port class. + * Copyright (C) 2005-2009 Simon Newton + * + * Unfortunately this file contains a lot of code duplication. + */ + +#include +#include "ola/Logging.h" +#include "olad/Device.h" +#include "olad/Port.h" + +namespace ola { + +/* + * Create a new basic input port + */ +BasicInputPort::BasicInputPort(AbstractDevice *parent, + unsigned int port_id, + const TimeStamp *wake_time): + m_port_id(port_id), + m_priority(DmxSource::PRIORITY_DEFAULT), + m_priority_mode(PRIORITY_MODE_INHERIT), + m_port_string(""), + m_universe(NULL), + m_device(parent), + m_wakeup_time(wake_time) { +} + + +bool BasicInputPort::SetUniverse(Universe *new_universe) { + Universe *old_universe = GetUniverse(); + if (old_universe == new_universe) + return true; + + if (PreSetUniverse(old_universe, new_universe)) { + m_universe = new_universe; + PostSetUniverse(old_universe, new_universe); + return true; + } + return false; +} + + +string BasicInputPort::UniqueId() const { + if (m_port_string.empty()) { + std::stringstream str; + if (m_device) + str << m_device->UniqueId() << "-I-" << m_port_id; + m_port_string = str.str(); + } + return m_port_string; +} + + + +bool BasicInputPort::SetPriority(uint8_t priority) { + if (priority > DmxSource::PRIORITY_MAX) + return false; + + m_priority = priority; + return true; +} + + +/* + * Called when there is new data for this port + */ +void BasicInputPort::DmxChanged() { + if (GetUniverse()) { + const DmxBuffer &buffer = ReadDMX(); + uint8_t priority = (PriorityCapability() == CAPABILITY_FULL && + GetPriorityMode() == PRIORITY_MODE_INHERIT ? + InheritedPriority() : + GetPriority()); + m_dmx_source.UpdateData(buffer, *m_wakeup_time, priority); + GetUniverse()->PortDataChanged(this); + } +} + + +/* + * Handle an RDM Request on this port. + * @param request the RDMRequest object, ownership is transferred to us + */ +bool BasicInputPort::HandleRDMRequest(const ola::rdm::RDMRequest *request) { + if (m_universe) + return m_universe->HandleRDMRequest(this, request); + else + delete request; + return false; +} + + +/* + * Handle a response message + * @param response, the RDMResponse object, ownership is transferred to us + */ +bool BasicInputPort::HandleRDMResponse( + const ola::rdm::RDMResponse *response) { + OLA_WARN << "In base HandleRDMResponse, something has gone wrong with RDM" << + " request routing"; + delete response; + return true; +} + + +/* + * Trigger the RDM Discovery procedure for this universe + */ +void BasicInputPort::TriggerRDMDiscovery() { + if (m_universe) + m_universe->RunRDMDiscovery(); +} + + +void BasicOutputPort::NewUIDList(const ola::rdm::UIDSet &uids) { + if (m_universe) + m_universe->NewUIDList(uids, this); +} + + +/* + * Create a new BasicOutputPort + */ +BasicOutputPort::BasicOutputPort(AbstractDevice *parent, + unsigned int port_id, + bool start_rdm_discovery_on_patch): + m_port_id(port_id), + m_discover_on_patch(start_rdm_discovery_on_patch), + m_priority(DmxSource::PRIORITY_DEFAULT), + m_priority_mode(PRIORITY_MODE_INHERIT), + m_port_string(""), + m_universe(NULL), + m_device(parent) { +} + + +bool BasicOutputPort::SetUniverse(Universe *new_universe) { + Universe *old_universe = GetUniverse(); + if (old_universe == new_universe) + return true; + + if (PreSetUniverse(old_universe, new_universe)) { + m_universe = new_universe; + PostSetUniverse(old_universe, new_universe); + if (m_discover_on_patch) + RunRDMDiscovery(); + return true; + } + return false; +} + + +string BasicOutputPort::UniqueId() const { + if (m_port_string.empty()) { + std::stringstream str; + if (m_device) + str << m_device->UniqueId() << "-O-" << m_port_id; + m_port_string = str.str(); + } + return m_port_string; +} + + +bool BasicOutputPort::SetPriority(uint8_t priority) { + if (priority > DmxSource::PRIORITY_MAX) + return false; + + m_priority = priority; + return true; +} + + +/* + * Handle an RDMRequest, subclasses can implement this to support RDM + */ +bool BasicOutputPort::HandleRDMRequest(const ola::rdm::RDMRequest *request) { + // broadcasts go to every port + if (!request->DestinationUID().IsBroadcast()) + OLA_WARN << "In base HandleRDMRequest, something has gone wrong with RDM" + << " request routing"; + delete request; + return true; +} + + +/* + * Handle a response message + */ +bool BasicOutputPort::HandleRDMResponse( + const ola::rdm::RDMResponse *response) { + if (m_universe) + return m_universe->HandleRDMResponse(this, response); + else + delete response; + return false; +} + + +/* + * This is a noop for ports that don't support RDM + */ +void BasicOutputPort::RunRDMDiscovery() { +} + + +/* + * This allows switching based on Port type. + */ +template +bool IsInputPort() { + return true; +} + +template<> +bool IsInputPort() { + return false; +} + +template<> +bool IsInputPort() { + return true; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PortManager.cpp b/open-lighting-architecture/ola-0.8.4/olad/PortManager.cpp new file mode 100644 index 0000000..73ecc99 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PortManager.cpp @@ -0,0 +1,244 @@ +/* + * 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 Library 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. + * + * PortManager.cpp + * Enables the Patching of Ports + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/PortManager.h" +#include "olad/Port.h" + +namespace ola { + +/* + * Patch a port + * @param port the port to patch + * @param universe the universe to patch to + * @returns true is successful, false otherwise + */ +bool PortManager::PatchPort(InputPort *port, + unsigned int universe) { + return GenericPatchPort(port, universe); +} + + +/* + * Patch a port + * @param port the port to patch + * @param universe the universe to patch to + * @returns true is successful, false otherwise + */ +bool PortManager::PatchPort(OutputPort *port, + unsigned int universe) { + return GenericPatchPort(port, universe); +} + + +/* + * UnPatch a port + * @param port the port to unpatch + * @returns true is successful, false otherwise + */ +bool PortManager::UnPatchPort(InputPort *port) { + return GenericUnPatchPort(port); +} + + +/* + * UnPatch a port + * @param port the port to unpatch + * @returns true is successful, false otherwise + */ +bool PortManager::UnPatchPort(OutputPort *port) { + return GenericUnPatchPort(port); +} + + +/* + * Set a port to inherit priority mode. + * @param port the port to configure + */ +bool PortManager::SetPriorityInherit(Port *port) { + if (port->PriorityCapability() == CAPABILITY_NONE) + return true; + + if (port->GetPriorityMode() != PRIORITY_MODE_INHERIT) + port->SetPriorityMode(PRIORITY_MODE_INHERIT); + return true; +} + + +/* + * Set a port to override priority mode. + * @param port the port to configure + * @param value the new priority + */ +bool PortManager::SetPriorityOverride(Port *port, uint8_t value) { + if (port->PriorityCapability() == CAPABILITY_NONE) + return true; + + if (port->PriorityCapability() == CAPABILITY_FULL && + port->GetPriorityMode() != PRIORITY_MODE_OVERRIDE) + port->SetPriorityMode(PRIORITY_MODE_OVERRIDE); + + if (value > DmxSource::PRIORITY_MAX) { + OLA_WARN << "Priority " << value << + " is greater than the max priority (" << DmxSource::PRIORITY_MAX << ")"; + value = DmxSource::PRIORITY_MAX; + } + + if (port->GetPriority() != value) + port->SetPriority(value); + return true; +} + + +template +bool PortManager::GenericPatchPort(PortClass *port, + unsigned int new_universe_id) { + if (!port) + return false; + + Universe *universe = port->GetUniverse(); + if (universe && universe->UniverseId() == new_universe_id) + return true; + + AbstractDevice *device = port->GetDevice(); + if (device) { + if (!device->AllowLooping()) { + // check ports of the opposite type + if (CheckLooping(device, new_universe_id)) + return false; + } + + if (!device->AllowMultiPortPatching()) { + if (CheckMultiPort(device, new_universe_id)) + return false; + } + } + + // unpatch if required + if (universe) { + OLA_DEBUG << "Port " << port->UniqueId() << " is bound to universe " << + universe->UniverseId(); + universe->RemovePort(port); + } + + universe = m_universe_store->GetUniverseOrCreate(new_universe_id); + if (!universe) + return false; + + OLA_INFO << "Patched " << port->UniqueId() << " to universe " << + universe->UniverseId(); + universe->AddPort(port); + port->SetUniverse(universe); + return true; +} + + +template +bool PortManager::GenericUnPatchPort(PortClass *port) { + if (!port) + return false; + + Universe *universe = port->GetUniverse(); + if (universe) { + universe->RemovePort(port); + port->SetUniverse(NULL); + OLA_DEBUG << "Port " << port->UniqueId() << " has been removed from uni " + << universe->UniverseId(); + } + return true; +} + + +template +bool PortManager::CheckLooping(const AbstractDevice *device, + unsigned int new_universe_id) const { + return CheckOutputPortsForUniverse(device, new_universe_id); +} + +template <> +bool PortManager::CheckLooping( + const AbstractDevice *device, + unsigned int new_universe_id) const { + return CheckInputPortsForUniverse(device, new_universe_id); +} + + +template +bool PortManager::CheckMultiPort(const AbstractDevice *device, + unsigned int new_universe_id) const { + return CheckInputPortsForUniverse(device, new_universe_id); +} + + +template <> +bool PortManager::CheckMultiPort( + const AbstractDevice *device, + unsigned int new_universe_id) const { + return CheckOutputPortsForUniverse(device, new_universe_id); +} + + +/* + * Check if any input ports in this device are bound to the universe. + * @returns true if there is a match, false otherwise. + */ +bool PortManager::CheckInputPortsForUniverse(const AbstractDevice *device, + unsigned int universe_id) const { + vector ports; + device->InputPorts(&ports); + return CheckForPortMatchingUniverse(ports, universe_id); +} + + +/* + * Check if any output ports in this device are bound to the universe. + * @returns true if there is a match, false otherwise. + */ +bool PortManager::CheckOutputPortsForUniverse(const AbstractDevice *device, + unsigned int universe_id) const { + vector ports; + device->OutputPorts(&ports); + return CheckForPortMatchingUniverse(ports, universe_id); +} + + +/* + * Check for any port in a list that's bound to this universe. + * @returns true if there is a match, false otherwise. + */ +template +bool PortManager::CheckForPortMatchingUniverse( + const vector &ports, + unsigned int universe_id) const { + typename vector::const_iterator iter; + for (iter = ports.begin(); iter != ports.end(); ++iter) { + if ((*iter)->GetUniverse() && + (*iter)->GetUniverse()->UniverseId() == universe_id) { + OLA_INFO << "Port " << (*iter)->PortId() << " is already patched to " + << universe_id; + return true; + } + } + return false; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PortManager.h b/open-lighting-architecture/ola-0.8.4/olad/PortManager.h new file mode 100644 index 0000000..2be760a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PortManager.h @@ -0,0 +1,79 @@ +/* + * 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 Library 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. + * + * PortManager.h + * Provides a unified interface for controlling port patchings & priorities. + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef OLAD_PORTMANAGER_H_ +#define OLAD_PORTMANAGER_H_ + +#include +#include +#include "olad/Device.h" +#include "olad/DeviceManager.h" +#include "olad/UniverseStore.h" + + +namespace ola { + +class PortManager { + public: + explicit PortManager(UniverseStore *universe_store) + : m_universe_store(universe_store) { + } + ~PortManager() {} + + bool PatchPort(InputPort *port, unsigned int universe); + bool PatchPort(OutputPort *port, unsigned int universe); + bool UnPatchPort(InputPort *port); + bool UnPatchPort(OutputPort *port); + + bool SetPriorityInherit(Port *port); + bool SetPriorityOverride(Port *port, uint8_t value); + + private: + PortManager(const PortManager&); + PortManager& operator=(const PortManager&); + + template + bool GenericPatchPort(PortClass *port, + unsigned int new_universe_id); + + template + bool GenericUnPatchPort(PortClass *port); + + template + bool CheckLooping(const AbstractDevice *device, + unsigned int new_universe_id) const; + + template + bool CheckMultiPort(const AbstractDevice *device, + unsigned int new_universe_id) const; + + bool CheckInputPortsForUniverse(const AbstractDevice *device, + unsigned int universe_id) const; + bool CheckOutputPortsForUniverse(const AbstractDevice *device, + unsigned int universe_id) const; + + template + bool CheckForPortMatchingUniverse(const vector &ports, + unsigned int universe_id) const; + + UniverseStore * const m_universe_store; +}; +} // ola +#endif // OLAD_PORTMANAGER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/PortManagerTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/PortManagerTest.cpp new file mode 100644 index 0000000..5bb8b5d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PortManagerTest.cpp @@ -0,0 +1,309 @@ +/* + * 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 Library 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. + * + * PortManagerTest.cpp + * Test fixture for the PortManager classes + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include + +#include "olad/DmxSource.h" +#include "olad/PortManager.h" +#include "olad/UniverseStore.h" +#include "olad/TestCommon.h" + +using ola::DmxSource; +using ola::PortManager; +using ola::Port; +using ola::Universe; +using std::string; + + +class PortManagerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(PortManagerTest); + CPPUNIT_TEST(testPortPatching); + CPPUNIT_TEST(testPortPatchingLoopMulti); + CPPUNIT_TEST(testInputPortSetPriority); + CPPUNIT_TEST(testOutputPortSetPriority); + CPPUNIT_TEST_SUITE_END(); + + public: + void testPortPatching(); + void testPortPatchingLoopMulti(); + void testInputPortSetPriority(); + void testOutputPortSetPriority(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(PortManagerTest); + + + +/* + * Check that we can patch ports correctly. + */ +void PortManagerTest::testPortPatching() { + ola::UniverseStore uni_store(NULL, NULL); + PortManager port_manager(&uni_store); + + // mock device, this doesn't allow looping or multiport patching + MockDevice device1(NULL, "test_device_1"); + TestMockInputPort input_port(&device1, 1, NULL); + TestMockInputPort input_port2(&device1, 2, NULL); + TestMockOutputPort output_port(&device1, 1); + TestMockOutputPort output_port2(&device1, 2); + device1.AddPort(&input_port); + device1.AddPort(&input_port2); + device1.AddPort(&output_port); + device1.AddPort(&output_port2); + + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // simple patching + CPPUNIT_ASSERT(port_manager.PatchPort(&input_port, 1)); + CPPUNIT_ASSERT(port_manager.PatchPort(&output_port, 2)); + CPPUNIT_ASSERT(input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, + input_port.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT(output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, + output_port.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // test looping + CPPUNIT_ASSERT(!port_manager.PatchPort(&input_port2, 2)); + CPPUNIT_ASSERT(!port_manager.PatchPort(&output_port2, 1)); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // test multiport + CPPUNIT_ASSERT(!port_manager.PatchPort(&input_port2, 1)); + CPPUNIT_ASSERT(!port_manager.PatchPort(&output_port2, 2)); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // test repatching + CPPUNIT_ASSERT(port_manager.PatchPort(&input_port, 3)); + CPPUNIT_ASSERT(port_manager.PatchPort(&output_port, 4)); + CPPUNIT_ASSERT(input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 3, + input_port.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT(output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, + output_port.GetUniverse()->UniverseId()); + + // test unpatching + CPPUNIT_ASSERT(port_manager.UnPatchPort(&input_port)); + CPPUNIT_ASSERT(port_manager.UnPatchPort(&input_port2)); + CPPUNIT_ASSERT(port_manager.UnPatchPort(&output_port)); + CPPUNIT_ASSERT(port_manager.UnPatchPort(&output_port2)); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); +} + + +/* + * test that patching works correctly for devices with looping and multiport + * patching enabled. + */ +void PortManagerTest::testPortPatchingLoopMulti() { + ola::UniverseStore uni_store(NULL, NULL); + PortManager port_manager(&uni_store); + + // mock device that allows looping and multi port patching + MockDeviceLoopAndMulti device1(NULL, "test_device_1"); + TestMockInputPort input_port(&device1, 1, NULL); + TestMockInputPort input_port2(&device1, 2, NULL); + TestMockOutputPort output_port(&device1, 1); + TestMockOutputPort output_port2(&device1, 2); + device1.AddPort(&input_port); + device1.AddPort(&input_port2); + device1.AddPort(&output_port); + device1.AddPort(&output_port2); + + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // simple patching + CPPUNIT_ASSERT(port_manager.PatchPort(&input_port, 1)); + CPPUNIT_ASSERT(port_manager.PatchPort(&output_port, 2)); + CPPUNIT_ASSERT(input_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, + input_port.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + input_port2.GetUniverse()); + CPPUNIT_ASSERT(output_port.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, + output_port.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT_EQUAL(static_cast(NULL), + output_port2.GetUniverse()); + + // test looping + CPPUNIT_ASSERT(port_manager.PatchPort(&input_port2, 2)); + CPPUNIT_ASSERT(port_manager.PatchPort(&output_port2, 1)); + CPPUNIT_ASSERT(input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, + input_port2.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT(output_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, + output_port2.GetUniverse()->UniverseId()); + + // test multiport + CPPUNIT_ASSERT(port_manager.PatchPort(&input_port2, 1)); + CPPUNIT_ASSERT(port_manager.PatchPort(&output_port2, 2)); + CPPUNIT_ASSERT(input_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, + input_port2.GetUniverse()->UniverseId()); + CPPUNIT_ASSERT(output_port2.GetUniverse()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, + output_port2.GetUniverse()->UniverseId()); +} + + +/* + * Check that we can set priorities on an input port + */ +void PortManagerTest::testInputPortSetPriority() { + PortManager patcher(NULL); // we're not testing patching so pass NULL here + + // Input port that doesn't support priorities + TestMockInputPort input_port(NULL, 0, NULL); + + CPPUNIT_ASSERT_EQUAL(input_port.PriorityCapability(), + ola::CAPABILITY_STATIC); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // this port doesn't support priorities so this is a noop + CPPUNIT_ASSERT(patcher.SetPriorityInherit(&input_port)); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // set the static priority to 20 + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&input_port, 20)); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(input_port.GetPriority(), (uint8_t) 20); + + // Now test an input port that does support priorities + TestMockPriorityInputPort input_port2(NULL, 1, NULL); + CPPUNIT_ASSERT_EQUAL(input_port2.PriorityCapability(), + ola::CAPABILITY_FULL); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // try changing to override mode + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&input_port2, 20)); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriorityMode(), + ola::PRIORITY_MODE_OVERRIDE); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriority(), (uint8_t) 20); + + // bump priority + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&input_port2, 180)); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriorityMode(), + ola::PRIORITY_MODE_OVERRIDE); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriority(), (uint8_t) 180); + + // change back to inherit mode + CPPUNIT_ASSERT(patcher.SetPriorityInherit(&input_port2)); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(input_port2.GetPriority(), (uint8_t) 180); +} + + +/* + * Check that we can set priorities on an Output port + */ +void PortManagerTest::testOutputPortSetPriority() { + PortManager patcher(NULL); // we're not testing patching so pass NULL here + + // Input port that doesn't support priorities + TestMockOutputPort output_port(NULL, 0); + + CPPUNIT_ASSERT_EQUAL(output_port.PriorityCapability(), + ola::CAPABILITY_NONE); + CPPUNIT_ASSERT_EQUAL(output_port.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(output_port.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // this port doesn't support priorities so these are all noops + CPPUNIT_ASSERT(patcher.SetPriorityInherit(&output_port)); + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&output_port, 20)); + CPPUNIT_ASSERT_EQUAL(output_port.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(output_port.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // now test an output port that supports priorities + TestMockPriorityOutputPort output_port2(NULL, 1); + + CPPUNIT_ASSERT_EQUAL(output_port2.PriorityCapability(), + ola::CAPABILITY_FULL); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriority(), + DmxSource::PRIORITY_DEFAULT); + + // try changing to static mode + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&output_port2, 20)); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriorityMode(), + ola::PRIORITY_MODE_OVERRIDE); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriority(), (uint8_t) 20); + + // bump priority + CPPUNIT_ASSERT(patcher.SetPriorityOverride(&output_port2, 180)); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriorityMode(), + ola::PRIORITY_MODE_OVERRIDE); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriority(), (uint8_t) 180); + + // change back to inherit mode + CPPUNIT_ASSERT(patcher.SetPriorityInherit(&output_port2)); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriorityMode(), + ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(output_port2.GetPriority(), (uint8_t) 180); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/PortTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/PortTest.cpp new file mode 100644 index 0000000..35442a2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PortTest.cpp @@ -0,0 +1,145 @@ +/* + * 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 Library 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. + * + * PortTest.cpp + * Test fixture for the Port classes + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include + +#include "olad/TestCommon.h" +#include "olad/Preferences.h" +#include "olad/UniverseStore.h" + +using ola::Clock; +using ola::TimeStamp; + +class PortTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(PortTest); + CPPUNIT_TEST(testOutputPortPriorities); + CPPUNIT_TEST(testInputPortPriorities); + CPPUNIT_TEST_SUITE_END(); + + public: + void testOutputPortPriorities(); + void testInputPortPriorities(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(PortTest); + + +/* + * Check that we can set the priority & mode of output ports + */ +void PortTest::testOutputPortPriorities() { + TestMockOutputPort output_port(NULL, 1); + + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + output_port.GetPriority()); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + output_port.GetPriorityMode()); + + // test the setting of priorities + CPPUNIT_ASSERT(output_port.SetPriority(120)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 120, output_port.GetPriority()); + CPPUNIT_ASSERT(!output_port.SetPriority(201)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 120, output_port.GetPriority()); + CPPUNIT_ASSERT(output_port.SetPriority(0)); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, output_port.GetPriority()); + + // test the setting of modes + output_port.SetPriorityMode(ola::PRIORITY_MODE_OVERRIDE); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_OVERRIDE, + output_port.GetPriorityMode()); + + output_port.SetPriorityMode(ola::PRIORITY_MODE_INHERIT); + CPPUNIT_ASSERT_EQUAL(ola::PRIORITY_MODE_INHERIT, + output_port.GetPriorityMode()); +} + + +/* + * Test that we can set the priorities & modes of input ports + */ +void PortTest::testInputPortPriorities() { + unsigned int universe_id = 1; + ola::MemoryPreferences preferences("foo"); + ola::UniverseStore store(&preferences, NULL); + ola::PortManager port_manager(&store); + + MockDevice device(NULL, "foo"); + TimeStamp time_stamp; + // This port operates in static priority mode + TestMockInputPort input_port(&device, 1, &time_stamp); + port_manager.PatchPort(&input_port, universe_id); + + ola::DmxBuffer buffer("foo bar baz"); + Clock::CurrentTime(&time_stamp); + input_port.WriteDMX(buffer); + input_port.DmxChanged(); + + ola::Universe *universe = store.GetUniverseOrCreate(universe_id); + CPPUNIT_ASSERT(universe); + + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + + // change the priority + uint8_t new_priority = 120; + port_manager.SetPriorityOverride(&input_port, new_priority); + + Clock::CurrentTime(&time_stamp); + input_port.WriteDMX(buffer); + input_port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); + + new_priority = 0; + port_manager.SetPriorityOverride(&input_port, new_priority); + + Clock::CurrentTime(&time_stamp); + input_port.WriteDMX(buffer); + input_port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); + port_manager.UnPatchPort(&input_port); + + // now try a port that supported priorities + TestMockPriorityInputPort input_port2(&device, 2, &time_stamp); + port_manager.PatchPort(&input_port2, universe_id); + + // the default mode is inherit + input_port2.SetInheritedPriority(99); + Clock::CurrentTime(&time_stamp); + input_port2.WriteDMX(buffer); + input_port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL((uint8_t) 99, universe->ActivePriority()); + + input_port2.SetInheritedPriority(123); + Clock::CurrentTime(&time_stamp); + input_port2.WriteDMX(buffer); + input_port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL((uint8_t) 123, universe->ActivePriority()); + + // now try override mode + new_priority = 108; + port_manager.SetPriorityOverride(&input_port2, new_priority); + Clock::CurrentTime(&time_stamp); + input_port2.WriteDMX(buffer); + input_port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/Preferences.cpp b/open-lighting-architecture/ola-0.8.4/olad/Preferences.cpp new file mode 100644 index 0000000..ebf150d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Preferences.cpp @@ -0,0 +1,398 @@ +/* + * 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 Library 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. + * + * Preferences.cpp + * This class stores preferences in files + * Copyright (C) 2005-2008 Simon Newton + */ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/Preferences.h" + +namespace ola { + +using std::ifstream; +using std::ofstream; +using std::pair; + +const char BoolValidator::TRUE[] = "true"; +const char BoolValidator::FALSE[] = "false"; + +const char FileBackedPreferences::OLA_CONFIG_DIR[] = ".ola"; +const char FileBackedPreferences::OLA_CONFIG_PREFIX[] = "ola-"; +const char FileBackedPreferences::OLA_CONFIG_SUFFIX[] = ".conf"; + +// Validators +//----------------------------------------------------------------------------- + +bool StringValidator::IsValid(const string &value) const { + return !value.empty(); +} + + +bool BoolValidator::IsValid(const string &value) const { + return (value == TRUE || value == FALSE); +} + + +bool IntValidator::IsValid(const string &value) const { + unsigned int output; + if (!StringToUInt(value, &output)) + return false; + + return (output >= m_gt && output <= m_lt); +} + + +bool SetValidator::IsValid(const string &value) const { + return m_values.end() != m_values.find(value); +} + + +bool IPv4Validator::IsValid(const string &value) const { + if (value.empty()) + return m_empty_ok; + + vector tokens; + StringSplit(value, tokens, "."); + if (tokens.size() != 4) + return false; + + for (unsigned int i = 0 ; i < 4; i++) { + unsigned int octet; + if (!StringToUInt(tokens[i], &octet)) + return false; + if (octet > 255) + return false; + } + return true; +} + + +// Prefs Factory +//----------------------------------------------------------------------------- + +/** + * Cleanup + */ +PreferencesFactory::~PreferencesFactory() { + map::const_iterator iter; + for (iter = m_preferences_map.begin(); iter != m_preferences_map.end(); + ++iter) { + delete iter->second; + } + m_preferences_map.clear(); +} + + +/** + * Lookup a preference object + */ +Preferences *PreferencesFactory::NewPreference(const string &name) { + map::iterator iter = m_preferences_map.find(name); + if (iter == m_preferences_map.end()) { + Preferences *pref = Create(name); + m_preferences_map.insert(pair(name, pref)); + return pref; + } else { + return iter->second; + } +} + + +// Memory Preferences +//----------------------------------------------------------------------------- + +/* + * Destroy this object + */ +MemoryPreferences::~MemoryPreferences() { + m_pref_map.clear(); +} + + +/* + * Clear the preferences + */ +void MemoryPreferences::Clear() { + m_pref_map.clear(); +} + + +/* + * Set a preference value, overiding the existing value. + * @param key + * @param value + */ +void MemoryPreferences::SetValue(const string &key, const string &value) { + m_pref_map.erase(key); + m_pref_map.insert(pair(key, value)); +} + + +/* + * Adds this preference value to the store + * @param key + * @param value + */ +void MemoryPreferences::SetMultipleValue(const string &key, + const string &value) { + m_pref_map.insert(pair(key, value)); +} + + +/* + * Set a preference value only if it doesn't pass the validator. + * Note this only checks the first value. + * @param key + * @param validator A Validator object + * @param value the new value + * @return true if we set the value, false if it already existed + */ +bool MemoryPreferences::SetDefaultValue(const string &key, + const Validator &validator, + const string &value) { + map::const_iterator iter; + iter = m_pref_map.find(key); + + if (iter == m_pref_map.end() || !validator.IsValid(iter->second)) { + SetValue(key, value); + return true; + } + return false; +} + + +/* + * Get a preference value + * @param key the key to fetch + * @return the value corrosponding to key, or the empty string if the key + * doesn't exist. + */ +string MemoryPreferences::GetValue(const string &key) const { + map::const_iterator iter; + iter = m_pref_map.find(key); + + if (iter != m_pref_map.end()) + return iter->second; + return ""; +} + + +/* + * Returns all preference values corrosponding to this key + * @returns a vector of strings. + */ +vector MemoryPreferences::GetMultipleValue(const string &key) const { + vector values; + map::const_iterator iter; + + for (iter = m_pref_map.find(key); + iter != m_pref_map.end() && iter->first == key; ++iter) { + values.push_back(iter->second); + } + return values; +} + + +/* + * Remove a preference value. + * @param key + */ +void MemoryPreferences::RemoveValue(const string &key) { + m_pref_map.erase(key); +} + + +/* + * Set a value as a bool. + * @param key + * @param value + */ +void MemoryPreferences::SetValueAsBool(const string &key, bool value) { + m_pref_map.erase(key); + if (value) + m_pref_map.insert(pair(key, BoolValidator::TRUE)); + else + m_pref_map.insert(pair(key, BoolValidator::FALSE)); +} + + +/* + * Get a preference value as a bool + * @param key the key to fetch + * @return true if the value is 'true' or false otherwise + */ +bool MemoryPreferences::GetValueAsBool(const string &key) const { + map::const_iterator iter; + iter = m_pref_map.find(key); + + if (iter != m_pref_map.end()) + return iter->second == BoolValidator::TRUE; + return false; +} + + +// FileBackedPreferences +//----------------------------------------------------------------------------- + +/* + * Load the preferences from storage + */ +bool FileBackedPreferences::Load() { + if (!ChangeDir()) + return false; + return LoadFromFile(FileName()); +} + + +/* + * Save the preferences to storage + */ +bool FileBackedPreferences::Save() const { + if (!ChangeDir()) + return false; + + return SaveToFile(FileName()); +} + + +/* + * Return the name of the file used to save the preferences + */ +const string FileBackedPreferences::FileName() const { + return OLA_CONFIG_PREFIX + m_preference_name + OLA_CONFIG_SUFFIX; +} + + +/* + * Load these preferences from a file + * @param filename the filename to load from + */ +bool FileBackedPreferences::LoadFromFile(const string &filename) { + ifstream pref_file(filename.data()); + + if (!pref_file.is_open()) { + OLA_INFO << "Missing " << filename << ": " << strerror(errno) << + " - this isn't an error, we'll just use the defaults"; + return false; + } + + m_pref_map.clear(); + string line; + while (getline(pref_file, line)) { + StringTrim(&line); + + if (line.empty() || line.at(0) == '#') + continue; + + vector tokens; + StringSplit(line, tokens, "="); + + if (tokens.size() != 2) { + OLA_INFO << "Skipping line: " << line; + continue; + } + + string key = tokens[0]; + string value = tokens[1]; + StringTrim(&key); + StringTrim(&value); + m_pref_map.insert(pair(key, value)); + } + pref_file.close(); + return true; +} + + +/* + * Save the preferences to a file + * @param filename - the name of the file to save to + */ +bool FileBackedPreferences::SaveToFile(const string &filename) const { + map::const_iterator iter; + ofstream pref_file(filename.data()); + + if (!pref_file.is_open()) { + OLA_INFO << "Missing " << filename << ": " << strerror(errno); + return false; + } + + for (iter = m_pref_map.begin(); iter != m_pref_map.end(); ++iter) { + pref_file << iter->first << " = " << iter->second << std::endl; + } + + pref_file.close(); + return true; +} + + +/* + * Change to the ola preferences directory + */ +bool FileBackedPreferences::ChangeDir() const { + struct passwd pwd, *pwd_ptr; + unsigned int size = 1024; + bool ok = false; + char *buffer; + + while (!ok) { + buffer = new char[size]; + int ret = getpwuid_r(getuid(), &pwd, buffer, size, &pwd_ptr); + switch (ret) { + case 0: + ok = true; + break; + case ERANGE: + delete[] buffer; + size += 1024; + break; + default: + delete[] buffer; + return false; + } + } + + string home_dir = pwd_ptr->pw_dir; + delete[] buffer; + + if (chdir(home_dir.data())) + return false; + + if (chdir(OLA_CONFIG_DIR)) { + // try and create it + if (mkdir(OLA_CONFIG_DIR, 0755)) + return false; + + if (chdir(OLA_CONFIG_DIR)) + return false; + } + return true; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/PreferencesTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/PreferencesTest.cpp new file mode 100644 index 0000000..9f2c39e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/PreferencesTest.cpp @@ -0,0 +1,228 @@ +/* + * 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 Library 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. + * + * PreferencesTest.cpp + * Test fixture for the Preferences classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "olad/Preferences.h" + +using ola::BoolValidator; +using ola::FileBackedPreferences; +using ola::FileBackedPreferencesFactory; +using ola::IntValidator; +using ola::MemoryPreferencesFactory; +using ola::Preferences; +using ola::SetValidator; +using ola::StringValidator; +using ola::IPv4Validator; +using std::string; +using std::vector; + + +class PreferencesTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(PreferencesTest); + CPPUNIT_TEST(testValidators); + CPPUNIT_TEST(testGetSetRemove); + CPPUNIT_TEST(testBool); + CPPUNIT_TEST(testFactory); + CPPUNIT_TEST(testLoad); + CPPUNIT_TEST(testSave); + CPPUNIT_TEST_SUITE_END(); + + public: + void testValidators(); + void testGetSetRemove(); + void testBool(); + void testFactory(); + void testLoad(); + void testSave(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(PreferencesTest); + +/* + * Check the validators work + */ +void PreferencesTest::testValidators() { + StringValidator string_validator; + CPPUNIT_ASSERT(string_validator.IsValid("foo")); + CPPUNIT_ASSERT(!string_validator.IsValid("")); + + std::set values; + values.insert("one"); + values.insert("two"); + SetValidator set_validator(values); + CPPUNIT_ASSERT(set_validator.IsValid("one")); + CPPUNIT_ASSERT(set_validator.IsValid("two")); + CPPUNIT_ASSERT(!set_validator.IsValid("zero")); + CPPUNIT_ASSERT(!set_validator.IsValid("three")); + + BoolValidator bool_validator; + CPPUNIT_ASSERT(bool_validator.IsValid("true")); + CPPUNIT_ASSERT(bool_validator.IsValid("false")); + CPPUNIT_ASSERT(!bool_validator.IsValid("")); + + IntValidator int_validator(10, 14); + CPPUNIT_ASSERT(int_validator.IsValid("10")); + CPPUNIT_ASSERT(int_validator.IsValid("14")); + CPPUNIT_ASSERT(!int_validator.IsValid("0")); + CPPUNIT_ASSERT(!int_validator.IsValid("9")); + CPPUNIT_ASSERT(!int_validator.IsValid("15")); + + IPv4Validator ipv4_validator; // empty ok + CPPUNIT_ASSERT(ipv4_validator.IsValid("")); + CPPUNIT_ASSERT(ipv4_validator.IsValid("1.2.3.4")); + CPPUNIT_ASSERT(ipv4_validator.IsValid("10.0.255.1")); + CPPUNIT_ASSERT(!ipv4_validator.IsValid("foo")); + CPPUNIT_ASSERT(!ipv4_validator.IsValid("1.2.3")); + CPPUNIT_ASSERT(!ipv4_validator.IsValid("1.2.3.4.5")); + CPPUNIT_ASSERT(!ipv4_validator.IsValid("1.f00.3.4")); + + IPv4Validator ipv4_validator2(false); // empty not ok + CPPUNIT_ASSERT(!ipv4_validator2.IsValid("")); +} + + +/* + * Check that we can get/set the preferences + */ +void PreferencesTest::testGetSetRemove() { + MemoryPreferencesFactory factory; + Preferences *preferences = factory.NewPreference("dummy"); + + string key1 = "foo"; + string value1 = "bar"; + string value2 = "baz"; + + // test get/set single values + CPPUNIT_ASSERT_EQUAL(string(""), preferences->GetValue(key1)); + preferences->SetValue(key1, value1); + CPPUNIT_ASSERT_EQUAL(value1, preferences->GetValue(key1)); + preferences->SetValue(key1, value2); + CPPUNIT_ASSERT_EQUAL(value2, preferences->GetValue(key1)); + + preferences->RemoveValue(key1); + CPPUNIT_ASSERT_EQUAL(string(""), preferences->GetValue(key1)); + + // test get/set multiple value + string key2 = "bat"; + vector values = preferences->GetMultipleValue(key2); + CPPUNIT_ASSERT_EQUAL((size_t) 0, values.size()); + preferences->SetMultipleValue(key2, value1); + values = preferences->GetMultipleValue(key2); + CPPUNIT_ASSERT_EQUAL((size_t) 1, values.size()); + CPPUNIT_ASSERT_EQUAL(value1, values.at(0)); + preferences->SetMultipleValue(key2, value2); + values = preferences->GetMultipleValue(key2); + CPPUNIT_ASSERT_EQUAL((size_t) 2, values.size()); + CPPUNIT_ASSERT_EQUAL(value1, values.at(0)); + CPPUNIT_ASSERT_EQUAL(value2, values.at(1)); + + // test SetDefaultValue + CPPUNIT_ASSERT(preferences->SetDefaultValue(key1, StringValidator(), value1)); + CPPUNIT_ASSERT_EQUAL(value1, preferences->GetValue(key1)); + CPPUNIT_ASSERT(!preferences->SetDefaultValue(key1, StringValidator(), + value2)); + CPPUNIT_ASSERT_EQUAL(value1, preferences->GetValue(key1)); +} + + +/* + * Check that we can get/set the preferences + */ +void PreferencesTest::testBool() { + MemoryPreferencesFactory factory; + Preferences *preferences = factory.NewPreference("dummy"); + + string key1 = "foo"; + string value1 = "bar"; + + // test get/set single values + CPPUNIT_ASSERT_EQUAL(false, preferences->GetValueAsBool(key1)); + preferences->SetValueAsBool(key1, true); + CPPUNIT_ASSERT_EQUAL(true, preferences->GetValueAsBool(key1)); + preferences->SetValueAsBool(key1, false); + CPPUNIT_ASSERT_EQUAL(false, preferences->GetValueAsBool(key1)); + preferences->SetValue(key1, value1); + CPPUNIT_ASSERT_EQUAL(false, preferences->GetValueAsBool(key1)); +} + + +/* + * Check that the factory works as intended + */ +void PreferencesTest::testFactory() { + MemoryPreferencesFactory factory; + string preferences_name = "dummy"; + Preferences *preferences = factory.NewPreference(preferences_name); + Preferences *preferences2 = factory.NewPreference(preferences_name); + CPPUNIT_ASSERT_EQUAL(preferences, preferences2); +} + + +/* + * Check that we can load from a file + */ +void PreferencesTest::testLoad() { + FileBackedPreferences *preferences = new FileBackedPreferences("dummy"); + preferences->Clear(); + preferences->SetValue("foo", "bad"); + preferences->LoadFromFile("./testdata/test_preferences.conf"); + + CPPUNIT_ASSERT_EQUAL(string("bar"), preferences->GetValue("foo")); + CPPUNIT_ASSERT_EQUAL(string("bat"), preferences->GetValue("baz")); + + vector values = preferences->GetMultipleValue("multi"); + CPPUNIT_ASSERT_EQUAL((size_t) 3, values.size()); + CPPUNIT_ASSERT_EQUAL(string("1"), values.at(0)); + CPPUNIT_ASSERT_EQUAL(string("2"), values.at(1)); + CPPUNIT_ASSERT_EQUAL(string("3"), values.at(2)); + delete preferences; +} + + +void PreferencesTest::testSave() { + FileBackedPreferencesFactory factory; + FileBackedPreferences *preferences = new FileBackedPreferences("dummy"); + preferences->Clear(); + + string data_path = "./testdata/preferences.output"; + string key1 = "foo"; + string key2 = "bat"; + string value1 = "bar"; + string value2 = "baz"; + string multi_key = "multi"; + preferences->SetValue(key1, value1); + preferences->SetValue(key2, value2); + preferences->SetMultipleValue(multi_key, "1"); + preferences->SetMultipleValue(multi_key, "2"); + preferences->SetMultipleValue(multi_key, "3"); + preferences->SaveToFile(data_path); + + FileBackedPreferences *input_preferences = new + FileBackedPreferences("input"); + input_preferences->LoadFromFile(data_path); + CPPUNIT_ASSERT(*preferences == *input_preferences); + delete preferences; + delete input_preferences; +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.cpp b/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.cpp new file mode 100644 index 0000000..ab66f52 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.cpp @@ -0,0 +1,2782 @@ +/* + * 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 Library 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. + * + * RDMHttpModule.cpp + * This module acts as the http -> olad gateway for RDM commands. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Callback.h" +#include "ola/Logging.h" +#include "ola/OlaCallbackClient.h" +#include "ola/StringUtils.h" +#include "ola/rdm/RDMHelper.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" +#include "ola/web/JsonSections.h" +#include "olad/OlaServer.h" +#include "olad/RDMHttpModule.h" + + +namespace ola { + +using ola::rdm::UID; +using ola::web::BoolItem; +using ola::web::HiddenItem; +using ola::web::JsonSection; +using ola::web::SelectItem; +using ola::web::StringItem; +using ola::web::UIntItem; +using std::endl; +using std::pair; +using std::string; +using std::stringstream; +using std::vector; + + +const char RDMHttpModule::BACKEND_DISCONNECTED_ERROR[] = + "Failed to send request, client isn't connected"; + +// global url params +const char RDMHttpModule::HINT_KEY[] = "hint"; +const char RDMHttpModule::ID_KEY[] = "id"; +const char RDMHttpModule::SECTION_KEY[] = "section"; +const char RDMHttpModule::UID_KEY[] = "uid"; + +// url params for particular sections +const char RDMHttpModule::ADDRESS_FIELD[] = "address"; +const char RDMHttpModule::DISPLAY_INVERT_FIELD[] = "invert"; +const char RDMHttpModule::GENERIC_BOOL_FIELD[] = "bool"; +const char RDMHttpModule::GENERIC_STRING_FIELD[] = "string"; +const char RDMHttpModule::GENERIC_UINT_FIELD[] = "int"; +const char RDMHttpModule::IDENTIFY_FIELD[] = "identify"; +const char RDMHttpModule::LABEL_FIELD[] = "label"; +const char RDMHttpModule::LANGUAGE_FIELD[] = "language"; +const char RDMHttpModule::RECORD_SENSOR_FIELD[] = "record"; + +// section identifiers +const char RDMHttpModule::BOOT_SOFTWARE_SECTION[] = "boot_software"; +const char RDMHttpModule::CLOCK_SECTION[] = "clock"; +const char RDMHttpModule::DEVICE_HOURS_SECTION[] = "device_hours"; +const char RDMHttpModule::DEVICE_INFO_SECTION[] = "device_info"; +const char RDMHttpModule::DEVICE_LABEL_SECTION[] = "device_label"; +const char RDMHttpModule::DISPLAY_INVERT_SECTION[] = "display_invert"; +const char RDMHttpModule::DISPLAY_LEVEL_SECTION[] = "display_level"; +const char RDMHttpModule::DMX_ADDRESS_SECTION[] = "dmx_address"; +const char RDMHttpModule::FACTORY_DEFAULTS_SECTION[] = "factory_defaults"; +const char RDMHttpModule::IDENTIFY_SECTION[] = "identify"; +const char RDMHttpModule::LAMP_HOURS_SECTION[] = "lamp_hours"; +const char RDMHttpModule::LAMP_MODE_SECTION[] = "lamp_mode"; +const char RDMHttpModule::LAMP_STATE_SECTION[] = "lamp_state"; +const char RDMHttpModule::LAMP_STRIKES_SECITON[] = "lamp_strikes"; +const char RDMHttpModule::LANGUAGE_SECTION[] = "language"; +const char RDMHttpModule::MANUFACTURER_LABEL_SECTION[] = "manufacturer_label"; +const char RDMHttpModule::PAN_INVERT_SECTION[] = "pan_invert"; +const char RDMHttpModule::PAN_TILT_SWAP_SECTION[] = "pan_tilt_swap"; +const char RDMHttpModule::PERSONALITY_SECTION[] = "personality"; +const char RDMHttpModule::POWER_CYCLES_SECTION[] = "power_cycles"; +const char RDMHttpModule::POWER_STATE_SECTION[] = "power_state"; +const char RDMHttpModule::PRODUCT_DETAIL_SECTION[] = "product_detail"; +const char RDMHttpModule::SENSOR_SECTION[] = "sensor"; +const char RDMHttpModule::TILT_INVERT_SECTION[] = "tilt_invert"; + +/** + * Create a new OLA HTTP server + * @param export_map the ExportMap to display when /debug is called + * @param client_socket A ConnectedSocket which is used to communicate with the + * server. + * @param + */ +RDMHttpModule::RDMHttpModule(HttpServer *http_server, + OlaCallbackClient *client) + : HttpModule(http_server, client), + m_server(http_server), + m_client(client), + m_rdm_api(m_client) { + + m_server->RegisterHandler( + "/rdm/run_discovery", + NewCallback(this, &RDMHttpModule::RunRDMDiscovery)); + m_server->RegisterHandler( + "/json/rdm/uids", + NewCallback(this, &RDMHttpModule::JsonUIDs)); + m_server->RegisterHandler( + "/json/rdm/supported_pids", + NewCallback(this, &RDMHttpModule::JsonSupportedPIDs)); + m_server->RegisterHandler( + "/json/rdm/supported_sections", + NewCallback(this, &RDMHttpModule::JsonSupportedSections)); + m_server->RegisterHandler( + "/json/rdm/section_info", + NewCallback(this, &RDMHttpModule::JsonSectionInfo)); + m_server->RegisterHandler( + "/json/rdm/set_section_info", + NewCallback(this, &RDMHttpModule::JsonSaveSectionInfo)); +} + + +/* + * Teardown + */ +RDMHttpModule::~RDMHttpModule() { + map::iterator uid_iter; + for (uid_iter = m_universe_uids.begin(); uid_iter != m_universe_uids.end(); + uid_iter++) { + delete uid_iter->second; + } + m_universe_uids.clear(); +} + + +/** + * Run RDM discovery for a universe + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int RDMHttpModule::RunRDMDiscovery(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + bool ok = m_client->ForceDiscovery( + universe_id, + NewSingleCallback(this, + &RDMHttpModule::HandleBoolResponse, + response)); + + if (!ok) + return m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/** + * Return the list of uids for this universe as json + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int RDMHttpModule::JsonUIDs(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + bool ok = m_client->FetchUIDList( + universe_id, + NewSingleCallback(this, + &RDMHttpModule::HandleUIDList, + response, + universe_id)); + + if (!ok) + return m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/** + * Return a list of pids supported by this device. This isn't used by the UI + * but it's useful for debugging. + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int RDMHttpModule::JsonSupportedPIDs(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + UID *uid = NULL; + if (!CheckForInvalidUid(request, &uid)) + return m_server->ServeNotFound(response); + + string error; + bool ok = m_rdm_api.GetSupportedParameters( + universe_id, + *uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::SupportedParamsHandler, + response), + &error); + delete uid; + + if (!ok) + return m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/** + * Return a list of sections to display in the RDM control panel. + * We use the response from SUPPORTED_PARAMS and DEVICE_INFO to decide which + * pids exist. + * @param request the HttpRequest + * @param response the HttpResponse + * @returns MHD_NO or MHD_YES + */ +int RDMHttpModule::JsonSupportedSections(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + UID *uid = NULL; + if (!CheckForInvalidUid(request, &uid)) + return m_server->ServeNotFound(response); + + string error; + bool ok = m_rdm_api.GetSupportedParameters( + universe_id, + *uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::SupportedSectionsHandler, + response, + universe_id, + *uid), + &error); + delete uid; + + if (!ok) + return m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR); + return MHD_YES; +} + + +/** + * Get the information required to render a section in the RDM controller panel + */ +int RDMHttpModule::JsonSectionInfo(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + UID *uid = NULL; + if (!CheckForInvalidUid(request, &uid)) + return m_server->ServeNotFound(response); + + string section_id = request->GetParameter(SECTION_KEY); + string error; + if (section_id == DEVICE_INFO_SECTION) { + error = GetDeviceInfo(request, response, universe_id, *uid); + } else if (section_id == PRODUCT_DETAIL_SECTION) { + error = GetProductIds(request, response, universe_id, *uid); + } else if (section_id == MANUFACTURER_LABEL_SECTION) { + error = GetManufacturerLabel(request, response, universe_id, *uid); + } else if (section_id == DEVICE_LABEL_SECTION) { + error = GetDeviceLabel(request, response, universe_id, *uid); + } else if (section_id == FACTORY_DEFAULTS_SECTION) { + error = GetFactoryDefaults(response, universe_id, *uid); + } else if (section_id == LANGUAGE_SECTION) { + error = GetLanguage(response, universe_id, *uid); + } else if (section_id == BOOT_SOFTWARE_SECTION) { + error = GetBootSoftware(response, universe_id, *uid); + } else if (section_id == PERSONALITY_SECTION) { + error = GetPersonalities(request, response, universe_id, *uid); + } else if (section_id == DMX_ADDRESS_SECTION) { + error = GetStartAddress(request, response, universe_id, *uid); + } else if (section_id == SENSOR_SECTION) { + error = GetSensor(request, response, universe_id, *uid); + } else if (section_id == DEVICE_HOURS_SECTION) { + error = GetDeviceHours(request, response, universe_id, *uid); + } else if (section_id == LAMP_HOURS_SECTION) { + error = GetLampHours(request, response, universe_id, *uid); + } else if (section_id == LAMP_MODE_SECTION) { + error = GetLampMode(request, response, universe_id, *uid); + } else if (section_id == LAMP_STATE_SECTION) { + error = GetLampState(request, response, universe_id, *uid); + } else if (section_id == LAMP_STRIKES_SECITON) { + error = GetLampStrikes(request, response, universe_id, *uid); + } else if (section_id == POWER_CYCLES_SECTION) { + error = GetPowerCycles(request, response, universe_id, *uid); + } else if (section_id == DISPLAY_INVERT_SECTION) { + error = GetDisplayInvert(response, universe_id, *uid); + } else if (section_id == DISPLAY_LEVEL_SECTION) { + error = GetDisplayLevel(response, universe_id, *uid); + } else if (section_id == PAN_INVERT_SECTION) { + error = GetPanInvert(response, universe_id, *uid); + } else if (section_id == TILT_INVERT_SECTION) { + error = GetTiltInvert(response, universe_id, *uid); + } else if (section_id == PAN_TILT_SWAP_SECTION) { + error = GetPanTiltSwap(response, universe_id, *uid); + } else if (section_id == CLOCK_SECTION) { + error = GetClock(response, universe_id, *uid); + } else if (section_id == IDENTIFY_SECTION) { + error = GetIdentifyMode(response, universe_id, *uid); + } else if (section_id == POWER_STATE_SECTION) { + error = GetPowerState(response, universe_id, *uid); + } else { + OLA_INFO << "Missing or unknown section id: " << section_id; + return m_server->ServeNotFound(response); + } + + if (!error.empty()) + return m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); + return MHD_YES; +} + + +/** + * Save the information for a section or item. + */ +int RDMHttpModule::JsonSaveSectionInfo(const HttpRequest *request, + HttpResponse *response) { + unsigned int universe_id; + if (!CheckForInvalidId(request, &universe_id)) + return m_server->ServeNotFound(response); + + UID *uid = NULL; + if (!CheckForInvalidUid(request, &uid)) + return m_server->ServeNotFound(response); + + string section_id = request->GetParameter(SECTION_KEY); + string error; + if (section_id == DEVICE_LABEL_SECTION) { + error = SetDeviceLabel(request, response, universe_id, *uid); + } else if (section_id == FACTORY_DEFAULTS_SECTION) { + error = SetFactoryDefault(response, universe_id, *uid); + } else if (section_id == LANGUAGE_SECTION) { + error = SetLanguage(request, response, universe_id, *uid); + } else if (section_id == PERSONALITY_SECTION) { + error = SetPersonality(request, response, universe_id, *uid); + } else if (section_id == DMX_ADDRESS_SECTION) { + error = SetStartAddress(request, response, universe_id, *uid); + } else if (section_id == SENSOR_SECTION) { + error = RecordSensor(request, response, universe_id, *uid); + } else if (section_id == DEVICE_HOURS_SECTION) { + error = SetDeviceHours(request, response, universe_id, *uid); + } else if (section_id == LAMP_HOURS_SECTION) { + error = SetLampHours(request, response, universe_id, *uid); + } else if (section_id == LAMP_MODE_SECTION) { + error = SetLampMode(request, response, universe_id, *uid); + } else if (section_id == LAMP_STATE_SECTION) { + error = SetLampState(request, response, universe_id, *uid); + } else if (section_id == LAMP_STRIKES_SECITON) { + error = SetLampStrikes(request, response, universe_id, *uid); + } else if (section_id == POWER_CYCLES_SECTION) { + error = SetPowerCycles(request, response, universe_id, *uid); + } else if (section_id == DISPLAY_INVERT_SECTION) { + error = SetDisplayInvert(request, response, universe_id, *uid); + } else if (section_id == DISPLAY_LEVEL_SECTION) { + error = SetDisplayLevel(request, response, universe_id, *uid); + } else if (section_id == PAN_INVERT_SECTION) { + error = SetPanInvert(request, response, universe_id, *uid); + } else if (section_id == TILT_INVERT_SECTION) { + error = SetTiltInvert(request, response, universe_id, *uid); + } else if (section_id == PAN_TILT_SWAP_SECTION) { + error = SetPanTiltSwap(request, response, universe_id, *uid); + } else if (section_id == IDENTIFY_SECTION) { + error = SetIdentifyMode(request, response, universe_id, *uid); + } else if (section_id == POWER_STATE_SECTION) { + error = SetPowerState(request, response, universe_id, *uid); + } else { + OLA_INFO << "Missing or unknown section id: " << section_id; + return m_server->ServeNotFound(response); + } + + if (!error.empty()) + return RespondWithError(response, error); + return MHD_YES; +} + + +/** + * This is called from the main http server whenever a new list of active + * universes is received. It's used to prune the uid map so we don't bother + * trying to resolve uids for universes that no longer exist. + */ +void RDMHttpModule::PruneUniverseList(const vector &universes) { + map::iterator uid_iter; + for (uid_iter = m_universe_uids.begin(); uid_iter != m_universe_uids.end(); + uid_iter++) { + uid_iter->second->active = false; + } + + vector::const_iterator iter; + for (iter = universes.begin(); iter != universes.end(); ++iter) { + uid_iter = m_universe_uids.find(iter->Id()); + if (uid_iter != m_universe_uids.end()) + uid_iter->second->active = true; + } + + // clean up the uid map for those universes that no longer exist + for (uid_iter = m_universe_uids.begin(); uid_iter != m_universe_uids.end();) { + if (!uid_iter->second->active) { + OLA_DEBUG << "removing " << uid_iter->first << " from the uid map"; + delete uid_iter->second; + m_universe_uids.erase(uid_iter++); + } else { + uid_iter++; + } + } +} + + +/* + * Handle the UID list response. + * @param response the HttpResponse that is associated with the request. + * @param uids the UIDs for this response. + * @param error an error string. + */ +void RDMHttpModule::HandleUIDList(HttpResponse *response, + unsigned int universe_id, + const ola::rdm::UIDSet &uids, + const string &error) { + if (!error.empty()) { + m_server->ServeError(response, error); + return; + } + ola::rdm::UIDSet::Iterator iter = uids.Begin(); + uid_resolution_state *uid_state = GetUniverseUidsOrCreate(universe_id); + + // mark all uids as inactive so we can remove the unused ones at the end + map::iterator uid_iter; + for (uid_iter = uid_state->resolved_uids.begin(); + uid_iter != uid_state->resolved_uids.end(); ++uid_iter) + uid_iter->second.active = false; + + stringstream str; + str << "{" << endl; + str << " \"universe\": " << universe_id << "," << endl; + str << " \"uids\": [" << endl; + + for (; iter != uids.End(); ++iter) { + uid_iter = uid_state->resolved_uids.find(*iter); + + string manufacturer = ""; + string device = ""; + + if (uid_iter == uid_state->resolved_uids.end()) { + // schedule resolution + uid_state->pending_uids.push( + std::pair(*iter, RESOLVE_MANUFACTURER)); + uid_state->pending_uids.push( + std::pair(*iter, RESOLVE_DEVICE)); + resolved_uid uid_descriptor = {"", "", true}; + uid_state->resolved_uids[*iter] = uid_descriptor; + OLA_DEBUG << "Adding UID " << uid_iter->first << " to resolution queue"; + } else { + manufacturer = uid_iter->second.manufacturer; + device = uid_iter->second.device; + uid_iter->second.active = true; + } + str << " {" << endl; + str << " \"manufacturer_id\": " << iter->ManufacturerId() << "," + << endl; + str << " \"device_id\": " << iter->DeviceId() << "," << endl; + str << " \"device\": \"" << EscapeString(device) << "\"," << endl; + str << " \"manufacturer\": \"" << EscapeString(manufacturer) << + "\"," << endl; + str << " }," << endl; + } + + str << " ]" << endl; + str << "}"; + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete response; + + // remove any old uids + for (uid_iter = uid_state->resolved_uids.begin(); + uid_iter != uid_state->resolved_uids.end();) { + if (!uid_iter->second.active) { + OLA_DEBUG << "Removed UID " << uid_iter->first; + uid_state->resolved_uids.erase(uid_iter++); + } else { + ++uid_iter; + } + } + + if (!uid_state->uid_resolution_running) + ResolveNextUID(universe_id); +} + + +/* + * Send the RDM command needed to resolve the next uid in the queue + * @param universe_id the universe id to resolve the next UID for. + */ +void RDMHttpModule::ResolveNextUID(unsigned int universe_id) { + bool sent_request = false; + string error; + uid_resolution_state *uid_state = GetUniverseUids(universe_id); + + if (!uid_state) + return; + + while (!sent_request) { + if (!uid_state->pending_uids.size()) { + uid_state->uid_resolution_running = false; + return; + } + uid_state->uid_resolution_running = true; + + pair &uid_action_pair = + uid_state->pending_uids.front(); + if (uid_action_pair.second == RESOLVE_MANUFACTURER) { + OLA_DEBUG << "sending manufacturer request for " << uid_action_pair.first; + sent_request = m_rdm_api.GetManufacturerLabel( + universe_id, + uid_action_pair.first, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::UpdateUIDManufacturerLabel, + universe_id, + uid_action_pair.first), + &error); + OLA_DEBUG << "return code was " << sent_request; + uid_state->pending_uids.pop(); + } else if (uid_action_pair.second == RESOLVE_DEVICE) { + OLA_INFO << "sending device request for " << uid_action_pair.first; + sent_request = m_rdm_api.GetDeviceLabel( + universe_id, + uid_action_pair.first, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::UpdateUIDDeviceLabel, + universe_id, + uid_action_pair.first), + &error); + uid_state->pending_uids.pop(); + OLA_DEBUG << "return code was " << sent_request; + } else { + OLA_WARN << "Unknown UID resolve action " << + static_cast(uid_action_pair.second); + } + } +} + +/* + * Handle the manufacturer label response. + */ +void RDMHttpModule::UpdateUIDManufacturerLabel( + unsigned int universe, + UID uid, + const ola::rdm::ResponseStatus &status, + const string &manufacturer_label) { + uid_resolution_state *uid_state = GetUniverseUids(universe); + + if (!uid_state) + return; + + if (CheckForRDMSuccess(status)) { + map::iterator uid_iter; + uid_iter = uid_state->resolved_uids.find(uid); + if (uid_iter != uid_state->resolved_uids.end()) + uid_iter->second.manufacturer = manufacturer_label; + } + ResolveNextUID(universe); +} + + +/* + * Handle the device label response. + */ +void RDMHttpModule::UpdateUIDDeviceLabel( + unsigned int universe, + UID uid, + const ola::rdm::ResponseStatus &status, + const string &device_label) { + uid_resolution_state *uid_state = GetUniverseUids(universe); + + if (!uid_state) + return; + + if (CheckForRDMSuccess(status)) { + map::iterator uid_iter; + uid_iter = uid_state->resolved_uids.find(uid); + if (uid_iter != uid_state->resolved_uids.end()) + uid_iter->second.device = device_label; + } + ResolveNextUID(universe); +} + + +/* + * Get the UID resolution state for a particular universe + * @param universe the id of the universe to get the state for + */ +RDMHttpModule::uid_resolution_state *RDMHttpModule::GetUniverseUids( + unsigned int universe) { + map::iterator iter = + m_universe_uids.find(universe); + return iter == m_universe_uids.end() ? NULL : iter->second; +} + + +/* + * Get the UID resolution state for a particular universe or create one if it + * doesn't exist. + * @param universe the id of the universe to get the state for + */ +RDMHttpModule::uid_resolution_state *RDMHttpModule::GetUniverseUidsOrCreate( + unsigned int universe) { + map::iterator iter = + m_universe_uids.find(universe); + + if (iter == m_universe_uids.end()) { + OLA_DEBUG << "Adding a new state entry for " << universe; + uid_resolution_state *state = new uid_resolution_state(); + state->uid_resolution_running = false; + state->active = true; + pair p(universe, state); + iter = m_universe_uids.insert(p).first; + } + return iter->second; +} + + +/* + * Handle the response from a supported params request + */ +void RDMHttpModule::SupportedParamsHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const vector &pids) { + stringstream str; + if (CheckForRDMSuccess(status)) { + vector::const_iterator iter = pids.begin(); + + str << "{" << endl; + str << " \"pids\": [" << endl; + + for (; iter != pids.end(); ++iter) { + str << " 0x" << std::hex << *iter << ",\n"; + } + + str << " ]" << endl; + str << "}"; + } + + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete response; +} + + +/** + * Takes the supported pids for a device and come up with the list of sections + * to display in the RDM panel + */ +void RDMHttpModule::SupportedSectionsHandler( + HttpResponse *response, + unsigned int universe_id, + UID uid, + const ola::rdm::ResponseStatus &status, + const vector &pid_list) { + string error; + + // nacks here are ok if the device doesn't support SUPPORTED_PARAMS + if (!CheckForRDMSuccess(status) && + status.ResponseType() != ola::rdm::ResponseStatus::REQUEST_NACKED) { + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); + return; + } + + m_rdm_api.GetDeviceInfo( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::SupportedSectionsDeviceInfoHandler, + response, + pid_list), + &error); + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); +} + + +/** + * Handle the second part of the supported sections request. + */ +void RDMHttpModule::SupportedSectionsDeviceInfoHandler( + HttpResponse *response, + const vector pid_list, + const ola::rdm::ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device) { + vector sections; + std::set pids; + copy(pid_list.begin(), pid_list.end(), inserter(pids, pids.end())); + + // PID_DEVICE_INFO is required so we always add it + string hint; + if (pids.find(ola::rdm::PID_DEVICE_MODEL_DESCRIPTION) != pids.end()) + hint.push_back('m'); // m is for device model + AddSection(§ions, DEVICE_INFO_SECTION, "Device Info", hint); + + AddSection(§ions, IDENTIFY_SECTION, "Identify Mode", hint); + + bool dmx_address_added = false; + bool include_software_version = false; + vector::const_iterator iter = pid_list.begin(); + for (; iter != pid_list.end(); ++iter) { + switch (*iter) { + case ola::rdm::PID_PRODUCT_DETAIL_ID_LIST: + AddSection(§ions, PRODUCT_DETAIL_SECTION, "Product Details"); + break; + case ola::rdm::PID_MANUFACTURER_LABEL: + AddSection(§ions, MANUFACTURER_LABEL_SECTION, + "Manufacturer Label"); + break; + case ola::rdm::PID_DEVICE_LABEL: + AddSection(§ions, DEVICE_LABEL_SECTION, "Device Label"); + break; + case ola::rdm::PID_FACTORY_DEFAULTS: + AddSection(§ions, FACTORY_DEFAULTS_SECTION, "Factory Defaults"); + break; + case ola::rdm::PID_LANGUAGE: + AddSection(§ions, LANGUAGE_SECTION, "Language"); + break; + case ola::rdm::PID_BOOT_SOFTWARE_VERSION_ID: + case ola::rdm::PID_BOOT_SOFTWARE_VERSION_LABEL: + include_software_version = true; + break; + case ola::rdm::PID_DMX_PERSONALITY: + if (pids.find(ola::rdm::PID_DMX_PERSONALITY_DESCRIPTION) == pids.end()) + AddSection(§ions, PERSONALITY_SECTION, "DMX Personality"); + else + AddSection(§ions, PERSONALITY_SECTION, "DMX Personality", "l"); + break; + case ola::rdm::PID_DMX_START_ADDRESS: + AddSection(§ions, DMX_ADDRESS_SECTION, "DMX Start Address"); + dmx_address_added = true; + break; + case ola::rdm::PID_DEVICE_HOURS: + AddSection(§ions, DEVICE_HOURS_SECTION, "Device Hours"); + break; + case ola::rdm::PID_LAMP_HOURS: + AddSection(§ions, LAMP_HOURS_SECTION, "Lamp Hours"); + break; + case ola::rdm::PID_LAMP_STRIKES: + AddSection(§ions, LAMP_STRIKES_SECITON, "Lamp Strikes"); + break; + case ola::rdm::PID_LAMP_STATE: + AddSection(§ions, LAMP_STATE_SECTION, "Lamp State"); + break; + case ola::rdm::PID_LAMP_ON_MODE: + AddSection(§ions, LAMP_MODE_SECTION, "Lamp On Mode"); + break; + case ola::rdm::PID_DEVICE_POWER_CYCLES: + AddSection(§ions, POWER_CYCLES_SECTION, "Device Power Cycles"); + break; + case ola::rdm::PID_DISPLAY_INVERT: + AddSection(§ions, DISPLAY_INVERT_SECTION, "Display Invert"); + break; + case ola::rdm::PID_DISPLAY_LEVEL: + AddSection(§ions, DISPLAY_LEVEL_SECTION, "Display Level"); + break; + case ola::rdm::PID_PAN_INVERT: + AddSection(§ions, PAN_INVERT_SECTION, "Pan Invert"); + break; + case ola::rdm::PID_TILT_INVERT: + AddSection(§ions, TILT_INVERT_SECTION, "Tilt Invert"); + break; + case ola::rdm::PID_PAN_TILT_SWAP: + AddSection(§ions, PAN_TILT_SWAP_SECTION, "Pan/Tilt Swap"); + break; + case ola::rdm::PID_REAL_TIME_CLOCK: + AddSection(§ions, CLOCK_SECTION, "Clock"); + break; + case ola::rdm::PID_POWER_STATE: + AddSection(§ions, POWER_STATE_SECTION, "Power State"); + break; + } + } + + if (include_software_version) + AddSection(§ions, BOOT_SOFTWARE_SECTION, "Boot Software Version"); + + if (CheckForRDMSuccess(status)) { + if (device.dmx_footprint && !dmx_address_added) + AddSection(§ions, DMX_ADDRESS_SECTION, "DMX Start Address"); + if (device.sensor_count && + pids.find(ola::rdm::PID_SENSOR_DEFINITION) != pids.end() && + pids.find(ola::rdm::PID_SENSOR_VALUE) != pids.end()) { + // sensors count from 1 + for (unsigned int i = 0; i < device.sensor_count; ++i) { + stringstream heading, hint; + hint << i; + heading << "Sensor " << (i + 1); + AddSection(§ions, SENSOR_SECTION, heading.str(), hint.str()); + } + } + } + + sort(sections.begin(), sections.end(), lt_section_info()); + + vector::const_iterator section_iter; + stringstream str; + str << "[" << endl; + for (section_iter = sections.begin(); section_iter != sections.end(); + ++section_iter) { + str << " {" << endl; + str << " \"id\": \"" << section_iter->id << "\"," << endl; + str << " \"name\": \"" << section_iter->name << "\"," << endl; + str << " \"hint\": \"" << section_iter->hint << "\"," << endl; + str << " }," << endl; + } + str << "]" << endl; + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(str.str()); + response->Send(); + delete response; +} + + +/* + * Handle the request for the device info section. + */ +string RDMHttpModule::GetDeviceInfo(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string hint = request->GetParameter(HINT_KEY); + string error; + device_info dev_info = {universe_id, uid, hint, "", ""}; + + m_rdm_api.GetSoftwareVersionLabel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetSoftwareVersionHandler, + response, + dev_info), + &error); + return error; +} + + +/** + * Handle the response to a software version call. + */ +void RDMHttpModule::GetSoftwareVersionHandler( + HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const string &software_version) { + string error; + + if (CheckForRDMSuccess(status)) + dev_info.software_version = software_version; + + if (dev_info.hint.find('m') != string::npos) { + m_rdm_api.GetDeviceModelDescription( + dev_info.universe_id, + dev_info.uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetDeviceModelHandler, + response, + dev_info), + &error); + } else { + m_rdm_api.GetDeviceInfo( + dev_info.universe_id, + dev_info.uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetDeviceInfoHandler, + response, + dev_info), + &error); + } + + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); +} + + +/** + * Handle the response to a device model call. + */ +void RDMHttpModule::GetDeviceModelHandler( + HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const string &device_model) { + string error; + + if (CheckForRDMSuccess(status)) + dev_info.device_model = device_model; + + m_rdm_api.GetDeviceInfo( + dev_info.universe_id, + dev_info.uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetDeviceInfoHandler, + response, + dev_info), + &error); + + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); +} + + +/** + * Handle the response to a device info call and build the response + */ +void RDMHttpModule::GetDeviceInfoHandler( + HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device) { + JsonSection section; + + if (CheckForRDMError(response, status)) + return; + + stringstream stream; + stream << static_cast(device.protocol_version_high) << "." + << static_cast(device.protocol_version_low); + section.AddItem(new StringItem("Protocol Version", stream.str())); + + stream.str(""); + if (dev_info.device_model.empty()) + stream << device.device_model; + else + stream << dev_info.device_model << " (" << device.device_model << ")"; + section.AddItem(new StringItem("Device Model", stream.str())); + + section.AddItem(new StringItem( + "Product Category", + ola::rdm::ProductCategoryToString(device.product_category))); + stream.str(""); + if (dev_info.software_version.empty()) + stream << device.software_version; + else + stream << dev_info.software_version << " (" << device.software_version + << ")"; + section.AddItem(new StringItem("Software Version", stream.str())); + section.AddItem(new UIntItem("DMX Footprint", device.dmx_footprint)); + + stream.str(""); + stream << static_cast(device.current_personality) << " of " << + static_cast(device.personaility_count); + section.AddItem(new StringItem("Personality", stream.str())); + + section.AddItem(new UIntItem("Sub Devices", device.sub_device_count)); + section.AddItem(new UIntItem("Sensors", device.sensor_count)); + RespondWithSection(response, section); +} + + +/* + * Handle the request for the product details ids. + */ +string RDMHttpModule::GetProductIds(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetProductDetailIdList( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetProductIdsHandler, + response), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to a product detail ids call and build the response. + */ +void RDMHttpModule::GetProductIdsHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const vector &ids) { + if (CheckForRDMError(response, status)) + return; + + bool first = true; + stringstream product_ids; + JsonSection section; + vector::const_iterator iter = ids.begin(); + for (; iter != ids.end(); ++iter) { + string product_id = ola::rdm::ProductDetailToString(*iter); + if (product_id.empty()) + continue; + + if (first) + first = false; + else + product_ids << ", "; + product_ids << product_id; + } + section.AddItem(new StringItem("Product Detail IDs", product_ids.str())); + RespondWithSection(response, section); +} + + +/** + * Handle the request for the Manufacturer label. + */ +string RDMHttpModule::GetManufacturerLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetManufacturerLabel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetManufacturerLabelHandler, + response, + universe_id, + uid), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to a manufacturer label call and build the response + */ +void RDMHttpModule::GetManufacturerLabelHandler( + HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label) { + if (CheckForRDMError(response, status)) + return; + JsonSection section; + section.AddItem(new StringItem("Manufacturer Label", label)); + RespondWithSection(response, section); + + // update the map as well + uid_resolution_state *uid_state = GetUniverseUids(universe_id); + if (uid_state) { + map::iterator uid_iter = + uid_state->resolved_uids.find(uid); + if (uid_iter != uid_state->resolved_uids.end()) + uid_iter->second.manufacturer = label; + } +} + + +/** + * Handle the request for the Device label. + */ +string RDMHttpModule::GetDeviceLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDeviceLabel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetDeviceLabelHandler, + response, + universe_id, + uid), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to a device label call and build the response + */ +void RDMHttpModule::GetDeviceLabelHandler( + HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + section.AddItem(new StringItem("Device Label", label, LABEL_FIELD)); + RespondWithSection(response, section); + + // update the map as well + uid_resolution_state *uid_state = GetUniverseUids(universe_id); + if (uid_state) { + map::iterator uid_iter = + uid_state->resolved_uids.find(uid); + if (uid_iter != uid_state->resolved_uids.end()) + uid_iter->second.device = label; + } +} + + +/* + * Set the device label + */ +string RDMHttpModule::SetDeviceLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string label = request->GetParameter(LABEL_FIELD); + string error; + m_rdm_api.SetDeviceLabel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + label, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the factory defaults section + */ +string RDMHttpModule::GetFactoryDefaults(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetFactoryDefaults( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::FactoryDefaultsHandler, + response), + &error); + return error; +} + + +/** + * Handle the response to a factory defaults call and build the response + */ +void RDMHttpModule::FactoryDefaultsHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status, + bool defaults) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + section.AddItem(new StringItem("Using Defaults", + defaults ? "Yes" : "No")); + section.AddItem(new HiddenItem("1", GENERIC_UINT_FIELD)); + section.SetSaveButton("Reset to Defaults"); + RespondWithSection(response, section); +} + + +/* + * Reset to the factory defaults + */ +string RDMHttpModule::SetFactoryDefault(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.ResetToFactoryDefaults( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the language section. + */ +string RDMHttpModule::GetLanguage(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetLanguageCapabilities( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetSupportedLanguagesHandler, + response, + universe_id, + uid), + &error); + return error; +} + + +/** + * Handle the response to language capability call. + */ +void RDMHttpModule::GetSupportedLanguagesHandler( + HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const vector &languages) { + string error; + m_rdm_api.GetLanguage( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetLanguageHandler, + response, + languages), + &error); + + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); + (void) status; +} + + +/** + * Handle the response to language call and build the response + */ +void RDMHttpModule::GetLanguageHandler(HttpResponse *response, + vector languages, + const ola::rdm::ResponseStatus &status, + const string &language) { + JsonSection section; + SelectItem *item = new SelectItem("Language", LANGUAGE_FIELD); + bool ok = CheckForRDMSuccess(status); + + vector::const_iterator iter = languages.begin(); + unsigned int i = 0; + for (; iter != languages.end(); ++iter, i++) { + item->AddItem(*iter, *iter); + if (ok && *iter == language) + item->SetSelectedOffset(i); + } + + if (ok && !languages.size()) { + item->AddItem(language, language); + item->SetSelectedOffset(0); + } + section.AddItem(item); + RespondWithSection(response, section); +} + + +/* + * Set the language + */ +string RDMHttpModule::SetLanguage(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string label = request->GetParameter(LANGUAGE_FIELD); + string error; + m_rdm_api.SetLanguage( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + label, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the boot software section. + */ +string RDMHttpModule::GetBootSoftware(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetBootSoftwareVersionLabel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetBootSoftwareLabelHandler, + response, + universe_id, + uid), + &error); + return error; +} + + +/** + * Handle the response to a boot software label. + */ +void RDMHttpModule::GetBootSoftwareLabelHandler( + HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label) { + string error; + m_rdm_api.GetBootSoftwareVersion( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetBootSoftwareVersionHandler, + response, + label), + &error); + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); + (void) status; +} + + +/** + * Handle the response to a boot software version. + */ +void RDMHttpModule::GetBootSoftwareVersionHandler( + HttpResponse *response, + string label, + const ola::rdm::ResponseStatus &status, + uint32_t version) { + stringstream str; + str << label; + if (CheckForRDMSuccess(status)) { + if (!label.empty()) + str << " (" << version << ")"; + else + str << version; + } + + JsonSection section; + StringItem *item = new StringItem("Boot Software", str.str()); + section.AddItem(item); + RespondWithSection(response, section); +} + + +/** + * Handle the request for the personality section. + */ +string RDMHttpModule::GetPersonalities(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string hint = request->GetParameter(HINT_KEY); + string error; + + personality_info *info = new personality_info; + info->universe_id = universe_id; + info->uid = new UID(uid); + info->include_descriptions = (hint == "l"); + info->active = 0; + info->next = 1; + info->total = 0; + + m_rdm_api.GetDMXPersonality( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetPersonalityHandler, + response, + info), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to a dmx personality call. + */ +void RDMHttpModule::GetPersonalityHandler( + HttpResponse *response, + personality_info *info, + const ola::rdm::ResponseStatus &status, + uint8_t current, + uint8_t total) { + if (CheckForRDMError(response, status)) { + delete info->uid; + delete info; + return; + } + + info->active = current; + info->total = total; + + if (info->include_descriptions) + GetNextPersonalityDescription(response, info); + else + SendPersonalityResponse(response, info); +} + + +/** + * Get the description of the next dmx personality + */ +void RDMHttpModule::GetNextPersonalityDescription(HttpResponse *response, + personality_info *info) { + string error; + while (info->next <= info->total) { + bool r = m_rdm_api.GetDMXPersonalityDescription( + info->universe_id, + *(info->uid), + ola::rdm::ROOT_RDM_DEVICE, + info->next, + NewSingleCallback(this, + &RDMHttpModule::GetPersonalityLabelHandler, + response, + info), + &error); + if (r) + return; + + info->next++; + } + SendPersonalityResponse(response, info); +} + + +/** + * Handle the response to a Personality label call. This fetches the next + * personality in the sequence, or sends the response if we have all the info. + */ +void RDMHttpModule::GetPersonalityLabelHandler( + HttpResponse *response, + personality_info *info, + const ola::rdm::ResponseStatus &status, + uint8_t personality, + uint16_t slot_count, + const string &label) { + string description = ""; + uint32_t slots = INVALID_PERSONALITY; + + if (CheckForRDMSuccess(status)) { + slots = slot_count; + description = label; + } + + info->personalities.push_back(pair(slots, description)); + + if (info->next == info->total) { + SendPersonalityResponse(response, info); + } else { + info->next++; + GetNextPersonalityDescription(response, info); + } + (void) personality; +} + + +/** + * Send the response to a dmx personality section + */ +void RDMHttpModule::SendPersonalityResponse(HttpResponse *response, + personality_info *info) { + JsonSection section; + SelectItem *item = new SelectItem("Personality", GENERIC_UINT_FIELD); + + for (unsigned int i = 1; i <= info->total; i++) { + if (i <= info->personalities.size() && + info->personalities[i - 1].first != INVALID_PERSONALITY) { + stringstream str; + str << info->personalities[i - 1].second << " (" << + info->personalities[i - 1].first << ")"; + item->AddItem(str.str(), i); + } else { + item->AddItem(IntToString(i), i); + } + + if (info->active == i) + item->SetSelectedOffset(i - 1); + } + section.AddItem(item); + RespondWithSection(response, section); + + delete info->uid; + delete info; +} + + +/** + * Set the personality + */ +string RDMHttpModule::SetPersonality(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string personality_str = request->GetParameter(GENERIC_UINT_FIELD); + uint8_t personality; + + if (!StringToUInt8(personality_str, &personality)) { + return "Invalid personality"; + } + + string error; + m_rdm_api.SetDMXPersonality( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + personality, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the start address section. + */ +string RDMHttpModule::GetStartAddress(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDMXAddress( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GetStartAddressHandler, + response), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to a dmx start address call and build the response + */ +void RDMHttpModule::GetStartAddressHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint16_t address) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + UIntItem *item = new UIntItem("DMX Start Address", address, ADDRESS_FIELD); + item->SetMin(0); + item->SetMax(DMX_UNIVERSE_SIZE - 1); + section.AddItem(item); + RespondWithSection(response, section); +} + + +/* + * Set the DMX start address + */ +string RDMHttpModule::SetStartAddress(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string dmx_address = request->GetParameter(ADDRESS_FIELD); + uint16_t address; + + if (!StringToUInt16(dmx_address, &address)) { + return "Invalid start address"; + } + + string error; + m_rdm_api.SetDMXAddress( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + address, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the sensor section. + */ +string RDMHttpModule::GetSensor(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string hint = request->GetParameter(HINT_KEY); + uint8_t sensor_id; + if (!StringToUInt8(hint, &sensor_id)) { + return "Invalid hint (sensor #)"; + } + + string error; + m_rdm_api.GetSensorDefinition( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + sensor_id, + NewSingleCallback(this, + &RDMHttpModule::SensorDefinitionHandler, + response, + universe_id, + uid, + sensor_id), + &error); + return error; +} + + +/** + * Handle the response to a sensor definition request. + */ +void RDMHttpModule::SensorDefinitionHandler( + HttpResponse *response, + unsigned int universe_id, + const UID uid, + uint8_t sensor_id, + const ola::rdm::ResponseStatus &status, + const ola::rdm::SensorDescriptor &definition) { + ola::rdm::SensorDescriptor *definition_arg = NULL; + + if (CheckForRDMSuccess(status)) { + definition_arg = new ola::rdm::SensorDescriptor(); + *definition_arg = definition; + } + string error; + m_rdm_api.GetSensorValue( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + sensor_id, + NewSingleCallback(this, + &RDMHttpModule::SensorValueHandler, + response, + definition_arg), + &error); + if (!error.empty()) + m_server->ServeError(response, BACKEND_DISCONNECTED_ERROR + error); +} + + +/** + * Handle the response to a sensor value request & build the response. + */ +void RDMHttpModule::SensorValueHandler( + HttpResponse *response, + ola::rdm::SensorDescriptor *definition, + const ola::rdm::ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &value) { + if (CheckForRDMError(response, status)) { + if (definition) + delete definition; + return; + } + + JsonSection section; + stringstream str; + if (definition) { + section.AddItem(new StringItem("Description", definition->description)); + section.AddItem(new StringItem( + "Type", + ola::rdm::SensorTypeToString(definition->type))); + str << definition->range_min << " - " << definition->range_max << + " " << ola::rdm::PrefixToString(definition->prefix) << " " << + ola::rdm::UnitToString(definition->unit); + section.AddItem(new StringItem("Range", str.str())); + + str.str(""); + str << definition->normal_min << " - " << definition->normal_max << + " " << ola::rdm::PrefixToString(definition->prefix) << " " << + ola::rdm::UnitToString(definition->unit); + section.AddItem(new StringItem("Normal Range", str.str())); + + if (definition->recorded_value_support && + ola::rdm::SENSOR_RECORDED_VALUE) { + str.str(""); + str << value.recorded << " " << + ola::rdm::PrefixToString(definition->prefix) << " " << + ola::rdm::UnitToString(definition->unit); + section.AddItem(new StringItem("Recorded Value", str.str())); + } + + if (definition->recorded_value_support && + ola::rdm::SENSOR_RECORDED_RANGE_VALUES) { + str.str(""); + str << value.lowest << " - " << value.highest << + " " << ola::rdm::PrefixToString(definition->prefix) << " " << + ola::rdm::UnitToString(definition->unit); + section.AddItem(new StringItem("Min / Max Recorded Values", str.str())); + } + } + str.str(""); + str << value.present_value << " " << + ola::rdm::PrefixToString(definition->prefix) << " " << + ola::rdm::UnitToString(definition->unit); + section.AddItem(new StringItem("Present Value", str.str())); + + if (definition && definition->recorded_value_support) { + section.AddItem(new HiddenItem("1", RECORD_SENSOR_FIELD)); + } + section.SetSaveButton("Record Sensor"); + RespondWithSection(response, section); + delete definition; +} + + +/* + * Record a sensor value + */ +string RDMHttpModule::RecordSensor(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string hint = request->GetParameter(HINT_KEY); + uint8_t sensor_id; + if (!StringToUInt8(hint, &sensor_id)) { + return "Invalid hint (sensor #)"; + } + + string error; + m_rdm_api.RecordSensors( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + sensor_id, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the device hours section. + */ +string RDMHttpModule::GetDeviceHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDeviceHours( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUIntHandler, + response, + string("Device Hours")), + &error); + return error; + (void) request; +} + + +/** + * Set the device hours + */ +string RDMHttpModule::SetDeviceHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string device_hours = request->GetParameter(GENERIC_UINT_FIELD); + uint32_t dev_hours; + + if (!StringToUInt(device_hours, &dev_hours)) + return "Invalid device hours"; + + string error; + m_rdm_api.SetDeviceHours( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + dev_hours, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the lamp hours section. + */ +string RDMHttpModule::GetLampHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetLampHours( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUIntHandler, + response, + string("Lamp Hours")), + &error); + return error; + (void) request; +} + + +/** + * Set the lamp hours + */ +string RDMHttpModule::SetLampHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string lamp_hours_str = request->GetParameter(GENERIC_UINT_FIELD); + uint32_t lamp_hours; + + if (!StringToUInt(lamp_hours_str, &lamp_hours)) + return "Invalid lamp hours"; + + string error; + m_rdm_api.SetLampHours( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + lamp_hours, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the lamp strikes section + */ +string RDMHttpModule::GetLampStrikes(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetLampStrikes( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUIntHandler, + response, + string("Lamp Strikes")), + &error); + return error; + (void) request; +} + + +/** + * Set the lamp strikes + */ +string RDMHttpModule::SetLampStrikes(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string lamp_strikes_str = request->GetParameter(GENERIC_UINT_FIELD); + uint32_t lamp_strikes; + + if (!StringToUInt(lamp_strikes_str, &lamp_strikes)) + return "Invalid lamp strikes"; + + string error; + m_rdm_api.SetLampStrikes( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + lamp_strikes, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the lamp state section + */ +string RDMHttpModule::GetLampState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetLampState( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::LampStateHandler, + response), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to lamp state call and build the response + */ +void RDMHttpModule::LampStateHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t state) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + SelectItem *item = new SelectItem("Lamp State", GENERIC_UINT_FIELD); + + typedef struct { + string label; + ola::rdm::rdm_lamp_state state; + } values_s; + + values_s possible_values[] = { + {"Off", ola::rdm::LAMP_OFF}, + {"On", ola::rdm::LAMP_ON}, + {"Strike", ola::rdm::LAMP_STRIKE}, + {"Standby", ola::rdm::LAMP_STANDBY}}; + + for (unsigned int i = 0; i != sizeof(possible_values) / sizeof(values_s); + ++i) { + item->AddItem(possible_values[i].label, possible_values[i].state); + if (state == possible_values[i].state) + item->SetSelectedOffset(i); + } + + section.AddItem(item); + RespondWithSection(response, section); +} + + +/** + * Set the lamp state + */ +string RDMHttpModule::SetLampState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string lamp_state_str = request->GetParameter(GENERIC_UINT_FIELD); + uint8_t lamp_state; + if (!StringToUInt8(lamp_state_str, &lamp_state)) { + return "Invalid lamp state"; + } + + string error; + m_rdm_api.SetLampState( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + lamp_state, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the lamp mode section + */ +string RDMHttpModule::GetLampMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetLampMode( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::LampModeHandler, + response), + &error); + return error; + (void) request; +} + + +/** + * Handle the response to lamp mode call and build the response + */ +void RDMHttpModule::LampModeHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t mode) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + SelectItem *item = new SelectItem("Lamp Mode", GENERIC_UINT_FIELD); + + typedef struct { + string label; + ola::rdm::rdm_lamp_mode mode; + } values_s; + + values_s possible_values[] = { + {"Off", ola::rdm::LAMP_ON_MODE_OFF}, + {"DMX", ola::rdm::LAMP_ON_MODE_DMX}, + {"On", ola::rdm::LAMP_ON_MODE_ON}, + {"On After Calibration", ola::rdm::LAMP_ON_MODE_AFTER_CAL}}; + + for (unsigned int i = 0; i != sizeof(possible_values) / sizeof(values_s); + ++i) { + item->AddItem(possible_values[i].label, possible_values[i].mode); + if (mode == possible_values[i].mode) + item->SetSelectedOffset(i); + } + + section.AddItem(item); + RespondWithSection(response, section); +} + + +/** + * Set the lamp mode + */ +string RDMHttpModule::SetLampMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string lamp_mode_str = request->GetParameter(GENERIC_UINT_FIELD); + uint8_t lamp_mode; + if (!StringToUInt8(lamp_mode_str, &lamp_mode)) { + return "Invalid lamp mode"; + } + + string error; + m_rdm_api.SetLampMode( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + lamp_mode, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the device power cycles section + */ +string RDMHttpModule::GetPowerCycles(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDevicePowerCycles( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUIntHandler, + response, + string("Device Power Cycles")), + &error); + return error; + (void) request; +} + + +/** + * Set the device power cycles + */ +string RDMHttpModule::SetPowerCycles(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string power_cycles_str = request->GetParameter(GENERIC_UINT_FIELD); + uint32_t power_cycles; + + if (!StringToUInt(power_cycles_str, &power_cycles)) + return "Invalid power cycles"; + + string error; + m_rdm_api.SetDevicePowerCycles( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + power_cycles, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + + +/** + * Handle the request for the display invert section. + */ +string RDMHttpModule::GetDisplayInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDisplayInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::DisplayInvertHandler, + response), + &error); + return error; +} + + +/** + * Handle the response to display invert call and build the response + */ +void RDMHttpModule::DisplayInvertHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + SelectItem *item = new SelectItem("Display Invert", DISPLAY_INVERT_FIELD); + + item->AddItem("Off", ola::rdm::DISPLAY_INVERT_OFF); + item->AddItem("On", ola::rdm::DISPLAY_INVERT_ON); + item->AddItem("Auto", ola::rdm::DISPLAY_INVERT_AUTO); + + if (value <= ola::rdm::DISPLAY_INVERT_AUTO) + item->SetSelectedOffset(value); + + section.AddItem(item); + RespondWithSection(response, section); +} + + +/** + * Set the display invert. + */ +string RDMHttpModule::SetDisplayInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string invert_field = request->GetParameter(DISPLAY_INVERT_FIELD); + uint8_t display_mode; + if (!StringToUInt8(invert_field, &display_mode)) { + return "Invalid display mode"; + } + + string error; + m_rdm_api.SetDisplayInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + display_mode, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the display level section. + */ +string RDMHttpModule::GetDisplayLevel(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetDisplayLevel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::DisplayLevelHandler, + response), + &error); + return error; +} + + +/** + * Handle the response to display level call and build the response + */ +void RDMHttpModule::DisplayLevelHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + UIntItem *item = new UIntItem("Display Level", value, GENERIC_UINT_FIELD); + item->SetMin(0); + item->SetMax(255); + + section.AddItem(item); + RespondWithSection(response, section); +} + + +/** + * Set the display level. + */ +string RDMHttpModule::SetDisplayLevel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string display_level_str = request->GetParameter(GENERIC_UINT_FIELD); + uint8_t display_level; + if (!StringToUInt8(display_level_str, &display_level)) { + return "Invalid display mode"; + } + + string error; + m_rdm_api.SetDisplayLevel( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + display_level, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the pan invert section. + */ +string RDMHttpModule::GetPanInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetPanInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUInt8BoolHandler, + response, + string("Pan Invert")), + &error); + return error; +} + + +/** + * Set the pan invert. + */ +string RDMHttpModule::SetPanInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string mode = request->GetParameter(GENERIC_BOOL_FIELD); + string error; + m_rdm_api.SetPanInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + mode == "1", + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the tilt invert section. + */ +string RDMHttpModule::GetTiltInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetTiltInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUInt8BoolHandler, + response, + string("Tilt Invert")), + &error); + return error; +} + + +/** + * Set the tilt invert. + */ +string RDMHttpModule::SetTiltInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string mode = request->GetParameter(GENERIC_BOOL_FIELD); + string error; + m_rdm_api.SetTiltInvert( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + mode == "1", + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the pan/tilt swap section. + */ +string RDMHttpModule::GetPanTiltSwap(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetPanTiltSwap( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericUInt8BoolHandler, + response, + string("Pan Tilt Swap")), + &error); + return error; +} + + +/** + * Set the pan/tilt swap. + */ +string RDMHttpModule::SetPanTiltSwap(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string mode = request->GetParameter(GENERIC_BOOL_FIELD); + string error; + m_rdm_api.SetPanTiltSwap( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + mode == "1", + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the clock section. + */ +string RDMHttpModule::GetClock(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetClock( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::ClockHandler, + response), + &error); + return error; +} + + +/** + * Handle the response to clock call and build the response + */ +void RDMHttpModule::ClockHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const ola::rdm::ClockValue &clock) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + stringstream str; + str << std::setfill('0') << std::setw(2) << static_cast(clock.hour) << + ":" << std::setw(2) << static_cast(clock.minute) << ":" << + std::setw(2) << static_cast(clock.second) << " " << + static_cast(clock.day) << "/" << static_cast(clock.month) << "/" + << clock.year; + + section.AddItem(new StringItem("Clock", str.str())); + RespondWithSection(response, section); +} + + +/** + * Handle the request for the identify mode section. + */ +string RDMHttpModule::GetIdentifyMode(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetIdentifyMode( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::GenericBoolHandler, + response, + string("Identify Mode")), + &error); + return error; +} + + +/* + * Set the idenify mode + */ +string RDMHttpModule::SetIdentifyMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string mode = request->GetParameter(GENERIC_BOOL_FIELD); + string error; + m_rdm_api.IdentifyDevice( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + mode == "1", + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Handle the request for the power state section. + */ +string RDMHttpModule::GetPowerState(HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string error; + m_rdm_api.GetPowerState( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + NewSingleCallback(this, + &RDMHttpModule::PowerStateHandler, + response), + &error); + return error; +} + + +/** + * Handle the response to power state call and build the response + */ +void RDMHttpModule::PowerStateHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + SelectItem *item = new SelectItem("Power State", GENERIC_UINT_FIELD); + + typedef struct { + string label; + ola::rdm::rdm_power_state state; + } values_s; + + values_s possible_values[] = { + {"Full Off", ola::rdm::POWER_STATE_FULL_OFF}, + {"Shutdown", ola::rdm::POWER_STATE_SHUTDOWN}, + {"Standby", ola::rdm::POWER_STATE_STANDBY}, + {"Normal", ola::rdm::POWER_STATE_NORMAL}}; + + for (unsigned int i = 0; i != sizeof(possible_values) / sizeof(values_s); + ++i) { + item->AddItem(possible_values[i].label, possible_values[i].state); + if (value == possible_values[i].state) + item->SetSelectedOffset(i); + } + + section.AddItem(item); + RespondWithSection(response, section); +} + + +/* + * Set the power state. + */ +string RDMHttpModule::SetPowerState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid) { + string power_state_str = request->GetParameter(GENERIC_UINT_FIELD); + uint8_t power_state; + ola::rdm::rdm_power_state power_state_enum; + if (!StringToUInt8(power_state_str, &power_state) || + !ola::rdm::UIntToPowerState(power_state, &power_state_enum)) { + return "Invalid power state"; + } + + string error; + m_rdm_api.SetPowerState( + universe_id, + uid, + ola::rdm::ROOT_RDM_DEVICE, + power_state_enum, + NewSingleCallback(this, + &RDMHttpModule::SetHandler, + response), + &error); + return error; +} + + +/** + * Check if the id url param exists and is valid. + */ +bool RDMHttpModule::CheckForInvalidId(const HttpRequest *request, + unsigned int *universe_id) { + string uni_id = request->GetParameter(ID_KEY); + if (!StringToUInt(uni_id, universe_id)) { + OLA_INFO << "Invalid universe id: " << uni_id; + return false; + } + return true; +} + + +/** + * Check that the uid url param exists and is valid. + */ +bool RDMHttpModule::CheckForInvalidUid(const HttpRequest *request, + UID **uid) { + string uid_string = request->GetParameter(UID_KEY); + *uid = UID::FromString(uid_string); + if (*uid == NULL) { + OLA_INFO << "Invalid uid: " << uid_string; + return false; + } + return true; +} + + +/* + * Check the response to a Set RDM call and build the response. + */ +void RDMHttpModule::SetHandler( + HttpResponse *response, + const ola::rdm::ResponseStatus &status) { + string error; + CheckForRDMSuccessWithError(status, &error); + RespondWithError(response, error); +} + + +/* + * Build a response to a RDM call that returns a uint32_t + */ +void RDMHttpModule::GenericUIntHandler(HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + uint32_t value) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + section.AddItem(new UIntItem(description, value, GENERIC_UINT_FIELD)); + RespondWithSection(response, section); +} + + +/* + * Build a response to a RDM call that returns a bool + */ +void RDMHttpModule::GenericUInt8BoolHandler( + HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + uint8_t value) { + GenericBoolHandler(response, description, status, value > 0); +} + + +/* + * Build a response to a RDM call that returns a bool + */ +void RDMHttpModule::GenericBoolHandler(HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + bool value) { + if (CheckForRDMError(response, status)) + return; + + JsonSection section; + section.AddItem(new BoolItem(description, value, GENERIC_BOOL_FIELD)); + RespondWithSection(response, section); +} + +/** + * Check for an RDM error, and if it occurs, return a json response. + * @return true if an error occured. + */ +bool RDMHttpModule::CheckForRDMError(HttpResponse *response, + const ola::rdm::ResponseStatus &status) { + string error; + if (!CheckForRDMSuccessWithError(status, &error)) { + RespondWithError(response, error); + return true; + } + return false; +} + + + +int RDMHttpModule::RespondWithError(HttpResponse *response, + const string &error) { + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("{\"error\": \"" + error + "\"}"); + int r = response->Send(); + delete response; + return r; +} + + +/** + * Build & send a response from a JsonSection + */ +void RDMHttpModule::RespondWithSection(HttpResponse *response, + const ola::web::JsonSection §ion) { + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append(section.AsString()); + response->Send(); + delete response; +} + + +/* + * Check the success of an RDM command + * @returns true if this command was ok, false otherwise. + */ +bool RDMHttpModule::CheckForRDMSuccess( + const ola::rdm::ResponseStatus &status) { + string error; + if (!CheckForRDMSuccessWithError(status, &error)) { + OLA_INFO << error; + return false; + } + return true; +} + + +/* + * Check the success of an RDM command + * @returns true if this command was ok, false otherwise. + */ +bool RDMHttpModule::CheckForRDMSuccessWithError( + const ola::rdm::ResponseStatus &status, + string *error) { + stringstream str; + switch (status.ResponseType()) { + case ola::rdm::ResponseStatus::TRANSPORT_ERROR: + str << "RDM command error: " << status.Error(); + if (error) + *error = str.str(); + return false; + case ola::rdm::ResponseStatus::BROADCAST_REQUEST: + return false; + case ola::rdm::ResponseStatus::REQUEST_NACKED: + str << "Request was NACKED with code: " << + ola::rdm::NackReasonToString(status.NackReason()); + if (error) + *error = str.str(); + return false; + case ola::rdm::ResponseStatus::MALFORMED_RESPONSE: + str << "Malformed RDM response " << status.Error(); + if (error) + *error = str.str(); + return false; + case ola::rdm::ResponseStatus::VALID_RESPONSE: + return true; + default: + str << "Unknown response status " << + static_cast(status.ResponseType()); + if (error) + *error = str.str(); + return false; + } +} + + +/* + * Handle the RDM discovery response + * @param response the HttpResponse that is associated with the request. + * @param error an error string. + */ +void RDMHttpModule::HandleBoolResponse(HttpResponse *response, + const string &error) { + if (!error.empty()) { + m_server->ServeError(response, error); + return; + } + response->SetContentType(HttpServer::CONTENT_TYPE_PLAIN); + response->Append("ok"); + response->Send(); + delete response; +} + + +/** + * Add a section to the supported section list + */ +void RDMHttpModule::AddSection(vector *sections, + const string §ion_id, + const string §ion_name, + const string &hint) { + section_info info = {section_id, section_name, hint}; + sections->push_back(info); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.h b/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.h new file mode 100644 index 0000000..f598484 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/RDMHttpModule.h @@ -0,0 +1,563 @@ +/* + * 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 Library 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. + * + * RDMHttpModule.h + * This module acts as the http -> olad gateway for RDM commands. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef OLAD_RDMHTTPMODULE_H_ +#define OLAD_RDMHTTPMODULE_H_ + +#include +#include +#include +#include +#include "ola/OlaCallbackClient.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/UID.h" +#include "ola/web/JsonSections.h" +#include "olad/HttpModule.h" +#include "olad/HttpServer.h" + +namespace ola { + +using std::string; +using ola::rdm::UID; + + +/* + * The module that deals with RDM requests. + */ +class RDMHttpModule: public HttpModule { + public: + RDMHttpModule(HttpServer *http_server, + class OlaCallbackClient *client); + ~RDMHttpModule(); + + int RunRDMDiscovery(const HttpRequest *request, HttpResponse *response); + + int JsonUIDs(const HttpRequest *request, HttpResponse *response); + int JsonSupportedPIDs(const HttpRequest *request, HttpResponse *response); + int JsonSupportedSections(const HttpRequest *request, + HttpResponse *response); + int JsonSectionInfo(const HttpRequest *request, + HttpResponse *response); + int JsonSaveSectionInfo(const HttpRequest *request, + HttpResponse *response); + + void PruneUniverseList(const vector &universes); + + private: + typedef struct { + string manufacturer; + string device; + bool active; + } resolved_uid; + + typedef enum { + RESOLVE_MANUFACTURER, + RESOLVE_DEVICE, + } uid_resolve_action; + + typedef struct { + map resolved_uids; + std::queue > pending_uids; + bool uid_resolution_running; + bool active; + } uid_resolution_state; + + HttpServer *m_server; + class OlaCallbackClient *m_client; + ola::rdm::RDMAPI m_rdm_api; + map m_universe_uids; + + typedef struct { + string id; + string name; + string hint; + } section_info; + + struct lt_section_info { + bool operator()(const section_info &left, const section_info &right) { + return left.name < right.name; + } + }; + + typedef struct { + unsigned int universe_id; + const UID uid; + string hint; + string device_model; + string software_version; + } device_info; + + typedef struct { + unsigned int universe_id; + const UID *uid; + bool include_descriptions; + unsigned int active; + unsigned int next; + unsigned int total; + vector > personalities; + } personality_info; + + RDMHttpModule(const RDMHttpModule&); + RDMHttpModule& operator=(const RDMHttpModule&); + + // uid resolution methods + void HandleUIDList(HttpResponse *response, + unsigned int universe_id, + const ola::rdm::UIDSet &uids, + const string &error); + + void ResolveNextUID(unsigned int universe_id); + + void UpdateUIDManufacturerLabel(unsigned int universe, + UID uid, + const ola::rdm::ResponseStatus &status, + const string &device_label); + + void UpdateUIDDeviceLabel(unsigned int universe, + UID uid, + const ola::rdm::ResponseStatus &status, + const string &device_label); + + uid_resolution_state *GetUniverseUids(unsigned int universe); + uid_resolution_state *GetUniverseUidsOrCreate(unsigned int universe); + + // supported params / sections + void SupportedParamsHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const vector &pids); + void SupportedSectionsHandler(HttpResponse *response, + unsigned int universe, + UID uid, + const ola::rdm::ResponseStatus &status, + const vector &pids); + void SupportedSectionsDeviceInfoHandler( + HttpResponse *response, + const vector pids, + const ola::rdm::ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device); + + // section methods + string GetDeviceInfo(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetSoftwareVersionHandler(HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const string &software_version); + + void GetDeviceModelHandler(HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const string &device_model); + + void GetDeviceInfoHandler(HttpResponse *response, + device_info dev_info, + const ola::rdm::ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device); + + string GetProductIds(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetProductIdsHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const vector &ids); + + string GetManufacturerLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetManufacturerLabelHandler(HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label); + + string GetDeviceLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetDeviceLabelHandler(HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label); + + string SetDeviceLabel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetFactoryDefaults(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void FactoryDefaultsHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + bool defaults); + + string SetFactoryDefault(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetLanguage(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetSupportedLanguagesHandler(HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const vector &languages); + + void GetLanguageHandler(HttpResponse *response, + vector languages, + const ola::rdm::ResponseStatus &status, + const string &language); + + string SetLanguage(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetBootSoftware(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetBootSoftwareLabelHandler(HttpResponse *response, + unsigned int universe_id, + const UID uid, + const ola::rdm::ResponseStatus &status, + const string &label); + + void GetBootSoftwareVersionHandler( + HttpResponse *response, + string label, + const ola::rdm::ResponseStatus &status, + uint32_t version); + + string GetPersonalities(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetPersonalityHandler( + HttpResponse *response, + personality_info *info, + const ola::rdm::ResponseStatus &status, + uint8_t current, + uint8_t total); + + void GetNextPersonalityDescription(HttpResponse *response, + personality_info *info); + + void GetPersonalityLabelHandler( + HttpResponse *response, + personality_info *info, + const ola::rdm::ResponseStatus &status, + uint8_t personality, + uint16_t slot_count, + const string &label); + + void SendPersonalityResponse(HttpResponse *response, + personality_info *info); + + string SetPersonality(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetStartAddress(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void GetStartAddressHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint16_t address); + + string SetStartAddress(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetSensor(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void SensorDefinitionHandler(HttpResponse *response, + unsigned int universe_id, + const UID uid, + uint8_t sensor_id, + const ola::rdm::ResponseStatus &status, + const ola::rdm::SensorDescriptor &definition); + + void SensorValueHandler(HttpResponse *response, + ola::rdm::SensorDescriptor *definition, + const ola::rdm::ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &value); + + string RecordSensor(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetDeviceHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetDeviceHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetLampHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetLampHours(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetLampStrikes(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetLampStrikes(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetLampState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void LampStateHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t state); + + string SetLampState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetLampMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void LampModeHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t mode); + + string SetLampMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetPowerCycles(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetPowerCycles(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetDisplayInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void DisplayInvertHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value); + + string SetDisplayInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetDisplayLevel(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void DisplayLevelHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value); + + string SetDisplayLevel(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetPanInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetPanInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetTiltInvert(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetTiltInvert(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetPanTiltSwap(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetPanTiltSwap(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetClock(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void ClockHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + const ola::rdm::ClockValue &clock); + + string GetIdentifyMode(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string SetIdentifyMode(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + string GetPowerState(HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + void PowerStateHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status, + uint8_t value); + + string SetPowerState(const HttpRequest *request, + HttpResponse *response, + unsigned int universe_id, + const UID &uid); + + // util methods + bool CheckForInvalidId(const HttpRequest *request, + unsigned int *universe_id); + + bool CheckForInvalidUid(const HttpRequest *request, UID **uid); + + void SetHandler(HttpResponse *response, + const ola::rdm::ResponseStatus &status); + + void GenericUIntHandler(HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + uint32_t value); + + void GenericUInt8BoolHandler(HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + uint8_t value); + void GenericBoolHandler(HttpResponse *response, + string description, + const ola::rdm::ResponseStatus &status, + bool value); + + bool CheckForRDMError(HttpResponse *response, + const ola::rdm::ResponseStatus &status); + int RespondWithError(HttpResponse *response, const string &error); + void RespondWithSection(HttpResponse *response, + const ola::web::JsonSection §ion); + + bool CheckForRDMSuccess(const ola::rdm::ResponseStatus &status); + bool CheckForRDMSuccessWithError(const ola::rdm::ResponseStatus &status, + string *error); + + void HandleBoolResponse(HttpResponse *response, const string &error); + + void AddSection(vector *sections, + const string §ion_id, + const string §ion_name, + const string &hint=""); + + static const uint32_t INVALID_PERSONALITY = 0xffff; + static const char BACKEND_DISCONNECTED_ERROR[]; + + static const char HINT_KEY[]; + static const char ID_KEY[]; + static const char SECTION_KEY[]; + static const char UID_KEY[]; + + static const char ADDRESS_FIELD[]; + static const char DISPLAY_INVERT_FIELD[]; + static const char GENERIC_BOOL_FIELD[]; + static const char GENERIC_STRING_FIELD[]; + static const char GENERIC_UINT_FIELD[]; + static const char IDENTIFY_FIELD[]; + static const char LABEL_FIELD[]; + static const char LANGUAGE_FIELD[]; + static const char RECORD_SENSOR_FIELD[]; + + static const char BOOT_SOFTWARE_SECTION[]; + static const char CLOCK_SECTION[]; + static const char DEVICE_HOURS_SECTION[]; + static const char DEVICE_INFO_SECTION[]; + static const char DEVICE_LABEL_SECTION[]; + static const char DISPLAY_INVERT_SECTION[]; + static const char DISPLAY_LEVEL_SECTION[]; + static const char DMX_ADDRESS_SECTION[]; + static const char FACTORY_DEFAULTS_SECTION[]; + static const char IDENTIFY_SECTION[]; + static const char LAMP_HOURS_SECTION[]; + static const char LAMP_MODE_SECTION[]; + static const char LAMP_STATE_SECTION[]; + static const char LAMP_STRIKES_SECITON[]; + static const char LANGUAGE_SECTION[]; + static const char MANUFACTURER_LABEL_SECTION[]; + static const char PAN_INVERT_SECTION[]; + static const char PAN_TILT_SWAP_SECTION[]; + static const char PERSONALITY_SECTION[]; + static const char POWER_CYCLES_SECTION[]; + static const char POWER_STATE_SECTION[]; + static const char PRODUCT_DETAIL_SECTION[]; + static const char SENSOR_SECTION[]; + static const char TILT_INVERT_SECTION[]; +}; +} // ola +#endif // OLAD_RDMHTTPMODULE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/TestCommon.h b/open-lighting-architecture/ola-0.8.4/olad/TestCommon.h new file mode 100644 index 0000000..fda5f3b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/TestCommon.h @@ -0,0 +1,178 @@ +/* + * 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 Library 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. + * + * UniverseTest.cpp + * Test fixture for the Universe and UniverseStore classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_TESTCOMMON_H_ +#define OLAD_TESTCOMMON_H_ +#include +#include + +#include "ola/Clock.h" +#include "ola/DmxBuffer.h" +#include "olad/Device.h" +#include "olad/Plugin.h" +#include "olad/Port.h" +#include "olad/PortManager.h" + +using ola::AbstractDevice; +using ola::DmxBuffer; +using ola::BasicInputPort; +using ola::BasicOutputPort; +using ola::TimeStamp; +using std::string; + + +/* + * Mock out an Input Port + */ +class TestMockInputPort: public BasicInputPort { + public: + TestMockInputPort(AbstractDevice *parent, + unsigned int port_id, + const TimeStamp *wake_time): + BasicInputPort(parent, port_id, wake_time) {} + ~TestMockInputPort() {} + + string Description() const { return ""; } + bool WriteDMX(const DmxBuffer &buffer) { + m_buffer = buffer; + return true; + } + const DmxBuffer &ReadDMX() const { return m_buffer; } + + private: + DmxBuffer m_buffer; +}; + + +/* + * Same as above but this supports priorities + */ +class TestMockPriorityInputPort: public TestMockInputPort { + public: + TestMockPriorityInputPort(AbstractDevice *parent, unsigned int port_id, + const TimeStamp *wake_time): + TestMockInputPort(parent, port_id, wake_time), + m_inherited_priority(ola::DmxSource::PRIORITY_DEFAULT) { + } + + uint8_t InheritedPriority() const { + return m_inherited_priority; + } + + void SetInheritedPriority(uint8_t priority) { + m_inherited_priority = priority; + } + + protected: + bool SupportsPriorities() const { return true; } + + private: + uint8_t m_inherited_priority; +}; + + +/* + * Mock out an OutputPort + */ +class TestMockOutputPort: public BasicOutputPort { + public: + TestMockOutputPort(AbstractDevice *parent, unsigned int port_id): + BasicOutputPort(parent, port_id) {} + ~TestMockOutputPort() {} + + string Description() const { return ""; } + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + m_buffer = buffer; + (void) priority; + return true; + } + const DmxBuffer &ReadDMX() const { return m_buffer; } + + private: + DmxBuffer m_buffer; +}; + + +/* + * Same as above but this supports priorities + */ +class TestMockPriorityOutputPort: public TestMockOutputPort { + public: + TestMockPriorityOutputPort(AbstractDevice *parent, unsigned int port_id): + TestMockOutputPort(parent, port_id) {} + protected: + bool SupportsPriorities() const { return true; } +}; + + +/* + * A mock device + */ +class MockDevice: public ola::Device { + public: + MockDevice(ola::AbstractPlugin *owner, const string &name): + Device(owner, name) {} + string DeviceId() const { return Name(); } + bool AllowLooping() const { return false; } + bool AllowMultiPortPatching() const { return false; } +}; + + +/* + * A mock device with looping and multiport patching enabled + */ +class MockDeviceLoopAndMulti: public ola::Device { + public: + MockDeviceLoopAndMulti(ola::AbstractPlugin *owner, const string &name): + Device(owner, name) {} + string DeviceId() const { return Name(); } + bool AllowLooping() const { return true; } + bool AllowMultiPortPatching() const { return true; } +}; +/* + * A mock plugin. + */ +class TestMockPlugin: public ola::Plugin { + public: + explicit TestMockPlugin(const ola::PluginAdaptor *plugin_adaptor, + ola::ola_plugin_id plugin_id, + bool should_start = true): + Plugin(plugin_adaptor), + m_start_run(false), + m_should_start(should_start), + m_id(plugin_id) {} + bool ShouldStart() { return m_should_start; } + bool StartHook() { + m_start_run = true; + return true; + } + string Name() const { return "foo"; } + string Description() const { return "bar"; } + ola::ola_plugin_id Id() const { return m_id; } + string PluginPrefix() const { return "test"; } + + bool WasStarted() { return m_start_run; } + + private: + bool m_start_run; + bool m_should_start; + ola::ola_plugin_id m_id; +}; +#endif // OLAD_TESTCOMMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/Universe.cpp b/open-lighting-architecture/ola-0.8.4/olad/Universe.cpp new file mode 100644 index 0000000..4be6f43 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/Universe.cpp @@ -0,0 +1,781 @@ +/* + * 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 Library 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. + * + * Universe.cpp + * Represents a universe of DMX data. + * Copyright (C) 2005-2009 Simon Newton + * + * Each universe has the following: + * A human readable name + * A DmxBuffer with the current dmx data + * A MergeMode, either LTP (latest takes precedence) or HTP (highest takes + * precedence) + * A list of ports bound to this universe. If a port is an input, we use the + * data to update the DmxBuffer according to the MergeMode. If a port is an + * output, we notify the port whenever the DmxBuffer changes. + * A list of source clients. which provide us with data for updating the + * DmxBuffer per the merge mode. + * A list of sink clients, which we update whenever the DmxBuffer changes. + */ + +#include +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/Client.h" +#include "olad/UniverseStore.h" +#include "olad/Port.h" +#include "olad/Universe.h" + +namespace ola { + +const char Universe::K_UNIVERSE_UID_COUNT_VAR[] = "universe-uids"; +const char Universe::K_FPS_VAR[] = "universe-dmx-frames"; +const char Universe::K_MERGE_HTP_STR[] = "htp"; +const char Universe::K_MERGE_LTP_STR[] = "ltp"; +const char Universe::K_UNIVERSE_INPUT_PORT_VAR[] = "universe-input-ports"; +const char Universe::K_UNIVERSE_MODE_VAR[] = "universe-mode"; +const char Universe::K_UNIVERSE_NAME_VAR[] = "universe-name"; +const char Universe::K_UNIVERSE_OUTPUT_PORT_VAR[] = "universe-output-ports"; +const char Universe::K_UNIVERSE_RDM_REQUESTS[] = "universe-rdm-requests"; +const char Universe::K_UNIVERSE_RDM_RESPONSES[] = "universe-rdm-responses"; +const char Universe::K_UNIVERSE_SINK_CLIENTS_VAR[] = "universe-sink-clients"; +const char Universe::K_UNIVERSE_SOURCE_CLIENTS_VAR[] = + "universe-source-clients"; + +/* + * Create a new universe + * @param uid the universe id of this universe + * @param store the store this universe came from + * @param export_map the ExportMap that we update + */ +Universe::Universe(unsigned int universe_id, UniverseStore *store, + ExportMap *export_map) + : m_universe_name(""), + m_universe_id(universe_id), + m_active_priority(DmxSource::PRIORITY_MIN), + m_merge_mode(Universe::MERGE_LTP), + m_universe_store(store), + m_export_map(export_map) { + stringstream universe_id_str, universe_name_str; + universe_id_str << universe_id; + m_universe_id_str = universe_id_str.str(); + universe_name_str << "Universe " << universe_id; + m_universe_name = universe_name_str.str(); + + UpdateName(); + UpdateMode(); + + const char *vars[] = { + K_FPS_VAR, + K_UNIVERSE_INPUT_PORT_VAR, + K_UNIVERSE_OUTPUT_PORT_VAR, + K_UNIVERSE_RDM_REQUESTS, + K_UNIVERSE_RDM_RESPONSES, + K_UNIVERSE_SINK_CLIENTS_VAR, + K_UNIVERSE_SOURCE_CLIENTS_VAR, + K_UNIVERSE_UID_COUNT_VAR, + }; + + if (m_export_map) { + for (unsigned int i = 0; i < sizeof(vars) / sizeof(vars[0]); ++i) + (*m_export_map->GetUIntMapVar(vars[i]))[m_universe_id_str] = 0; + } +} + + +/* + * Delete this universe + */ +Universe::~Universe() { + const char *string_vars[] = { + K_UNIVERSE_NAME_VAR, + K_UNIVERSE_MODE_VAR, + }; + + const char *uint_vars[] = { + K_FPS_VAR, + K_UNIVERSE_INPUT_PORT_VAR, + K_UNIVERSE_OUTPUT_PORT_VAR, + K_UNIVERSE_RDM_REQUESTS, + K_UNIVERSE_RDM_RESPONSES, + K_UNIVERSE_SINK_CLIENTS_VAR, + K_UNIVERSE_SOURCE_CLIENTS_VAR, + K_UNIVERSE_UID_COUNT_VAR, + }; + + if (m_export_map) { + for (unsigned int i = 0; i < sizeof(string_vars) / sizeof(char*); ++i) + m_export_map->GetStringMapVar(string_vars[i])->Remove(m_universe_id_str); + for (unsigned int i = 0; i < sizeof(uint_vars) / sizeof(char*); ++i) + m_export_map->GetUIntMapVar(uint_vars[i])->Remove(m_universe_id_str); + } +} + + +/* + * Set the universe name + * @param name the new universe name + */ +void Universe::SetName(const string &name) { + m_universe_name = name; + UpdateName(); + + // notify ports + vector::const_iterator iter; + for (iter = m_output_ports.begin(); iter != m_output_ports.end(); ++iter) { + (*iter)->UniverseNameChanged(name); + } +} + + +/* + * Set the universe merge mode + * @param merge_mode the new merge_mode + */ +void Universe::SetMergeMode(enum merge_mode merge_mode) { + m_merge_mode = merge_mode; + UpdateMode(); +} + + +/* + * Add an InputPort to this universe. + * @param port the port to add + */ +bool Universe::AddPort(InputPort *port) { + return GenericAddPort(port, &m_input_ports); +} + + +/* + * Add an OutputPort to this universe. + * @param port the port to add + */ +bool Universe::AddPort(OutputPort *port) { + return GenericAddPort(port, &m_output_ports); +} + + +/* + * Remove a port from this universe. + * @param port the port to remove + * @return true if the port was removed, false if it didn't exist + */ +bool Universe::RemovePort(InputPort *port) { + return GenericRemovePort(port, &m_input_ports, &m_input_uids); +} + + +/* + * Remove a port from this universe. + * @param port the port to remove + * @return true if the port was removed, false if it didn't exist + */ +bool Universe::RemovePort(OutputPort *port) { + bool ret = GenericRemovePort(port, &m_output_ports, &m_output_uids); + + if (m_export_map) + (*m_export_map->GetUIntMapVar(K_UNIVERSE_UID_COUNT_VAR))[m_universe_id_str] + = m_output_uids.size(); + return ret; +} + + +/* + * Check if this port is bound to this universe + * @param port the port to check for + * @return true if the port exists in this universe, false otherwise + */ +bool Universe::ContainsPort(InputPort *port) const { + return GenericContainsPort(port, m_input_ports); +} + + +/* + * Check if this port is bound to this universe + * @param port the port to check for + * @return true if the port exists in this universe, false otherwise + */ +bool Universe::ContainsPort(OutputPort *port) const { + return GenericContainsPort(port, m_output_ports); +} + + +/* + * Get a list of input ports associated with this universe + * @param ports, the vector to be populated + */ +void Universe::InputPorts(vector *ports) { + ports->clear(); + std::copy(m_input_ports.begin(), m_input_ports.end(), + std::back_inserter(*ports)); +} + + +/* + * Get a list of output ports associated with this universe + * @param ports, the vector to be populated + */ +void Universe::OutputPorts(vector *ports) { + ports->clear(); + std::copy(m_output_ports.begin(), m_output_ports.end(), + std::back_inserter(*ports)); +} + + +/* + * Add a client as a source for this universe + * @param client the client to add + */ +bool Universe::AddSourceClient(Client *client) { + if (ContainsSourceClient(client)) + return false; + return AddClient(client, true); +} + + +/* + * Remove a client as a source for this universe + * @param client the client to remove + */ +bool Universe::RemoveSourceClient(Client *client) { + return RemoveClient(client, true); +} + + +/* + * Check if this universe contains a client as a source + * @param client the client to check for + * @returns true if this universe contains the client, false otherwise + */ +bool Universe::ContainsSourceClient(Client *client) const { + return find(m_source_clients.begin(), m_source_clients.end(), client) != + m_source_clients.end(); +} + + +/* + * Add a client as a sink for this universe + * @param client the client to add + */ +bool Universe::AddSinkClient(Client *client) { + if (ContainsSinkClient(client)) + return false; + return AddClient(client, false); +} + + +/* + * Remove a client as a sink for this universe + * @param client the client to remove + */ +bool Universe::RemoveSinkClient(Client *client) { + return RemoveClient(client, false); +} + +/* + * Check if this universe contains a client as a sink + * @param client the client to check for + * @returns true if this universe contains the client, false otherwise + */ +bool Universe::ContainsSinkClient(Client *client) const { + return find(m_sink_clients.begin(), m_sink_clients.end(), client) != + m_sink_clients.end(); +} + + +/* + * Set the dmx data for this universe, this overrides anything from the clients + * or ports but will be overridden in the next update. + * @param buffer the dmx buffer with the data + * @return true is we updated all ports/clients, false otherwise + */ +bool Universe::SetDMX(const DmxBuffer &buffer) { + if (!buffer.Size()) { + OLA_INFO << "Trying to SetDMX with a 0 length dmx buffer, universe " << + UniverseId(); + return true; + } + m_buffer.Set(buffer); + return UpdateDependants(); +} + + +/* + * Call this when the dmx in a port that is part of this universe changes + * @param port the port that has changed + */ +bool Universe::PortDataChanged(InputPort *port) { + if (!ContainsPort(port)) { + OLA_INFO << "Trying to update a port which isn't bound to universe: " + << UniverseId(); + return false; + } + if (MergeAll(port, NULL)) + UpdateDependants(); + return true; +} + + +/* + * Called to indicate that data from a client has changed + */ +bool Universe::SourceClientDataChanged(Client *client) { + if (!client) + return false; + + AddSourceClient(client); // always add since this may be the first call + if (MergeAll(NULL, client)) + UpdateDependants(); + return true; +} + + +/* + * Handle a RDM request for this universe, ownership of the request object is + * transferred to this method. + * @returns true if this request was sent to an Output port, false otherwise + */ +bool Universe::HandleRDMRequest(InputPort *port, + const ola::rdm::RDMRequest *request) { + OLA_INFO << "Got a RDM request for " << request->DestinationUID() << + " with command " << std::hex << request->CommandClass() << " and param " << + request->ParamId(); + + // populate the input UID map so we know how to route this request later + m_input_uids[request->SourceUID()] = port; + + if (m_export_map) + (*m_export_map->GetUIntMapVar(K_UNIVERSE_RDM_REQUESTS))[ + m_universe_id_str]++; + + if (request->DestinationUID().IsBroadcast()) { + // send this request to all ports + vector::iterator port_iter; + for (port_iter = m_output_ports.begin(); port_iter != m_output_ports.end(); + ++port_iter) { + // because each port deletes the request, we need to copy it here + (*port_iter)->HandleRDMRequest(request->Duplicate()); + } + delete request; + return true; + + } else { + map::iterator iter = + m_output_uids.find(request->DestinationUID()); + + if (iter == m_output_uids.end()) { + OLA_WARN << "Can't find UID " << request->DestinationUID() << + " in the output universe map, dropping request"; + delete request; + return false; + } else { + iter->second->HandleRDMRequest(request); + } + } + return true; +} + + +/* + * Handle a RDM response + */ +bool Universe::HandleRDMResponse(OutputPort *port, + const ola::rdm::RDMResponse *response) { + OLA_INFO << "Got a RDM response for " << response->DestinationUID() << + " with command " << std::hex << response->CommandClass() << " and param " + << response->ParamId(); + + map::iterator iter = + m_input_uids.find(response->DestinationUID()); + + if (m_export_map) + (*m_export_map->GetUIntMapVar(K_UNIVERSE_RDM_RESPONSES))[ + m_universe_id_str]++; + + if (iter == m_input_uids.end()) { + OLA_WARN << "Can't find UID " << response->DestinationUID() << + " in the input universe map, dropping response"; + delete response; + return false; + } else { + return iter->second->HandleRDMResponse(response); + } + (void) port; +} + + +/* + * Trigger RDM discovery for this universe + */ +void Universe::RunRDMDiscovery() { + OLA_INFO << "RDM discovery triggered for universe " << m_universe_id; + + vector::iterator iter; + for (iter = m_output_ports.begin(); iter != m_output_ports.end(); ++iter) + (*iter)->RunRDMDiscovery(); + + // somehow detect when this is done and then send new UIDSets +} + + +/* + * Returns the complete UIDSet for this universe + */ +void Universe::GetUIDs(ola::rdm::UIDSet *uids) const { + map::const_iterator iter = m_output_uids.begin(); + for (; iter != m_output_uids.end(); ++iter) + uids->AddUID(iter->first); +} + + +/** + * Return the number of uids in the universe + */ +unsigned int Universe::UIDCount() const { + return m_output_uids.size(); +} + + +/* + * Update the UID : port mapping with this new data + */ +void Universe::NewUIDList(const ola::rdm::UIDSet &uids, OutputPort *port) { + map::iterator iter = m_output_uids.begin(); + while (iter != m_output_uids.end()) { + if (iter->second == port && !uids.Contains(iter->first)) + m_output_uids.erase(iter++); + else + ++iter; + } + + ola::rdm::UIDSet::Iterator set_iter = uids.Begin(); + for (; set_iter != uids.End(); ++set_iter) { + iter = m_output_uids.find(*set_iter); + if (iter == m_output_uids.end()) { + m_output_uids[*set_iter] = port; + } else if (iter->second != port) { + OLA_WARN << "UID " << *set_iter << " seen on more than one port"; + } + } + + if (m_export_map) + (*m_export_map->GetUIntMapVar(K_UNIVERSE_UID_COUNT_VAR))[m_universe_id_str] + = m_output_uids.size(); +} + + +/* + * Return true if this universe is in use (has at least one port or client). + */ +bool Universe::IsActive() const { + return (m_input_ports.size() || m_output_ports.size() || + m_source_clients.size() || m_sink_clients.size()); +} + + +// Private Methods +//----------------------------------------------------------------------------- + + +/* + * Called when the dmx data for this universe changes, + * updates everyone who needs to know (patched ports and network clients) + */ +bool Universe::UpdateDependants() { + vector::const_iterator iter; + set::const_iterator client_iter; + + // write to all ports assigned to this unviverse + for (iter = m_output_ports.begin(); iter != m_output_ports.end(); ++iter) { + (*iter)->WriteDMX(m_buffer, m_active_priority); + } + + // write to all clients + for (client_iter = m_sink_clients.begin(); + client_iter != m_sink_clients.end(); + ++client_iter) { + (*client_iter)->SendDMX(m_universe_id, m_buffer); + } + + if (m_export_map) + (*m_export_map->GetUIntMapVar(K_FPS_VAR))[m_universe_id_str]++; + return true; +} + + +/* + * Update the name in the export map. + */ +void Universe::UpdateName() { + if (!m_export_map) + return; + StringMap *name_map = m_export_map->GetStringMapVar(K_UNIVERSE_NAME_VAR); + (*name_map)[m_universe_id_str] = m_universe_name; +} + + +/* + * Update the mode in the export map. + */ +void Universe::UpdateMode() { + if (!m_export_map) + return; + StringMap *mode_map = m_export_map->GetStringMapVar(K_UNIVERSE_MODE_VAR); + (*mode_map)[m_universe_id_str] = (m_merge_mode == Universe::MERGE_LTP ? + K_MERGE_LTP_STR : K_MERGE_HTP_STR); +} + + +/* + * Add this client to this universe + * @param client the client to add + * @pre the client doesn't already exist in the set + */ +bool Universe::AddClient(Client *client, bool is_source) { + set &clients = is_source ? m_source_clients : m_sink_clients; + clients.insert(client); + OLA_INFO << "Added " << (is_source ? "source" : "sink") << " client, " << + client << " to universe " << m_universe_id; + + if (m_export_map) { + const string &map_name = is_source ? K_UNIVERSE_SOURCE_CLIENTS_VAR : + K_UNIVERSE_SINK_CLIENTS_VAR; + (*m_export_map->GetUIntMapVar(map_name))[m_universe_id_str]++; + } + return true; +} + + +/* + * Remove this client from the universe. After calling this method you need to + * check if this universe is still in use, and if not delete it + * @param client the client to remove + * @return true is this client was removed, false if it didn't exist + */ +bool Universe::RemoveClient(Client *client, bool is_source) { + set &clients = is_source ? m_source_clients : m_sink_clients; + set::iterator iter = find(clients.begin(), clients.end(), client); + + if (iter == clients.end()) + return false; + + clients.erase(iter); + if (m_export_map) { + const string &map_name = is_source ? K_UNIVERSE_SOURCE_CLIENTS_VAR : + K_UNIVERSE_SINK_CLIENTS_VAR; + (*m_export_map->GetUIntMapVar(map_name))[m_universe_id_str]--; + } + OLA_INFO << "Client " << client << " has been removed from uni " << + m_universe_id; + + if (!IsActive()) + m_universe_store->AddUniverseGarbageCollection(this); + return true; +} + + + +/* + * HTP Merge all sources (clients/ports) + * @pre sources.sizez >= 2 + * @param sources the list of DmxSources to merge + */ +void Universe::HTPMergeSources(const vector &sources) { + vector::const_iterator iter; + m_buffer.Reset(); + + for (iter = sources.begin(); iter != sources.end(); ++iter) { + m_buffer.HTPMerge(iter->Data()); + } +} + + +/* + * Merge all port/client sources. + * This does a priority based merge as documented at: + * http://opendmx.net/index.php/OLA_Merging_Algorithms + * @param port the input port that changed or NULL + * @param client the client that changed or NULL + * @returns true if the data for this universe changed, false otherwise + */ +bool Universe::MergeAll(const InputPort *port, const Client *client) { + vector active_sources; + + vector::const_iterator iter; + set::const_iterator client_iter; + + m_active_priority = DmxSource::PRIORITY_MIN; + TimeStamp now; + Clock::CurrentTime(&now); + bool changed_source_is_active = false; + + // Find the highest active ports + for (iter = m_input_ports.begin(); iter != m_input_ports.end(); ++iter) { + DmxSource source = (*iter)->SourceData(); + if (!source.IsSet() || !source.IsActive(now) || !source.Data().Size()) + continue; + + if (source.Priority() > m_active_priority) { + changed_source_is_active = false; + active_sources.clear(); + m_active_priority = source.Priority(); + } + + if (source.Priority() == m_active_priority) { + active_sources.push_back(source); + if (*iter == port) + changed_source_is_active = true; + } + } + + // find the highest active clients + for (client_iter = m_source_clients.begin(); + client_iter != m_source_clients.end(); + ++client_iter) { + const DmxSource &source = (*client_iter)->SourceData(UniverseId()); + + if (!source.IsSet() || !source.IsActive(now) || !source.Data().Size()) + continue; + + if (source.Priority() > m_active_priority) { + changed_source_is_active = false; + active_sources.clear(); + m_active_priority = source.Priority(); + } + + if (source.Priority() == m_active_priority) { + active_sources.push_back(source); + if (*client_iter == client) + changed_source_is_active = true; + } + } + + if (!active_sources.size()) { + OLA_WARN << "Something changed but we didn't find any active sources " << + " for universe " << UniverseId(); + return false; + } + + if (!changed_source_is_active) + // this source didn't have any effect, skip + return false; + + // only one source at the active priority + if (active_sources.size() == 1) { + m_buffer.Set(active_sources[0].Data()); + } else { + // multi source merge + if (m_merge_mode == Universe::MERGE_LTP) { + vector::const_iterator source_iter = active_sources.begin(); + DmxSource changed_source; + if (port) + changed_source = port->SourceData(); + else + changed_source = client->SourceData(UniverseId()); + + // check that the current port/client is newer than all other active + // sources + for (; source_iter != active_sources.end(); source_iter++) { + if (changed_source.Timestamp() < source_iter->Timestamp()) + return false; + } + // if we made it to here this is the newest source + m_buffer.Set(changed_source.Data()); + } else { + HTPMergeSources(active_sources); + } + } + return true; +} + + +/* + * Add an Input or Output port to this universe. + * @param port, the port to add + * @param ports, the vector of ports to add to + */ +template +bool Universe::GenericAddPort(PortClass *port, vector *ports) { + if (find(ports->begin(), ports->end(), port) != ports->end()) + return true; + + ports->push_back(port); + if (m_export_map) { + UIntMap *map = m_export_map->GetUIntMapVar( + IsInputPort() ? K_UNIVERSE_INPUT_PORT_VAR : + K_UNIVERSE_OUTPUT_PORT_VAR); + (*map)[m_universe_id_str]++; + } + return true; +} + + +/* + * Remove an Input or Output port from this universe. + * @param port, the port to add + * @param ports, the vector of ports to remove from + */ +template +bool Universe::GenericRemovePort(PortClass *port, + vector *ports, + map *uid_map) { + typename vector::iterator iter = + find(ports->begin(), ports->end(), port); + + if (iter == ports->end()) { + OLA_DEBUG << "Could not find port " << port->UniqueId() << " in universe " + << UniverseId(); + return true; + } + + ports->erase(iter); + if (m_export_map) { + UIntMap *map = m_export_map->GetUIntMapVar( + IsInputPort() ? K_UNIVERSE_INPUT_PORT_VAR : + K_UNIVERSE_OUTPUT_PORT_VAR); + (*map)[m_universe_id_str]--; + } + if (!IsActive()) + m_universe_store->AddUniverseGarbageCollection(this); + + // Remove any uids that mapped to this port + typename map::iterator uid_iter = uid_map->begin(); + while (uid_iter != uid_map->end()) { + if (uid_iter->second == port) + uid_map->erase(uid_iter++); + else + ++uid_iter; + } + return true; +} + + +/* + * Check if this universe contains a particular port. + * @param port, the port to add + * @param ports, the vector of ports to remove from + */ +template +bool Universe::GenericContainsPort(PortClass *port, + const vector &ports) const { + return find(ports.begin(), ports.end(), port) != ports.end(); +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.cpp b/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.cpp new file mode 100644 index 0000000..6a0d7df --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.cpp @@ -0,0 +1,223 @@ +/* + * 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 Library 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. + * + * UniverseStore.cpp + * The universe store class. This maintains the set of all active universes and + * saves the settings. + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + + +#include "ola/ExportMap.h" +#include "ola/Logging.h" +#include "olad/Preferences.h" +#include "olad/Universe.h" +#include "olad/UniverseStore.h" +namespace ola { + +using std::pair; + +UniverseStore::UniverseStore(Preferences *preferences, + ExportMap *export_map) + : m_preferences(preferences), + m_export_map(export_map) { + if (export_map) { + export_map->GetStringMapVar(Universe::K_UNIVERSE_NAME_VAR, "universe"); + export_map->GetStringMapVar(Universe::K_UNIVERSE_MODE_VAR, "universe"); + + const char *vars[] = { + Universe::K_FPS_VAR, + Universe::K_UNIVERSE_INPUT_PORT_VAR, + Universe::K_UNIVERSE_OUTPUT_PORT_VAR, + Universe::K_UNIVERSE_SINK_CLIENTS_VAR, + Universe::K_UNIVERSE_SOURCE_CLIENTS_VAR, + Universe::K_UNIVERSE_UID_COUNT_VAR, + }; + + for (unsigned int i = 0; i < sizeof(vars) / sizeof(vars[0]); ++i) + export_map->GetUIntMapVar(string(vars[i]), "universe"); + } +} + + +/* + * Cleanup + */ +UniverseStore::~UniverseStore() { + DeleteAll(); +} + + +/* + * Lookup a universe from its universe_id + * @param uid the uid of the required universe + */ +Universe *UniverseStore::GetUniverse(unsigned int universe_id) const { + universe_map::const_iterator iter = m_universe_map.find(universe_id); + if (iter != m_universe_map.end()) + return iter->second; + return NULL; +} + + +/* + * Lookup a universe, or create it if it does not exist + * @param uid the universe id + * @return the universe, or NULL on error + */ +Universe *UniverseStore::GetUniverseOrCreate(unsigned int universe_id) { + Universe *universe = GetUniverse(universe_id); + + if (!universe) { + universe = new Universe(universe_id, this, m_export_map); + + if (universe) { + pair pair(universe_id, universe); + m_universe_map.insert(pair); + + if (m_preferences) + RestoreUniverseSettings(universe); + } else { + OLA_WARN << "Failed to create universe " << universe_id; + } + } + return universe; +} + + +/* + * Returns a list of universes. This must be freed when you're + * done with it. + * @return a pointer to a vector of Universe* + */ +void UniverseStore::GetList(std::vector *universes) const { + universes->reserve(UniverseCount()); + + universe_map::const_iterator iter; + for (iter = m_universe_map.begin(); iter != m_universe_map.end(); ++iter) + universes->push_back(iter->second); +} + + +/* + * Delete all universes + */ +void UniverseStore::DeleteAll() { + universe_map::iterator iter; + + for (iter = m_universe_map.begin(); iter != m_universe_map.end(); iter++) { + SaveUniverseSettings(iter->second); + delete iter->second; + } + m_deletion_candiates.clear(); + m_universe_map.clear(); +} + + +/* + * Mark a universe as a candiate for garbage collection. + * @param universe the universe which has no clients or ports bound + */ +void UniverseStore::AddUniverseGarbageCollection(Universe *universe) { + m_deletion_candiates.insert(universe); +} + + +/* + * Check all the garbage collection candiates and delete the ones that aren't + * needed. + */ +void UniverseStore::GarbageCollectUniverses() { + set::iterator iter; + universe_map::iterator map_iter; + + for (iter = m_deletion_candiates.begin(); + iter != m_deletion_candiates.end(); iter++) { + if (!(*iter)->IsActive()) { + SaveUniverseSettings(*iter); + m_universe_map.erase((*iter)->UniverseId()); + delete *iter; + } + } + m_deletion_candiates.clear(); +} + + +/* + * Restore a universe's settings + * @param uni the universe to update + */ +bool UniverseStore::RestoreUniverseSettings(Universe *universe) const { + string key, value; + std::ostringstream oss; + + if (!universe) + return 0; + + oss << std::dec << universe->UniverseId(); + + // load name + key = "uni_" + oss.str() + "_name"; + value = m_preferences->GetValue(key); + + if (!value.empty()) + universe->SetName(value); + + // load merge mode + key = "uni_" + oss.str() + "_merge"; + value = m_preferences->GetValue(key); + + if (!value.empty()) { + if (value == "HTP") + universe->SetMergeMode(Universe::MERGE_HTP); + else + universe->SetMergeMode(Universe::MERGE_LTP); + } + return 0; +} + + +/* + * Save this universe's settings. + * @param universe, the universe to save + */ +bool UniverseStore::SaveUniverseSettings(Universe *universe) const { + string key, mode; + std::ostringstream oss; + + if (!universe || !m_preferences) + return 0; + + oss << std::dec << universe->UniverseId(); + + // save name + key = "uni_" + oss.str() + "_name"; + m_preferences->SetValue(key, universe->Name()); + + // save merge mode + key = "uni_" + oss.str() + "_merge"; + mode = (universe->MergeMode() == Universe::MERGE_HTP ? "HTP" : "LTP"); + m_preferences->SetValue(key, mode); + + return 0; +} +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.h b/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.h new file mode 100644 index 0000000..da4abfa --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/UniverseStore.h @@ -0,0 +1,64 @@ +/* + * 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 Library 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. + * + * UniverseStore.h + * The Universe Store class - this manages the universes + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef OLAD_UNIVERSESTORE_H_ +#define OLAD_UNIVERSESTORE_H_ + +#include +#include +#include +#include + +namespace ola { + +class Universe; + +class UniverseStore { + public: + UniverseStore(class Preferences *preferences, class ExportMap *export_map); + ~UniverseStore(); + + Universe *GetUniverse(unsigned int universe_id) const; + Universe *GetUniverseOrCreate(unsigned int universe_id); + + unsigned int UniverseCount() const { return m_universe_map.size(); } + void GetList(std::vector *universes) const; + + void DeleteAll(); + void AddUniverseGarbageCollection(Universe *universe); + void GarbageCollectUniverses(); + + private: + typedef std::map universe_map; + + explicit UniverseStore(const ola::UniverseStore&); + UniverseStore& operator=(const UniverseStore&); + bool RestoreUniverseSettings(Universe *universe) const; + bool SaveUniverseSettings(Universe *universe) const; + + Preferences *m_preferences; + ExportMap *m_export_map; + // map of universe_id to Universe + universe_map m_universe_map; + std::set m_deletion_candiates; // list of universes we may be + // able to delete +}; +} // ola +#endif // OLAD_UNIVERSESTORE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/olad/UniverseTest.cpp b/open-lighting-architecture/ola-0.8.4/olad/UniverseTest.cpp new file mode 100644 index 0000000..ceae1d1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/UniverseTest.cpp @@ -0,0 +1,471 @@ +/* + * 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 Library 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. + * + * UniverseTest.cpp + * Test fixture for the Universe and UniverseStore classes + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include + +#include "ola/DmxBuffer.h" +#include "olad/Client.h" +#include "olad/DmxSource.h" +#include "olad/Port.h" +#include "olad/PortManager.h" +#include "olad/Preferences.h" +#include "olad/TestCommon.h" +#include "olad/Universe.h" +#include "olad/UniverseStore.h" + +using ola::AbstractDevice; +using ola::DmxBuffer; +using ola::Clock; +using ola::TimeStamp; +using ola::Universe; +using std::string; + +static unsigned int TEST_UNIVERSE = 1; +static const char TEST_DATA[] = "this is some test data"; + + +class UniverseTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(UniverseTest); + CPPUNIT_TEST(testLifecycle); + CPPUNIT_TEST(testSetGet); + CPPUNIT_TEST(testSendDmx); + CPPUNIT_TEST(testReceiveDmx); + CPPUNIT_TEST(testSourceClients); + CPPUNIT_TEST(testSinkClients); + CPPUNIT_TEST(testLtpMerging); + CPPUNIT_TEST(testHtpMerging); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testLifecycle(); + void testSetGet(); + void testSendDmx(); + void testReceiveDmx(); + void testSourceClients(); + void testSinkClients(); + void testLtpMerging(); + void testHtpMerging(); + + private: + ola::MemoryPreferences *m_preferences; + ola::UniverseStore *m_store; + DmxBuffer m_buffer; +}; + + +class MockClient: public ola::Client { + public: + MockClient(): ola::Client(NULL), m_dmx_set(false) {} + bool SendDMX(unsigned int universe_id, const DmxBuffer &buffer) { + CPPUNIT_ASSERT_EQUAL(TEST_UNIVERSE, universe_id); + CPPUNIT_ASSERT_EQUAL(string(TEST_DATA), buffer.Get()); + m_dmx_set = true; + return true; + } + bool m_dmx_set; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(UniverseTest); + + +void UniverseTest::setUp() { + m_preferences = new ola::MemoryPreferences("foo"); + m_store = new ola::UniverseStore(m_preferences, NULL); + m_buffer.Set(TEST_DATA); +} + + +void UniverseTest::tearDown() { + delete m_store; + delete m_preferences; +} + + +/* + * Test that we can create universes and save their settings + */ +void UniverseTest::testLifecycle() { + Universe *universe = m_store->GetUniverse(TEST_UNIVERSE); + CPPUNIT_ASSERT(!universe); + + universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + CPPUNIT_ASSERT_EQUAL(universe->UniverseId(), TEST_UNIVERSE); + CPPUNIT_ASSERT_EQUAL(m_store->UniverseCount(), (unsigned int) 1); + CPPUNIT_ASSERT_EQUAL(universe->MergeMode(), Universe::MERGE_LTP); + CPPUNIT_ASSERT(!universe->IsActive()); + + string universe_name = "New Name"; + universe->SetName(universe_name); + universe->SetMergeMode(Universe::MERGE_HTP); + + CPPUNIT_ASSERT_EQUAL(universe->Name(), universe_name); + CPPUNIT_ASSERT_EQUAL(universe->MergeMode(), Universe::MERGE_HTP); + + // delete it + m_store->AddUniverseGarbageCollection(universe); + m_store->GarbageCollectUniverses(); + CPPUNIT_ASSERT_EQUAL(m_store->UniverseCount(), (unsigned int) 0); + universe = m_store->GetUniverse(TEST_UNIVERSE); + CPPUNIT_ASSERT(!universe); + + // now re-create it + universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + CPPUNIT_ASSERT_EQUAL(m_store->UniverseCount(), (unsigned int) 1); + CPPUNIT_ASSERT_EQUAL(universe->UniverseId(), TEST_UNIVERSE); + CPPUNIT_ASSERT_EQUAL(universe->Name(), universe_name); + CPPUNIT_ASSERT_EQUAL(universe->MergeMode(), Universe::MERGE_HTP); + + m_store->DeleteAll(); + CPPUNIT_ASSERT_EQUAL(m_store->UniverseCount(), (unsigned int) 0); +} + + +/* + * Check that SetDMX/GetDMX works + */ +void UniverseTest::testSetGet() { + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + + // a new universe should be all 0s + DmxBuffer empty_buffer; + CPPUNIT_ASSERT(empty_buffer == universe->GetDMX()); + + // check that SetDMX works + CPPUNIT_ASSERT(universe->SetDMX(m_buffer)); + CPPUNIT_ASSERT(m_buffer == universe->GetDMX()); +} + + +/* + * Check that SendDmx updates all ports + */ +void UniverseTest::testSendDmx() { + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + + TestMockOutputPort port(NULL, 1); // output port + universe->AddPort(&port); + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 1); + CPPUNIT_ASSERT(universe->IsActive()); + + // send some data to the universe and check the port gets it + CPPUNIT_ASSERT(universe->SetDMX(m_buffer)); + CPPUNIT_ASSERT(m_buffer == port.ReadDMX()); + + // remove the port from the universe + universe->RemovePort(&port); + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT(!universe->IsActive()); +} + + +/* + * Check that we update when ports have new data + */ +void UniverseTest::testReceiveDmx() { + ola::PortManager port_manager(m_store); + + MockDevice device(NULL, "foo"); + TimeStamp time_stamp; + TestMockInputPort port(&device, 1, &time_stamp); // input port + port_manager.PatchPort(&port, TEST_UNIVERSE); + + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 1); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT(universe->IsActive()); + + // Setup the port with some data, and check that signalling the universe + // works. + Clock::CurrentTime(&time_stamp); + port.WriteDMX(m_buffer); + port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(m_buffer.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(m_buffer == universe->GetDMX()); + + // Remove the port from the universe + universe->RemovePort(&port); + CPPUNIT_ASSERT(!universe->IsActive()); + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 0); +} + + +/* + * Check that we can add/remove source clients from this universes + */ +void UniverseTest::testSourceClients() { + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + + // test that we can add a source client + MockClient client; + universe->AddSourceClient(&client); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, universe->SourceClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + CPPUNIT_ASSERT(universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(universe->IsActive()); + + // Setting DMX now does nothing + CPPUNIT_ASSERT(!client.m_dmx_set); + universe->SetDMX(m_buffer); + CPPUNIT_ASSERT(!client.m_dmx_set); + + // now remove it + universe->RemoveSourceClient(&client); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + CPPUNIT_ASSERT(!universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(!universe->IsActive()); + + // try to remove it again + CPPUNIT_ASSERT(!universe->RemoveSourceClient(&client)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + CPPUNIT_ASSERT(!universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(!universe->IsActive()); +} + + +/* + * Check that we can add/remove sink clients from this universes + */ +void UniverseTest::testSinkClients() { + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + + // test that we can add a source client + MockClient client; + universe->AddSinkClient(&client); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, universe->SinkClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT(universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(universe->IsActive()); + + // Setting DMX now should update the client + CPPUNIT_ASSERT(!client.m_dmx_set); + universe->SetDMX(m_buffer); + CPPUNIT_ASSERT(client.m_dmx_set); + + // now remove it + universe->RemoveSinkClient(&client); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(!universe->IsActive()); + + // try to remove it again + CPPUNIT_ASSERT(!universe->RemoveSinkClient(&client)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SinkClientCount()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->SourceClientCount()); + CPPUNIT_ASSERT(!universe->ContainsSinkClient(&client)); + CPPUNIT_ASSERT(!universe->ContainsSourceClient(&client)); + CPPUNIT_ASSERT(!universe->IsActive()); +} + + +/* + * Check that LTP merging works correctly + */ +void UniverseTest::testLtpMerging() { + DmxBuffer buffer1, buffer2, htp_buffer; + buffer1.SetFromString("1,0,0,10"); + buffer2.SetFromString("0,255,0,5,6,7"); + + ola::PortManager port_manager(m_store); + + TimeStamp time_stamp; + MockDevice device(NULL, "foo"); + MockDevice device2(NULL, "bar"); + TestMockInputPort port(&device, 1, &time_stamp); // input port + TestMockInputPort port2(&device2, 1, &time_stamp); // input port + port_manager.PatchPort(&port, TEST_UNIVERSE); + port_manager.PatchPort(&port2, TEST_UNIVERSE); + + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + universe->SetMergeMode(Universe::MERGE_LTP); + + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 2); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT(universe->IsActive()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->GetDMX().Size()); + + // Setup the ports with some data, and check that signalling the universe + // works. + Clock::CurrentTime(&time_stamp); + port.WriteDMX(buffer1); + port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(buffer1.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(buffer1 == universe->GetDMX()); + + // Now the second port gets data + Clock::CurrentTime(&time_stamp); + port2.WriteDMX(buffer2); + port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(buffer2.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(buffer2 == universe->GetDMX()); + + // now resend the first port + Clock::CurrentTime(&time_stamp); + port.WriteDMX(buffer1); + port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(buffer1.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(buffer1 == universe->GetDMX()); + + // now check a client + DmxBuffer client_buffer; + client_buffer.SetFromString("255,0,0,255,10"); + Clock::CurrentTime(&time_stamp); + ola::DmxSource source(client_buffer, time_stamp, + ola::DmxSource::PRIORITY_DEFAULT); + MockClient input_client; + input_client.DMXRecieved(TEST_UNIVERSE, source); + universe->SourceClientDataChanged(&input_client); + + DmxBuffer client_htp_merge_result; + client_htp_merge_result.SetFromString("255,255,0,255,10,7"); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(client_buffer.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(client_buffer == universe->GetDMX()); + + // clean up + universe->RemoveSourceClient(&input_client); + universe->RemovePort(&port); + universe->RemovePort(&port2); + CPPUNIT_ASSERT(!universe->IsActive()); +} + + +/* + * Check that HTP merging works correctly + */ +void UniverseTest::testHtpMerging() { + DmxBuffer buffer1, buffer2, htp_buffer; + buffer1.SetFromString("1,0,0,10"); + buffer2.SetFromString("0,255,0,5,6,7"); + htp_buffer.SetFromString("1,255,0,10,6,7"); + + ola::PortManager port_manager(m_store); + + TimeStamp time_stamp; + MockDevice device(NULL, "foo"); + MockDevice device2(NULL, "bar"); + TestMockInputPort port(&device, 1, &time_stamp); // input port + TestMockInputPort port2(&device2, 1, &time_stamp); // input port + port_manager.PatchPort(&port, TEST_UNIVERSE); + port_manager.PatchPort(&port2, TEST_UNIVERSE); + + Universe *universe = m_store->GetUniverseOrCreate(TEST_UNIVERSE); + CPPUNIT_ASSERT(universe); + universe->SetMergeMode(Universe::MERGE_HTP); + + CPPUNIT_ASSERT_EQUAL(universe->InputPortCount(), (unsigned int) 2); + CPPUNIT_ASSERT_EQUAL(universe->OutputPortCount(), (unsigned int) 0); + CPPUNIT_ASSERT(universe->IsActive()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, universe->GetDMX().Size()); + + // Setup the ports with some data, and check that signalling the universe + // works. + Clock::CurrentTime(&time_stamp); + port.WriteDMX(buffer1); + port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(buffer1.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(buffer1 == universe->GetDMX()); + + // Now the second port gets data + Clock::CurrentTime(&time_stamp); + port2.WriteDMX(buffer2); + port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(ola::DmxSource::PRIORITY_DEFAULT, + universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(htp_buffer.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(htp_buffer == universe->GetDMX()); + + // now raise the priority of the second port + uint8_t new_priority = 120; + port2.SetPriority(new_priority); + Clock::CurrentTime(&time_stamp); + port2.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(buffer2.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(buffer2 == universe->GetDMX()); + + // raise the priority of the first port + port.SetPriority(new_priority); + Clock::CurrentTime(&time_stamp); + port.DmxChanged(); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(htp_buffer.Size(), universe->GetDMX().Size()); + CPPUNIT_ASSERT(htp_buffer == universe->GetDMX()); + + // now check a client + DmxBuffer client_buffer; + client_buffer.SetFromString("255,0,0,255,10"); + Clock::CurrentTime(&time_stamp); + ola::DmxSource source(client_buffer, time_stamp, new_priority); + MockClient input_client; + input_client.DMXRecieved(TEST_UNIVERSE, source); + universe->SourceClientDataChanged(&input_client); + + DmxBuffer client_htp_merge_result; + client_htp_merge_result.SetFromString("255,255,0,255,10,7"); + CPPUNIT_ASSERT_EQUAL(new_priority, universe->ActivePriority()); + CPPUNIT_ASSERT_EQUAL(client_htp_merge_result.Size(), + universe->GetDMX().Size()); + CPPUNIT_ASSERT(client_htp_merge_result == universe->GetDMX()); + + // clean up + universe->RemoveSourceClient(&input_client); + universe->RemovePort(&port); + universe->RemovePort(&port2); + CPPUNIT_ASSERT(!universe->IsActive()); +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.am b/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.am new file mode 100644 index 0000000..0c08239 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST = test_preferences.conf diff --git a/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.in b/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.in new file mode 100644 index 0000000..f0e25ed --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/testdata/Makefile.in @@ -0,0 +1,349 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = olad/testdata +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +EXTRA_DIST = test_preferences.conf +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu olad/testdata/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu olad/testdata/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/olad/testdata/test_preferences.conf b/open-lighting-architecture/ola-0.8.4/olad/testdata/test_preferences.conf new file mode 100644 index 0000000..c71518c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/testdata/test_preferences.conf @@ -0,0 +1,8 @@ +# this is a comment +foo = bar +baz = bat + # this is another comment + +multi = 1 +multi = 2 +multi = 3 diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/._tick.gif b/open-lighting-architecture/ola-0.8.4/olad/www/._tick.gif new file mode 100644 index 0000000..03be3db Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/._tick.gif differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/._toolbar.css b/open-lighting-architecture/ola-0.8.4/olad/www/._toolbar.css new file mode 100644 index 0000000..f9d7d49 Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/._toolbar.css differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.am b/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.am new file mode 100644 index 0000000..7c0f8a0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.am @@ -0,0 +1,15 @@ +wwwdir = $(www_datadir) + +dist_www_DATA = blank.gif \ + button-bg.png \ + custombutton.css \ + toolbar.css \ + expander.png \ + handle.vertical.png \ + loader.gif \ + logo.png \ + ola.html \ + ola.js \ + tick.gif \ + toolbar-bg.png \ + vertical.gif diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.in b/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.in new file mode 100644 index 0000000..b77f5cc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/www/Makefile.in @@ -0,0 +1,395 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = olad/www +DIST_COMMON = $(dist_www_DATA) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(wwwdir)" +dist_wwwDATA_INSTALL = $(INSTALL_DATA) +DATA = $(dist_www_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +wwwdir = $(www_datadir) +dist_www_DATA = blank.gif \ + button-bg.png \ + custombutton.css \ + toolbar.css \ + expander.png \ + handle.vertical.png \ + loader.gif \ + logo.png \ + ola.html \ + ola.js \ + tick.gif \ + toolbar-bg.png \ + vertical.gif + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu olad/www/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu olad/www/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-dist_wwwDATA: $(dist_www_DATA) + @$(NORMAL_INSTALL) + test -z "$(wwwdir)" || $(MKDIR_P) "$(DESTDIR)$(wwwdir)" + @list='$(dist_www_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(dist_wwwDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(wwwdir)/$$f'"; \ + $(dist_wwwDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(wwwdir)/$$f"; \ + done + +uninstall-dist_wwwDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_www_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(wwwdir)/$$f'"; \ + rm -f "$(DESTDIR)$(wwwdir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(wwwdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-dist_wwwDATA + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_wwwDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dist_wwwDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-dist_wwwDATA + +# 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/open-lighting-architecture/ola-0.8.4/olad/www/blank.gif b/open-lighting-architecture/ola-0.8.4/olad/www/blank.gif new file mode 100644 index 0000000..75b945d Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/blank.gif differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/button-bg.png b/open-lighting-architecture/ola-0.8.4/olad/www/button-bg.png new file mode 100644 index 0000000..cdd8acf Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/button-bg.png differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/custombutton.css b/open-lighting-architecture/ola-0.8.4/olad/www/custombutton.css new file mode 100644 index 0000000..66113ea --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/www/custombutton.css @@ -0,0 +1,164 @@ +/* + * Copyright 2009 The Closure Library Authors. All Rights Reserved. + * + * Use of this source code is governed by an Apache 2.0 License. + * See the COPYING file for details. + */ + +/* + * Styling for custom buttons rendered by goog.ui.CustomButtonRenderer. + * + * @author attila@google.com (Attila Bodis) + */ + +.goog-custom-button { + margin: 2px; + border: 0; + padding: 0; + font-family: Arial, sans-serif; + color: #000; + /* Client apps may override the URL at which they serve the image. */ + background: #ddd url(/button-bg.png) repeat-x top left; + text-decoration: none; + list-style: none; + vertical-align: middle; + cursor: default; + outline: none; +} + +/* Pseudo-rounded corners. */ +.goog-custom-button-outer-box, +.goog-custom-button-inner-box { + border-style: solid; + border-color: #aaa; + vertical-align: top; +} + +.goog-custom-button-outer-box { + margin: 0; + border-width: 1px 0; + padding: 0; +} + +.goog-custom-button-inner-box { + /* By default in FF2, block elements inside a moz-inline-box are stacked + * horizontally next to each other. This stops that weird behavior. */ + -moz-box-orient: vertical; + margin: 0 -1px; + border-width: 0 1px; + padding: 3px 4px; + white-space: nowrap; /* Prevents buttons from line breaking on android. */ +} + +/* Pre-IE7 IE hack; ignored by IE7 and all non-IE browsers. */ +* html .goog-custom-button-inner-box { + /* IE6 needs to have the box shifted to make the borders line up. */ + left: -1px; +} +/* Pre-IE7 BiDi fixes. */ +* html .goog-custom-button-rtl .goog-custom-button-outer-box { + /* @noflip */ left: -1px; +} +* html .goog-custom-button-rtl .goog-custom-button-inner-box { + /* @noflip */ right: auto; +} + +/* IE7-only hack; ignored by all other browsers. */ +*:first-child+html .goog-custom-button-inner-box { + /* IE7 needs to have the box shifted to make the borders line up. */ + left: -1px; +} +/* IE7 BiDi fix. */ +*:first-child+html .goog-custom-button-rtl .goog-custom-button-inner-box { + /* @noflip */ left: 1px; +} + +/* Safari-only hacks. */ +::root .goog-custom-button, +::root .goog-custom-button-outer-box { + /* Required to make pseudo-rounded corners work on Safari. */ + line-height: 0; +} + +::root .goog-custom-button-inner-box { + /* Required to make pseudo-rounded corners work on Safari. */ + line-height: normal; +} + +/* State: disabled. */ +.goog-custom-button-disabled { + background-image: none !important; + opacity: 0.3; + -moz-opacity: 0.3; + filter: alpha(opacity=30); +} + +.goog-custom-button-disabled .goog-custom-button-outer-box, +.goog-custom-button-disabled .goog-custom-button-inner-box { + color: #333 !important; + border-color: #999 !important; +} + +/* Pre-IE7 IE hack; ignored by IE7 and all non-IE browsers. */ +* html .goog-custom-button-disabled { + margin: 2px 1px !important; + padding: 0 1px !important; +} + +/* IE7-only hack; ignored by all other browsers. */ +*:first-child+html .goog-custom-button-disabled { + margin: 2px 1px !important; + padding: 0 1px !important; +} + +/* State: hover. */ +.goog-custom-button-hover .goog-custom-button-outer-box, +.goog-custom-button-hover .goog-custom-button-inner-box { + border-color: #9cf #69e #69e #7af !important; /* Hover border wins. */ +} + +/* State: active, checked. */ +.goog-custom-button-active, +.goog-custom-button-checked { + background-color: #bbb; + background-position: bottom left; +} + +/* State: focused. */ +.goog-custom-button-focused .goog-custom-button-outer-box, +.goog-custom-button-focused .goog-custom-button-inner-box { + border-color: orange; +} + +/* Pill (collapsed border) styles. */ +.goog-custom-button-collapse-right, +.goog-custom-button-collapse-right .goog-custom-button-outer-box, +.goog-custom-button-collapse-right .goog-custom-button-inner-box { + margin-right: 0; +} + +.goog-custom-button-collapse-left, +.goog-custom-button-collapse-left .goog-custom-button-outer-box, +.goog-custom-button-collapse-left .goog-custom-button-inner-box { + margin-left: 0; +} + +.goog-custom-button-collapse-left .goog-custom-button-inner-box { + border-left: 1px solid #fff; +} + +.goog-custom-button-collapse-left.goog-custom-button-checked +.goog-custom-button-inner-box { + border-left: 1px solid #ddd; +} + +/* Pre-IE7 IE hack; ignored by IE7 and all non-IE browsers. */ +* html .goog-custom-button-collapse-left .goog-custom-button-inner-box { + left: 0; +} + +/* IE7-only hack; ignored by all other browsers. */ +*:first-child+html .goog-custom-button-collapse-left +.goog-custom-button-inner-box { + left: 0; +} diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/expander.png b/open-lighting-architecture/ola-0.8.4/olad/www/expander.png new file mode 100644 index 0000000..9960720 Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/expander.png differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/handle.vertical.png b/open-lighting-architecture/ola-0.8.4/olad/www/handle.vertical.png new file mode 100644 index 0000000..4bd50fa Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/handle.vertical.png differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/loader.gif b/open-lighting-architecture/ola-0.8.4/olad/www/loader.gif new file mode 100644 index 0000000..e2dfb44 Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/loader.gif differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/logo.png b/open-lighting-architecture/ola-0.8.4/olad/www/logo.png new file mode 100644 index 0000000..4ca259b Binary files /dev/null and b/open-lighting-architecture/ola-0.8.4/olad/www/logo.png differ diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/ola.html b/open-lighting-architecture/ola-0.8.4/olad/www/ola.html new file mode 100644 index 0000000..785aa10 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/www/ola.html @@ -0,0 +1,753 @@ + + + + + + + OLA Admin + + + + + +
+
+
+ + + + + + diff --git a/open-lighting-architecture/ola-0.8.4/olad/www/ola.js b/open-lighting-architecture/ola-0.8.4/olad/www/ola.js new file mode 100644 index 0000000..e5a3cb1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/olad/www/ola.js @@ -0,0 +1,271 @@ +function aa(){return function(){}}function ba(a){return function(b){this[a]=b}}function e(a){return function(){return this[a]}}function k(a){return function(){return a}}var m,ca=ca||{},n=this;function da(a,b){for(var c=a.split("."),d=b||n,f;f=c.shift();)if(d[f])d=d[f];else return null;return d}function q(){}function r(a){a.g=function(){return a.Di||(a.Di=new a)}} +function ea(a){var b=typeof a;if(b=="object")if(a){if(a instanceof Array||!(a instanceof Object)&&Object.prototype.toString.call(a)=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(!(a instanceof Object)&&(Object.prototype.toString.call(a)=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call")))return"function"}else return"null"; +else if(b=="function"&&typeof a.call=="undefined")return"object";return b}function fa(a){return ea(a)=="array"}function ga(a){var b=ea(a);return b=="array"||b=="object"&&typeof a.length=="number"}function s(a){return typeof a=="string"}function ha(a){return typeof a=="number"}function ia(a){return ea(a)=="function"}function ja(a){a=ea(a);return a=="object"||a=="array"||a=="function"}function ka(a){return a[la]||(a[la]=++ma)} +var la="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36),ma=0;function na(a,b){var c=b||n;if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return a.apply(c,f)}}else return function(){return a.apply(c,arguments)}} +function oa(a){var b=Array.prototype.slice.call(arguments,1);return function(){var c=Array.prototype.slice.call(arguments);c.unshift.apply(c,b);return a.apply(this,c)}}var pa=Date.now||function(){return+new Date};function qa(a,b){var c=b||{};for(var d in c){var f=(""+c[d]).replace(/\$/g,"$$$$");a=a.replace(RegExp("\\{\\$"+d+"\\}","gi"),f)}return a}function t(a,b){function c(){}c.prototype=b.prototype;a.b=b.prototype;a.prototype=new c;a.prototype.constructor=a};function ra(a){for(var b=1;b":"
")} +function ua(a,b){if(b)return a.replace(va,"&").replace(wa,"<").replace(xa,">").replace(ya,""");else{if(!za.test(a))return a;if(a.indexOf("&")!=-1)a=a.replace(va,"&");if(a.indexOf("<")!=-1)a=a.replace(wa,"<");if(a.indexOf(">")!=-1)a=a.replace(xa,">");if(a.indexOf('"')!=-1)a=a.replace(ya,""");return a}}var va=/&/g,wa=//g,ya=/\"/g,za=/[&<>\"]/;function Aa(a,b){return ta(a.replace(/ /g,"  "),b)} +function Ba(a,b){for(var c=0,d=sa(String(a)).split("."),f=sa(String(b)).split("."),g=Math.max(d.length,f.length),h=0;c==0&&hb)return 1;return 0};var Da,Ea,Fa,Ga,Ha,Ia,Ja;function Ka(){return n.navigator?n.navigator.userAgent:null}function La(){return n.navigator}Ha=Ga=Fa=Ea=Da=false;var Ma;if(Ma=Ka()){var Na=La();Da=Ma.indexOf("Opera")==0;Ea=!Da&&Ma.indexOf("MSIE")!=-1;Ga=(Fa=!Da&&Ma.indexOf("WebKit")!=-1)&&Ma.indexOf("Mobile")!=-1;Ha=!Da&&!Fa&&Na.product=="Gecko"}var Oa=Da,u=Ea,x=Ha,y=Fa,Pa=Ga,Qa,Ra=La();Qa=Ra&&Ra.platform||"";Ia=Qa.indexOf("Mac")!=-1;Ja=Qa.indexOf("Win")!=-1; +var Sa=!!La()&&(La().appVersion||"").indexOf("X11")!=-1,Ta,Ua="",Va;if(Oa&&n.opera){var Wa=n.opera.version;Ua=typeof Wa=="function"?Wa():Wa}else{if(x)Va=/rv\:([^\);]+)(\)|;)/;else if(u)Va=/MSIE\s+([^\);]+)(\)|;)/;else if(y)Va=/WebKit\/(\S+)/;if(Va){var Xa=Va.exec(Ka());Ua=Xa?Xa[1]:""}}Ta=Ua;var Ya={};function z(a){return Ya[a]||(Ya[a]=Ba(Ta,a)>=0)};function Za(a,b,c){for(var d in a)b.call(c,a[d],d,a)}function $a(a){var b=[],c=0;for(var d in a)b[c++]=a[d];return b}function ab(a){var b=[],c=0;for(var d in a)b[c++]=d;return b}function bb(a){for(var b in a)return false;return true}function cb(a,b){var c;if(c=b in a)delete a[b];return c}function db(a,b,c){if(b in a)throw Error('The object already contains the key "'+b+'"');a[b]=c}var eb=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]; +function fb(a){for(var b,c,d=1;d=0}function qb(a){if(!fa(a))for(var b=a.length-1;b>=0;b--)delete a[b];a.length=0}function rb(a,b){var c=lb(a,b),d;if(d=c>=0)sb(a,c);return d}function sb(a,b){jb(a.length!=null);return A.splice.call(a,b,1).length==1}function tb(){return A.concat.apply(A,arguments)}function ub(a){if(fa(a))return tb(a);else{for(var b=[],c=0,d=a.length;c=112&&a.keyCode<=123)a.keyCode=-1}catch(b){}}};Cb.prototype.e=function(){Cb.b.e.call(this);this.relatedTarget=this.currentTarget=this.target=this.Oa=null};function Gb(){}var Hb=0;m=Gb.prototype;m.key=0;m.Ic=false;m.ag=false;m.xc=function(a,b,c,d,f,g){if(ia(a))this.Dg=true;else if(a&&a.handleEvent&&ia(a.handleEvent))this.Dg=false;else throw Error("Invalid listener argument");this.Dc=a;this.Wg=b;this.src=c;this.type=d;this.capture=!!f;this.Yd=g;this.ag=false;this.key=++Hb;this.Ic=false};m.handleEvent=function(a){if(this.Dg)return this.Dc.call(this.Yd||this.src,a);return this.Dc.handleEvent.call(this.Dc,a)};var Ib;var Jb=(Ib="ScriptEngine"in n&&n.ScriptEngine()=="JScript")?n.ScriptEngineMajorVersion()+"."+n.ScriptEngineMinorVersion()+"."+n.ScriptEngineBuildVersion():"0";function Kb(a,b){this.Xb=b;this.Z=[];if(a>this.Xb)throw Error("[goog.structs.SimplePool] Initial cannot be greater than max");for(var c=0;c=0),h;Qb=function(w){h=w};if(g){Lb=function(){return i.Ra()};Mb=function(w){i.Fb(w)};Nb=function(){return j.Ra()};Ob=function(w){j.Fb(w)};Pb=function(){return l.Ra()};Rb=function(){l.Fb(c())};Sb=function(){return o.Ra()};Tb=function(w){o.Fb(w)};Ub=function(){return p.Ra()};Vb=function(w){p.Fb(w)}; +var i=new Kb(0,600);i.Nb=a;var j=new Kb(0,600);j.Nb=b;var l=new Kb(0,600);l.Nb=c;var o=new Kb(0,600);o.Nb=d;var p=new Kb(0,600);p.Nb=f}else{Lb=a;Mb=q;Nb=b;Ob=q;Pb=c;Rb=q;Sb=d;Tb=q;Ub=f;Vb=q}})();var Wb={},Xb={},Yb={},$b={}; +function D(a,b,c,d,f){if(b)if(fa(b)){for(var g=0;g=0;l--){var o=j[l];if((g||b==o.type)&&(h||c==o.capture)){dc(o.key);d++}}});else{a=ka(a);if(Yb[a]){a=Yb[a];for(f=a.length-1;f>=0;f--){var i=a[f];if((g||b==i.type)&&(h||c==i.capture)){dc(i.key);d++}}}}return d}function cc(a,b,c){var d=Xb;if(b in d){d=d[b];if(c in d){d=d[c];a=ka(a);if(d[a])return d[a]}}return null}var E="click",gc="keydown"; +function ac(a){if(a in $b)return $b[a];return $b[a]="on"+a}function hc(a,b,c,d,f){var g=1;b=ka(b);if(a[b]){a.Ua--;a=a[b];if(a.fe)a.fe++;else a.fe=1;try{for(var h=a.length,i=0;i=0&&h.Ua;V--){l.currentTarget=p[V];g&=hc(h,p[V],d,true,l)}if(j){h=f[false];h.Ua=h.T;for(V=0;!l.$b&&V=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom};function pc(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}m=pc.prototype;m.Na=function(){return new pc(this.left,this.top,this.width,this.height)};m.toString=function(){return"("+this.left+", "+this.top+" - "+this.width+"w x "+this.height+"h)"}; +m.Bg=function(a){var b=Math.max(this.left,a.left),c=Math.min(this.left+this.width,a.left+a.width);if(b<=c){var d=Math.max(this.top,a.top);a=Math.min(this.top+this.height,a.top+a.height);if(d<=a){this.left=b;this.top=d;this.width=c-b;this.height=a-d;return true}}return false}; +m.contains=function(a){return a instanceof pc?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};m.qg=function(){return new F(this.width,this.height)};var qc;function rc(a){return(a=a.className)&&typeof a.split=="function"?a.split(/\s+/):[]}function H(a){var b=rc(a),c;c=xb(arguments,1);for(var d=0,f=0;f");c=c.join("")}c=a.createElement(c);if(d)if(s(d))c.className=d;else fa(d)?H.apply(null,[c].concat(d)):yc(c,d);b.length>2&&Dc(a,c,b,2);return c} +function Dc(a,b,c,d){function f(h){if(h)b.appendChild(s(h)?a.createTextNode(h):h)}for(d=d;d0)?mb(Ec(g)?ub(g):g,f):f(g)}}function M(a){return document.createElement(a)}function xc(a){return a.compatMode=="CSS1Compat"}function Fc(a){for(var b;b=a.firstChild;)a.removeChild(b)}function Gc(a){return a&&a.parentNode?a.parentNode.removeChild(a):null}function Hc(a){return Ic(a.firstChild,true)}function Jc(a){return Ic(a.nextSibling,true)} +function Ic(a,b){for(;a&&a.nodeType!=1;)a=b?a.nextSibling:a.previousSibling;return a}function Kc(a,b){if(a.contains&&b.nodeType==1)return a==b||a.contains(b);if(typeof a.compareDocumentPosition!="undefined")return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}function J(a){return a.nodeType==9?a:a.ownerDocument||a.document} +function Lc(a,b){if("textContent"in a)a.textContent=b;else if(a.firstChild&&a.firstChild.nodeType==3){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=b}else{Fc(a);a.appendChild(J(a).createTextNode(b))}}var Mc={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},Nc={IMG:" ",BR:"\n"};function Oc(a){var b=a.getAttributeNode("tabindex");if(b&&b.specified){a=a.tabIndex;return ha(a)&&a>=0}return false} +function Pc(a){if(u&&"innerText"in a)a=a.innerText.replace(/(\r\n|\r|\n)/g,"\n");else{var b=[];Qc(a,b,true);a=b.join("")}a=a.replace(/\xAD/g,"");a=a.replace(/ +/g," ");if(a!=" ")a=a.replace(/^\s*/,"");return a}function Qc(a,b,c){if(!(a.nodeName in Mc))if(a.nodeType==3)c?b.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):b.push(a.nodeValue);else if(a.nodeName in Nc)b.push(Nc[a.nodeName]);else for(a=a.firstChild;a;){Qc(a,b,c);a=a.nextSibling}} +function Ec(a){if(a&&typeof a.length=="number")if(ja(a))return typeof a.item=="function"||typeof a.item=="string";else if(ia(a))return typeof a.item=="function";return false}function uc(a){this.r=a||n.document||document}m=uc.prototype;m.i=I;function Rc(a){return a.r}m.a=function(a){return s(a)?this.r.getElementById(a):a};m.d=function(){return Cc(this.r,arguments)};m.createElement=function(a){return this.r.createElement(a)};m.createTextNode=function(a){return this.r.createTextNode(a)}; +function Sc(a){return xc(a.r)}function Tc(a){a=!y&&xc(a.r)?a.r.documentElement:a.r.body;return new G(a.scrollLeft,a.scrollTop)}m.appendChild=function(a,b){a.appendChild(b)};m.pg=Hc;m.contains=Kc;function N(){}t(N,Ab);m=N.prototype;m.gg=true;m.pe=null;m.Bf=ba("pe");m.addEventListener=function(a,b,c,d){D(this,a,b,c,d)};m.removeEventListener=function(a,b,c,d){bc(this,a,b,c,d)}; +m.dispatchEvent=function(a){a=a;if(s(a))a=new C(a,this);else if(a instanceof C)a.target=a.target||this;else{var b=a;a=new C(a.type,this);fb(a,b)}b=1;var c,d=a.type,f=Xb;if(d in f){f=f[d];d=true in f;var g;if(d){c=[];for(g=this;g;g=g.pe)c.push(g);g=f[true];g.Ua=g.T;for(var h=c.length-1;!a.$b&&h>=0&&g.Ua;h--){a.currentTarget=c[h];b&=hc(g,c[h],a.type,true,a)&&a.vd!=false}}if(false in f){g=f[false];g.Ua=g.T;if(d)for(h=0;!a.$b&&hthis.zg){Wc(this,a);if(!this.ub){this.Rd(a);return}}}c=$c(this,b,c);b=c.x;c=c.y;if(this.ub)if(this.dispatchEvent(new Xc("beforedrag",this,a.clientX,a.clientY,a,b,c))!==false){ad(this,a,b,c,false);a.preventDefault()}}}; +function $c(a,b,c){var d=Tc(I(a.r));b+=d.x-a.sd.x;c+=d.y-a.sd.y;a.sd=d;a.mc+=b;a.nc+=c;return new G(Yc(a,a.mc),Zc(a,a.nc))}m.Ui=function(a){var b=$c(this,0,0);a.clientX=this.sd.x-this.screenX;a.clientY=this.sd.x-this.screenY;ad(this,a,b.x,b.y,true)};function ad(a,b,c,d){a.Oe(c,d);a.dispatchEvent(new Xc("drag",a,b.clientX,b.clientY,b,c,d))}function Yc(a,b){var c=a.de,d=!isNaN(c.left)?c.left:null;c=!isNaN(c.width)?c.width:0;return Math.min(d!=null?d+c:Infinity,Math.max(d!=null?d:-Infinity,b))} +function Zc(a,b){var c=a.de,d=!isNaN(c.top)?c.top:null;c=!isNaN(c.height)?c.height:0;return Math.min(d!=null?d+c:Infinity,Math.max(d!=null?d:-Infinity,b))}m.Oe=function(a,b){this.target.style.left=a+"px";this.target.style.top=b+"px"};function Xc(a,b,c,d,f,g,h,i){C.call(this,a);this.clientX=c;this.clientY=d;this.uj=f;this.left=g!==undefined?g:b.mc;this.top=h!==undefined?h:b.nc;this.jg=b;this.vj=!!i}t(Xc,C);function bd(a,b){var c=J(a);if(c.defaultView&&c.defaultView.getComputedStyle)if(c=c.defaultView.getComputedStyle(a,""))return c[b];return null}function cd(a,b){return bd(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style[b]}function dd(a){return cd(a,"position")}function ed(a,b,c){var d,f=x&&(Ia||Sa)&&z("1.9");if(b instanceof G){d=b.x;b=b.y}else{d=b;b=c}a.style.left=fd(d,f);a.style.top=fd(b,f)}function gd(a){return new G(a.offsetLeft,a.offsetTop)} +function hd(a){var b=a.getBoundingClientRect();if(u){a=a.ownerDocument;b.left-=a.documentElement.clientLeft+a.body.clientLeft;b.top-=a.documentElement.clientTop+a.body.clientTop}return b} +function id(a){if(u)return a.offsetParent;var b=J(a),c=cd(a,"position"),d=c=="fixed"||c=="absolute";for(a=a.parentNode;a&&a!=b;a=a.parentNode){c=cd(a,"position");d=d&&c=="static"&&a!=b.documentElement&&a!=b.body;if(!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||c=="fixed"||c=="absolute"))return a}return null} +function jd(a){var b=new oc(0,Infinity,Infinity,0),c=I(a),d=c.r.body,f=!y&&xc(c.r)?c.r.documentElement:c.r.body,g;for(a=a;a=id(a);)if((!u||a.clientWidth!=0)&&(!y||a.clientHeight!=0||a!=d)&&(a.scrollWidth!=a.clientWidth||a.scrollHeight!=a.clientHeight)&&cd(a,"overflow")!="visible"){var h=kd(a),i;i=a;if(x&&!z("1.9")){var j=parseFloat(bd(i,"borderLeftWidth"));if(ld(i)){var l=i.offsetWidth-i.clientWidth-j-parseFloat(bd(i,"borderRightWidth"));j+=l}i=new G(j,parseFloat(bd(i,"borderTopWidth")))}else i=new G(i.clientLeft, +i.clientTop);h.x+=i.x;h.y+=i.y;b.top=Math.max(b.top,h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x);g=g||a!=f}d=f.scrollLeft;f=f.scrollTop;if(y){b.left+=d;b.top+=f}else{b.left=Math.max(b.left,d);b.top=Math.max(b.top,f)}if(!g||y){b.right+=d;b.bottom+=f}c=Ac(Bc(c.r)||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,f+c.height);return b.top>=0&&b.left>=0&&b.bottom>b.top&&b.right>b.left?b:null} +function kd(a){var b,c=J(a),d=cd(a,"position"),f=x&&c.getBoxObjectFor&&!a.getBoundingClientRect&&d=="absolute"&&(b=c.getBoxObjectFor(a))&&(b.screenX<0||b.screenY<0),g=new G(0,0),h;b=c?c.nodeType==9?c:J(c):document;h=u&&!Sc(I(b))?b.body:b.documentElement;if(a==h)return g;if(a.getBoundingClientRect){b=hd(a);a=Tc(I(c));g.x=b.left+a.x;g.y=b.top+a.y}else if(c.getBoxObjectFor&&!f){b=c.getBoxObjectFor(a);a=c.getBoxObjectFor(h);g.x=b.screenX-a.screenX;g.y=b.screenY-a.screenY}else{b=a;do{g.x+=b.offsetLeft; +g.y+=b.offsetTop;if(b!=a){g.x+=b.clientLeft||0;g.y+=b.clientTop||0}if(y&&dd(b)=="fixed"){g.x+=c.body.scrollLeft;g.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(Oa||y&&d=="absolute")g.y-=c.body.offsetTop;for(b=a;(b=id(b))&&b!=c.body&&b!=h;){g.x-=b.scrollLeft;if(!Oa||b.tagName!="TR")g.y-=b.scrollTop}}return g}function md(a,b){var c=nd(a),d=nd(b);return new G(c.x-d.x,c.y-d.y)} +function nd(a){var b=new G;if(a.nodeType==1)if(a.getBoundingClientRect){var c=hd(a);b.x=c.left;b.y=c.top}else{c=Tc(I(a));a=kd(a);b.x=a.x-c.x;b.y=a.y-c.y}else{b.x=a.clientX;b.y=a.clientY}return b}function od(a,b,c){if(b instanceof F){c=b.height;b=b.width}else{if(c==undefined)throw Error("missing height argument");c=c}a.style.width=fd(b,true);a.style.height=fd(c,true)}function fd(a,b){if(typeof a=="number")a=(b?Math.round(a):a)+"px";return a} +function pd(a){var b=Oa&&!z("10");if(cd(a,"display")!="none")return b?new F(a.offsetWidth||a.clientWidth,a.offsetHeight||a.clientHeight):new F(a.offsetWidth,a.offsetHeight);var c=a.style,d=c.display,f=c.visibility,g=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";if(b){b=a.offsetWidth||a.clientWidth;a=a.offsetHeight||a.clientHeight}else{b=a.offsetWidth;a=a.offsetHeight}c.display=d;c.position=g;c.visibility=f;return new F(b,a)} +function qd(a){var b=kd(a);a=pd(a);return new pc(b.x,b.y,a.width,a.height)}function rd(a,b){var c=a.style;if("opacity"in c)c.opacity=b;else if("MozOpacity"in c)c.MozOpacity=b;else if("filter"in c)c.filter=b===""?"":"alpha(opacity="+b*100+")"}function O(a,b){a.style.display=b?"":"none"} +function sd(a,b){var c=I(b),d=null;if(u){d=c.r.createStyleSheet();td(d,a)}else{var f=wc(c.r,"head",void 0,void 0)[0];if(!f){d=wc(c.r,"body",void 0,void 0)[0];f=c.d("head");d.parentNode.insertBefore(f,d)}d=c.d("style");td(d,a);c.appendChild(f,d)}return d}function td(a,b){if(u)a.cssText=b;else a[y?"innerText":"innerHTML"]=b}function ld(a){return"rtl"==cd(a,"direction")}var ud=x?"MozUserSelect":y?"WebkitUserSelect":null; +function vd(a,b,c){c=!c?a.getElementsByTagName("*"):null;if(ud){b=b?"none":"";a.style[ud]=b;if(c){a=0;for(var d;d=c[a];a++)d.style[ud]=b}}else if(u||Oa){b=b?"on":"";a.setAttribute("unselectable",b);if(c)for(a=0;d=c[a];a++)d.setAttribute("unselectable",b)}}function wd(a){return new F(a.offsetWidth,a.offsetHeight)} +function xd(a,b){var c=Sc(I(J(a)));if(u&&(!c||!z("8"))){var d=a.style;if(c){c=yd(a,"padding");var f=zd(a);d.pixelWidth=b.width-f.left-c.left-c.right-f.right;d.pixelHeight=b.height-f.top-c.top-c.bottom-f.bottom}else{d.pixelWidth=b.width;d.pixelHeight=b.height}}else{d=a.style;if(x)d.MozBoxSizing="border-box";else if(y)d.WebkitBoxSizing="border-box";else if(Oa&&!z("9.50"))d.setProperty("box-sizing","border-box");else d.boxSizing="border-box";d.width=b.width+"px";d.height=b.height+"px"}} +function Ad(a){var b=J(a),c=u&&a.currentStyle;if(c&&Sc(I(b))&&c.width!="auto"&&c.height!="auto"&&!c.boxSizing){b=Bd(a,c.width,"width","pixelWidth");a=Bd(a,c.height,"height","pixelHeight");return new F(b,a)}else{c=wd(a);b=yd(a,"padding");a=zd(a);return new F(c.width-a.left-b.left-b.right-a.right,c.height-a.top-b.top-b.bottom-a.bottom)}} +function Bd(a,b,c,d){if(/^\d+px?$/.test(b))return parseInt(b,10);else{var f=a.style[c],g=a.runtimeStyle[c];a.runtimeStyle[c]=a.currentStyle[c];a.style[c]=b;b=a.style[d];a.style[c]=f;a.runtimeStyle[c]=g;return b}}function Cd(a,b){return Bd(a,a.currentStyle?a.currentStyle[b]:null,"left","pixelLeft")} +function yd(a,b){if(u){var c=Cd(a,b+"Left"),d=Cd(a,b+"Right"),f=Cd(a,b+"Top"),g=Cd(a,b+"Bottom");return new oc(f,d,g,c)}else{c=bd(a,b+"Left");d=bd(a,b+"Right");f=bd(a,b+"Top");g=bd(a,b+"Bottom");return new oc(parseFloat(f),parseFloat(d),parseFloat(g),parseFloat(c))}}var Dd={thin:2,medium:4,thick:6};function Ed(a,b){if((a.currentStyle?a.currentStyle[b+"Style"]:null)=="none")return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;if(c in Dd)return Dd[c];return Bd(a,c,"left","pixelLeft")} +function zd(a){if(u){var b=Ed(a,"borderLeft"),c=Ed(a,"borderRight"),d=Ed(a,"borderTop");a=Ed(a,"borderBottom");return new oc(d,c,a,b)}else{b=bd(a,"borderLeftWidth");c=bd(a,"borderRightWidth");d=bd(a,"borderTopWidth");a=bd(a,"borderBottomWidth");return new oc(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}};function Fd(){}r(Fd);Fd.prototype.Pi=0;Fd.g();function P(a){this.p=a||I();this.wd=Gd}t(P,N);P.prototype.Bi=Fd.g();var Gd=null;function Hd(a,b){switch(a){case 1:return b?"disable":"enable";case 2:return b?"highlight":"unhighlight";case 4:return b?"activate":"deactivate";case 8:return b?"select":"unselect";case 16:return b?"check":"uncheck";case 32:return b?"focus":"blur";case 64:return b?"open":"close";default:}throw Error("Invalid component state");}m=P.prototype;m.vc=null;m.u=false;m.c=null;m.wd=null;m.pf=null;m.z=null;m.X=null;m.Ma=null; +m.sh=false;function Id(a){return a.vc||(a.vc=":"+(a.Bi.Pi++).toString(36))}function Jd(a,b){if(a.z&&a.z.Ma){cb(a.z.Ma,a.vc);db(a.z.Ma,b,a)}a.vc=b}m.a=e("c");m.H=function(){return this.tc||(this.tc=new kc(this))};function Kd(a,b){if(a==b)throw Error("Unable to set parent component");if(b&&a.z&&a.vc&&Ld(a.z,a.vc)&&a.z!=b)throw Error("Unable to set parent component");a.z=b;P.b.Bf.call(a,b)}m.Bf=function(a){if(this.z&&this.z!=a)throw Error("Method not supported");P.b.Bf.call(this,a)};m.i=e("p"); +m.d=function(){this.c=this.p.createElement("div")};m.W=function(a){Md(this,a)};function Md(a,b,c){if(a.u)throw Error("Component already rendered");a.c||a.d();b?b.insertBefore(a.c,c||null):a.p.r.body.appendChild(a.c);if(!a.z||a.z.u)a.n()}m.m=function(a){if(this.u)throw Error("Component already rendered");else if(a&&this.K(a)){this.sh=true;if(!this.p||this.p.r!=J(a))this.p=I(a);this.A(a);this.n()}else throw Error("Invalid element to decorate");};m.K=k(true);m.A=ba("c"); +m.n=function(){this.u=true;Nd(this,function(a){!a.u&&a.a()&&a.n()})};m.Da=function(){Nd(this,function(a){a.u&&a.Da()});this.tc&&this.tc.ud();this.u=false};m.e=function(){P.b.e.call(this);this.u&&this.Da();if(this.tc){this.tc.w();delete this.tc}Nd(this,function(a){a.w()});!this.sh&&this.c&&Gc(this.c);this.z=this.pf=this.c=this.Ma=this.X=null};m.oa=function(a,b){this.ic(a,Q(this),b)}; +m.ic=function(a,b,c){if(a.u&&(c||!this.u))throw Error("Component already rendered");if(b<0||b>Q(this))throw Error("Child component index out of bounds");if(!this.Ma||!this.X){this.Ma={};this.X=[]}if(a.z==this){this.Ma[Id(a)]=a;rb(this.X,a)}else db(this.Ma,Id(a),a);Kd(a,this);wb(this.X,b,0,a);if(a.u&&this.u&&a.z==this){c=this.L();c.insertBefore(a.a(),c.childNodes[b]||null)}else if(c){this.c||this.d();b=R(this,b+1);Md(a,this.L(),b?b.c:null)}else this.u&&!a.u&&a.c&&a.n()};m.L=e("c"); +function Od(a){if(a.wd==null)a.wd=ld(a.u?a.c:a.p.r.body);return a.wd}m.Kc=function(a){if(this.u)throw Error("Component already rendered");this.wd=a};function Q(a){return a.X?a.X.length:0}function Ld(a,b){var c;if(a.Ma&&b){c=a.Ma;c=b in c?c[b]:void 0;c=c||null}else c=null;return c}function R(a,b){return a.X?a.X[b]||null:null}function Nd(a,b,c){a.X&&mb(a.X,b,c)}function Pd(a,b){return a.X&&b?lb(a.X,b):-1} +m.removeChild=function(a,b){if(a){var c=s(a)?a:Id(a);a=Ld(this,c);if(c&&a){cb(this.Ma,c);rb(this.X,a);if(b){a.Da();a.c&&Gc(a.c)}Kd(a,null)}}if(!a)throw Error("Child is not in parent component");return a};function Qd(a,b){this.md=a||1;this.Fd=b||Rd;this.Le=na(this.lj,this);this.mf=pa()}t(Qd,N);Qd.prototype.enabled=false;var Rd=n.window;m=Qd.prototype;m.wa=null;m.setInterval=function(a){this.md=a;if(this.wa&&this.enabled){this.stop();this.start()}else this.wa&&this.stop()};m.lj=function(){if(this.enabled){var a=pa()-this.mf;if(a>0&&a2147483647?-1:Rd.setTimeout(a,b||0)};function Ud(a){if(typeof a.ib=="function")return a.ib();if(s(a))return a.split("");if(ga(a)){for(var b=[],c=a.length,d=0;d1){if(b%2)throw Error("Uneven number of arguments");for(var c=0;c2*this.T&&Xd(this);return true}return false};function Xd(a){if(a.T!=a.v.length){for(var b=0,c=0;b=48&&a<=57)return true;if(a>=96&&a<=106)return true;if(a>=65&&a<=90)return true;if(y&&a==0)return true;switch(a){case 32:case 63:case 107:case 109:case 110:case 111:case 186:case 189:case 187:case 188:case 190:case 191:case 192:case 222:case 219:case 220:case 221:return true;default:return false}};function ae(a,b){if(x){a.setAttribute("role",b);a.zj=b}}function be(a,b,c){x&&a.setAttribute("aria-"+b,c)};function ce(a){this.c=a;a=u?"focusout":"blur";this.Fi=D(this.c,u?"focusin":"focus",this,!u);this.Gi=D(this.c,a,this,!u)}t(ce,N);ce.prototype.handleEvent=function(a){var b=new Cb(a.Oa);b.type=a.type=="focusin"||a.type=="focus"?"focusin":"focusout";try{this.dispatchEvent(b)}finally{b.w()}};ce.prototype.e=function(){ce.b.e.call(this);dc(this.Fi);dc(this.Gi);delete this.c};function de(a,b,c){P.call(this,c);this.Y=a||"modal-dialog";this.Mf=!!b;this.pa=ee}t(de,P);m=de.prototype;m.Td=null;m.gi=true;m.cf=true;m.Mf=false;m.he=true;m.ig=true;m.$h=0.5;m.ye="";m.la="";m.pa=null;m.pc=null;m.ea=false;m.bi=false;m.S=null;m.O=null;m.Ja=null;m.gb=null;m.If=null;m.ob=null;m.Ca=null;m.ka=null;m.ca=function(a){this.ye=a;this.gb&&Lc(this.gb,a)};m.t=function(a){this.la=a;if(this.Ca)this.Ca.innerHTML=a};m.L=function(){this.a()||this.W();return this.Ca}; +m.d=function(){fe(this);var a=this.i();this.c=a.d("div",{className:this.Y,tabIndex:0},this.Ja=a.d("div",{className:this.Y+"-title",id:Id(this)},this.gb=a.d("span",this.Y+"-title-text",this.ye),this.ob=a.d("span",this.Y+"-title-close")),this.Ca=a.d("div",this.Y+"-content"),this.ka=a.d("div",this.Y+"-buttons"),this.jh=a.d("span",{tabIndex:0}));this.If=this.Ja.id;ae(this.a(),"dialog");be(this.a(),"labelledby",this.If||"");if(this.la)this.Ca.innerHTML=this.la;O(this.ob,this.cf);O(this.a(),false);if(this.pa){a= +this.pa;a.c=this.ka;a.W()}};function fe(a){if(a.Mf&&a.he&&!a.O){var b;b=a.i().d("iframe",{frameborder:0,style:"border:0;vertical-align:bottom;",src:'javascript:""'});a.O=b;a.O.className=a.Y+"-bg";O(a.O,false);rd(a.O,0)}else if((!a.Mf||!a.he)&&a.O){Gc(a.O);a.O=null}if(a.he&&!a.S){a.S=a.i().d("div",a.Y+"-bg");rd(a.S,a.$h);O(a.S,false)}else if(!a.he&&a.S){Gc(a.S);a.S=null}} +m.W=function(a){if(this.u)throw Error("Component already rendered");this.a()||this.d();a=a||Rc(this.i()).body;ge(this,a);de.b.W.call(this,a)};function ge(a,b){a.O&&b.appendChild(a.O);a.S&&b.appendChild(a.S)}m.K=function(a){return a&&a.tagName&&a.tagName=="DIV"&&de.b.K.call(this,a)}; +m.A=function(a){de.b.A.call(this,a);H(this.a(),this.Y);a=this.Y+"-content";if(this.Ca=vc(null,a,this.a())[0])this.la=this.Ca.innerHTML;else{this.Ca=this.i().d("div",a);if(this.la)this.Ca.innerHTML=this.la;this.a().appendChild(this.Ca)}a=this.Y+"-title";var b=this.Y+"-title-text",c=this.Y+"-title-close";if(this.Ja=vc(null,a,this.a())[0]){this.gb=vc(null,b,this.Ja)[0];this.ob=vc(null,c,this.Ja)[0]}else{this.Ja=this.i().d("div",a);this.a().insertBefore(this.Ja,this.Ca)}if(this.gb)this.ye=Pc(this.gb); +else{this.gb=this.i().d("span",b,this.ye);this.Ja.appendChild(this.gb)}be(this.a(),"labelledby",this.If||"");if(!this.ob){this.ob=this.i().d("span",c);this.Ja.appendChild(this.ob)}O(this.ob,this.cf);a=this.Y+"-buttons";if(this.ka=vc(null,a,this.a())[0]){this.pa=new he(this.i());this.pa.m(this.ka)}else{this.ka=this.i().d("div",a);this.a().appendChild(this.ka);if(this.pa){a=this.pa;a.c=this.ka;a.W()}}fe(this);ge(this,J(this.a()).body);O(this.a(),false)}; +m.n=function(){de.b.n.call(this);this.Td=new ce(Rc(this.i()));if(this.ig&&!this.pc){var a=new Uc(this.a(),this.Ja);H(this.Ja,this.Y+"-title-draggable");this.pc=a}this.H().f(this.ob,E,this.Wi).f(this.Td,"focusin",this.Ti);ae(this.a(),"dialog");this.gb.id!==""&&be(this.a(),"labelledby",this.gb.id)};m.Da=function(){this.I()&&this.l(false);this.Td.w();this.Td=null;if(this.pc){this.pc.w();this.pc=null}de.b.Da.call(this)}; +m.l=function(a){if(a!=this.ea){var b=Rc(this.i()),c=(b?Bc(b):window)||window;this.u||this.W(b.body);if(a){ie(this);this.sa();this.H().f(this.a(),gc,this.me,true).f(this.a(),"keypress",this.me,true).f(c,"resize",this.Sg,true)}else this.H().ja(this.a(),gc,this.me,true).ja(this.a(),"keypress",this.me,true).ja(c,"resize",this.Sg,true);this.O&&O(this.O,a);this.S&&O(this.S,a);O(this.a(),a);a&&this.focus();if(this.ea=a)this.H().f(this.ka,E,this.Og);else{this.H().ja(this.ka,E,this.Og);this.dispatchEvent(je); +this.bi&&this.w()}}};m.I=e("ea");m.focus=function(){try{this.a().focus()}catch(a){}if(this.pa){var b=this.pa.Nd;if(b)for(var c=Rc(this.i()),d=this.ka.getElementsByTagName("button"),f=0,g;g=d[f];f++)if(g.name==b){try{if(y||Oa){var h=c.createElement("input");h.style.cssText="position:fixed;width:0;height:0;left:0;top:0;";this.a().appendChild(h);h.focus();this.a().removeChild(h)}g.focus()}catch(i){}break}}}; +function ie(a){a.O&&O(a.O,false);a.S&&O(a.S,false);var b=Rc(a.i()),c=Ac((b?Bc(b):window)||window||window),d=Math.max(b.body.scrollWidth,c.width);b=Math.max(b.body.scrollHeight,c.height);if(a.O){O(a.O,true);od(a.O,d,b)}if(a.S){O(a.S,true);od(a.S,d,b)}if(a.ig){c=pd(a.a());a.pc.de=new pc(0,0,d-c.width,b-c.height)}} +m.sa=function(){var a=Rc(this.i()),b=(a?Bc(a):window)||window;if(dd(this.a())=="fixed")var c=a=0;else{c=Tc(this.i());a=c.x;c=c.y}var d=pd(this.a());b=Ac(b||window);a=Math.max(a+b.width/2-d.width/2,0);c=Math.max(c+b.height/2-d.height/2,0);ed(this.a(),a,c)};m.Wi=function(){if(this.cf){var a=this.pa,b=a&&a.Me;if(b)this.dispatchEvent(new ke(b,a.rc(b)))&&this.l(false);else this.l(false)}}; +m.e=function(){de.b.e.call(this);if(this.S){Gc(this.S);this.S=null}if(this.O){Gc(this.O);this.O=null}this.jh=this.ka=this.ob=null};function S(a,b){a.pa=b;if(a.ka)if(a.pa){var c=a.pa;c.c=a.ka;c.W()}else a.ka.innerHTML=""}m.Og=function(a){a:{for(a=a.target;a!=null&&a!=this.ka;){if(a.tagName=="BUTTON"){a=a;break a}a=a.parentNode}a=null}if(a&&!a.disabled){a=a.name;this.dispatchEvent(new ke(a,this.pa.rc(a)))&&this.l(false)}}; +m.me=function(a){var b=false,c=false,d=this.pa,f=a.target;if(a.type==gc)if(this.gi&&a.keyCode==27){var g=d&&d.Me;f=f.tagName=="SELECT"&&!f.disabled;if(g&&!f){c=true;b=this.dispatchEvent(new ke(g,d.rc(g)))}else f||(b=true)}else{if(a.keyCode==9&&a.shiftKey&&f==this.a())c=true}else if(a.keyCode==13){if(f.tagName=="BUTTON")g=f.name;else if(d){var h=d.Nd,i;if(i=h)a:{i=d.c.getElementsByTagName("BUTTON");for(var j=0,l;l=i[j];j++)if(l.name==h||l.id==h){i=l;break a}i=null}i=i;f=(f.tagName=="TEXTAREA"||f.tagName== +"SELECT")&&!f.disabled;if(i&&!i.disabled&&!f)g=h}if(g){c=true;b=this.dispatchEvent(new ke(g,String(d.rc(g))))}}if(b||c){a.stopPropagation();a.preventDefault()}b&&this.l(false)};m.Sg=function(){ie(this)};m.Ti=function(a){this.jh==a.target&&Td(this.ii,0,this)};m.ii=function(){u&&Rc(this.i()).body.focus();this.a().focus()};function ke(a,b){this.type=le;this.key=a;this.caption=b}t(ke,C);var le="dialogselect",je="afterhide";function he(a){this.p=a||I();Wd.call(this)}var ee,me,ne;t(he,Wd);m=he.prototype; +m.Y="goog-buttonset";m.Nd=null;m.c=null;m.Me=null;m.J=function(a,b,c,d){Wd.prototype.J.call(this,a,b);if(c)this.Nd=a;if(d)this.Me=a;return this};m.W=function(){if(this.c){this.c.innerHTML="";var a=I(this.c);Vd(this,function(b,c){var d=a.d("button",{name:c},b);if(c==this.Nd)d.className=this.Y+"-default";this.c.appendChild(d)},this)}}; +m.m=function(a){if(!(!a||a.nodeType!=1)){this.c=a;a=this.c.getElementsByTagName("button");for(var b=0,c,d,f;c=a[b];b++){d=c.name||c.id;f=Pc(c)||c.value;if(d){var g=b==0;this.J(d,f,g,c.name==oe);g&&H(c,this.Y+"-default")}}}};var oe="cancel",pe=qa("OK"),qe=qa("Cancel"),re=qa("Yes"),se=qa("No"),te=qa("Save"),ue=qa("Continue");me=(new he).J("ok",pe,true,true);ee=(new he).J("ok",pe,true).J(oe,qe,false,true);ne=(new he).J("yes",re,true).J("no",se,false,true); +(new he).J("yes",re).J("no",se,true).J(oe,qe,false,true);(new he).J("continue",ue).J("save",te).J(oe,qe,true,true);function ve(a,b,c,d){P.call(this,d);this.C=c;this.cd=a;this.oa(a);this.xd=b;this.oa(b)}t(ve,P);m=ve.prototype;m.cc=null;m.fa=null;m.Jc=null;m.uc=5;m.ff=null;m.Zg=null;m.bd=null;m.fg=true;m.ab=null;m.d=function(){var a=this.i(),b=a.d("div","goog-splitpane-first-container"),c=a.d("div","goog-splitpane-second-container"),d=a.d("div","goog-splitpane-handle");this.c=a.d("div","goog-splitpane",b,c,d);this.fa=b;this.Jc=c;this.Ba=d;we(this);xe(this)}; +m.K=function(a){var b="goog-splitpane-first-container";b=vc(null,b,a)[0];if(!b)return false;this.fa=b;b="goog-splitpane-second-container";b=vc(null,b,a)[0];if(!b)return false;this.Jc=b;b="goog-splitpane-handle";a=vc(null,b,a)[0];if(!a)return false;this.Ba=a;return true};m.A=function(a){ve.b.A.call(this,a);we(this);a=wd(a);ye(this,new F(a.width,a.height));xe(this)}; +function xe(a){var b=a.i();a.cd.a()||a.cd.d();b.appendChild(a.fa,a.cd.a());a.xd.a()||a.xd.d();b.appendChild(a.Jc,a.xd.a());a.cc=new Uc(a.Ba,a.Ba);a.fa.style.position="absolute";a.Jc.style.position="absolute";a=a.Ba.style;a.position="absolute";a.overflow="hidden";a.zIndex=2}m.n=function(){ve.b.n.call(this);var a=this.a();if(dd(a)=="static")a.style.position="relative";this.H().f(this.Ba,"dblclick",this.oi).f(this.cc,"start",this.qi).f(this.cc,"drag",this.ri).f(this.cc,"end",this.pi);ze(this,this.ff)}; +function Ae(a){return a.C=="vertical"}function we(a){if(Ae(a)){a.Ba.style.height=a.uc+"px";H(a.Ba,"goog-splitpane-handle-vertical")}else{a.Ba.style.width=a.uc+"px";H(a.Ba,"goog-splitpane-handle-horizontal")}} +m.Cd=function(a){if(this.C!=a){this.C=a;a=Ae(this);if(this.u){Ae(this)?tc(this.Ba,"goog-splitpane-handle-horizontal","goog-splitpane-handle-vertical"):tc(this.Ba,"goog-splitpane-handle-vertical","goog-splitpane-handle-horizontal");if(ha(this.bd)){var b=wd(this.a());ze(this,this.bd*(a?b.height/b.width:b.width/b.height))}else ze(this)}}};function Be(a,b,c){ed(b,c.left,c.top);xd(b,new F(Math.max(c.width,0),Math.max(c.height,0)))} +function ze(a,b){var c=wd(a.a()),d=Ae(a),f=ha(b)?b:ha(a.bd)?a.bd:Math.floor((d?c.height:c.width)/2);a.bd=f;var g,h,i,j,l,o,p;if(d){f=f;i=d=c.width;j=a.uc;h=c.height-f-j;g=c.width;p=0+f;o=0;l=p+j;c=0}else{d=f;f=c.height;i=a.uc;j=c.height;g=c.width-d-i;h=c.height;o=0+d;p=0;c=o+i;l=0}Be(a,a.fa,new pc(0,0,d,f));typeof a.cd.xf=="function"&&a.cd.xf(new F(d,f));Be(a,a.Ba,new pc(o,p,i,j));Be(a,a.Jc,new pc(c,l,g,h));typeof a.xd.xf=="function"&&a.xd.xf(new F(g,h));a.dispatchEvent("change")} +function ye(a,b){xd(a.a(),b);a.ab&&xd(a.ab,b);ze(a)} +m.qi=function(){if(!this.ab){var a="position: relative";if(u)a+=";background-color: #000;filter: Alpha(Opacity=0)";this.ab=this.i().d("div",{style:a});this.i().appendChild(this.a(),this.ab)}this.ab.style.zIndex=1;xd(this.ab,wd(this.a()));var b=gd(this.fa);var c=a=0,d=b.x;b=b.y;var f=wd(this.fa),g=Ad(this.fa),h=Ad(this.Jc);if(Ae(this)){c=g.height+h.height;b+=f.height-g.height}else{a=g.width+h.width;d+=f.width-g.width}this.cc.de=new pc(d,b,a,c)||new pc(NaN,NaN,NaN,NaN)}; +m.ri=function(a){if(this.fg)Ae(this)?ze(this,a.top-gd(this.fa).y):ze(this,a.left-gd(this.fa).x)};m.pi=function(a){this.ab.style.zIndex=-1;this.fg||(Ae(this)?ze(this,a.top-gd(this.fa).y):ze(this,a.left-gd(this.fa).x))};m.oi=function(){var a=md(this.Ba,this.fa),b=wd(this.fa),c=Ad(this.fa),d=Ae(this);if(d){b=b.height-c.height;a=a.y}else{b=b.width-c.width;a=a.x}if(b==a)ze(this,this.Zg);else{this.Zg=d?wd(this.fa).height:wd(this.fa).width;ze(this,b)}}; +m.e=function(){ve.b.e.call(this);this.cc.w();this.cc=null;Gc(this.ab);this.ab=null};function Ce(){}var De;r(Ce);function Ee(a,b){var c=new a;c.k=function(){return b};return c}m=Ce.prototype;m.Qa=aa();m.d=function(a){return a.i().d("div",this.sc(a).join(" "),a.la)};m.L=function(a){return a};m.ad=function(a,b,c){if(a=a.a?a.a():a)if(u&&!z("7")){var d=Fe(this,rc(a),b);d.push(b);oa(c?H:sc,a).apply(null,d)}else c?H(a,b):sc(a,b)};m.K=k(true); +m.m=function(a,b){b.id&&Jd(a,b.id);var c=this.L(b);if(c&&c.firstChild)Ge(a,c.firstChild.nextSibling?ub(c.childNodes):c.firstChild);else a.la=null;var d=0,f=this.k(),g=this.k(),h=false,i=false;c=false;var j=rc(b);mb(j,function(p){if(!h&&p==f){h=true;if(g==f)i=true}else if(!i&&p==g)i=true;else d|=this.Ve(p)},this);a.o=d;if(!h){j.push(f);if(g==f)i=true}i||j.push(g);var l=a.Pa;l&&j.push.apply(j,l);if(u&&!z("7")){var o=Fe(this,j);if(o.length>0){j.push.apply(j,o);c=true}}if(!h||!i||l||c)b.className=j.join(" "); +return b};m.yc=function(a){Od(a)&&this.Kc(a.a(),true);a.B()&&this.Hb(a,a.I())};m.yd=function(a,b){vd(a,!b,!u&&!Oa)};m.Kc=function(a,b){this.ad(a,this.k()+"-rtl",b)};m.Ab=function(a){var b;if(a.da&32&&(b=a.U()))return Oc(b);return false};m.Hb=function(a,b){var c;if(a.da&32&&(c=a.U())){if(!b&&a.o&32){try{c.blur()}catch(d){}a.o&32&&a.Sb(null)}if(Oc(c)!=b){c=c;if(b)c.tabIndex=0;else c.removeAttribute("tabIndex")}}};m.l=function(a,b){O(a,b)}; +m.Aa=function(a,b,c){var d=a.a();if(d){var f=this.ed(b);f&&this.ad(a,f,c);this.Sc(d,b,c)}};m.Sc=function(a,b,c){if(x){De||(De=gb(1,"disabled",4,"pressed",8,"selected",16,"checked",64,"expanded"));(b=De[b])&&be(a,b,c)}};m.t=function(a,b){var c=this.L(a);if(c){Fc(c);if(b)if(s(b))Lc(c,b);else{var d=function(f){if(f){var g=J(c);c.appendChild(s(f)?g.createTextNode(f):f)}};if(fa(b))mb(b,d);else ga(b)&&!("nodeType"in b)?mb(ub(b),d):d(b)}}};m.U=function(a){return a.a()};m.k=k("goog-control"); +m.sc=function(a){var b=this.k(),c=[b],d=this.k();d!=b&&c.push(d);b=a.o;for(d=[];b;){var f=b&-b;d.push(this.ed(f));b&=~f}c.push.apply(c,d);(a=a.Pa)&&c.push.apply(c,a);u&&!z("7")&&c.push.apply(c,Fe(this,c));return c};function Fe(a,b,c){var d=[];if(c)b=b.concat([c]);mb([],function(f){if(pb(f,oa(B,b))&&(!c||B(f,c)))d.push(f.join("_"))});return d}m.ed=function(a){this.Kd||He(this);return this.Kd[a]}; +m.Ve=function(a){if(!this.ih){this.Kd||He(this);var b=this.Kd,c={};for(var d in b)c[b[d]]=d;this.ih=c}a=parseInt(this.ih[a],10);return isNaN(a)?0:a};function He(a){var b=a.k();a.Kd=gb(1,b+"-disabled",2,b+"-hover",4,b+"-active",8,b+"-selected",16,b+"-checked",32,b+"-focused",64,b+"-open")};function Ie(a,b){if(!a)throw Error("Invalid class name "+a);if(!ia(b))throw Error("Invalid decorator function "+b);Je[a]=b}function Ke(a){for(var b=rc(a),c=0,d=b.length;c=0&&b.charCode<63232&&$d(c)?b.charCode:0}else if(Oa){c=this.Bb;d=$d(c)?b.keyCode:0}else{c=b.keyCode||this.Bb;d=b.charCode||0;if(Ia&&d==63&&!c)c=191}var f=c,g=b.keyIdentifier;if(c)if(c>=63232&&c in Pe)f=Pe[c];else{if(c==25&&a.shiftKey)f=9}else if(g&&g in Qe)f=Qe[g];a=f==this.Db;this.Db=f;b=new Te(f,d,a,b);try{this.dispatchEvent(b)}finally{b.w()}}; +m.a=e("c");function Oe(a,b,c){a.be&&a.detach();a.c=b;a.ae=D(a.c,"keypress",a,c);a.jf=D(a.c,gc,a.Ye,c,a);a.be=D(a.c,"keyup",a.si,c,a)}m.detach=function(){if(this.ae){dc(this.ae);dc(this.jf);dc(this.be);this.be=this.jf=this.ae=null}this.c=null;this.Bb=this.Db=-1};m.e=function(){Ne.b.e.call(this);this.detach()};function Te(a,b,c,d){d&&this.xc(d,void 0);this.type="key";this.keyCode=a;this.charCode=b;this.repeat=c}t(Te,Cb);function T(a,b,c){P.call(this,c);if(!(b=b)){b=this.constructor;for(var d;b;){d=ka(b);if(d=Le[d])break;b=b.b?b.b.constructor:null}b=d?ia(d.g)?d.g():new d:null}this.h=b;this.la=a}t(T,P);m=T.prototype;m.la=null;m.o=0;m.da=39;m.Zf=255;m.Ff=0;m.ea=true;m.Pa=null;m.Xd=true;m.Id=false;function Ue(a,b){a.u&&b!=a.Xd&&Ve(a,b);a.Xd=b}m.U=function(){return this.h.U(this)};m.Ud=function(){return this.ha||(this.ha=new Ne)}; +m.ad=function(a,b){if(b){if(a){if(this.Pa)B(this.Pa,a)||this.Pa.push(a);else this.Pa=[a];this.h.ad(this,a,true)}}else if(a&&this.Pa){rb(this.Pa,a);if(this.Pa.length==0)this.Pa=null;this.h.ad(this,a,false)}};m.d=function(){var a=this.h.d(this);this.c=a;if(x){var b=this.h.Qa();b&&ae(a,b)}this.Id||this.h.yd(a,false);this.I()||this.h.l(a,false)};m.L=function(){return this.h.L(this.a())};m.K=function(a){return this.h.K(a)}; +m.A=function(a){this.c=a=this.h.m(this,a);if(x){var b=this.h.Qa();b&&ae(a,b)}this.Id||this.h.yd(a,false);this.ea=a.style.display!="none"};m.n=function(){T.b.n.call(this);this.h.yc(this);if(this.da&-2){this.Xd&&Ve(this,true);if(this.da&32){var a=this.U();if(a){var b=this.Ud();Oe(b,a);this.H().f(b,"key",this.jb).f(a,"focus",this.Wd).f(a,"blur",this.Sb)}}}}; +function Ve(a,b){var c=a.H(),d=a.a();if(b){c.f(d,"mouseover",a.af).f(d,"mousedown",a.Ub).f(d,"mouseup",a.kd).f(d,"mouseout",a.$e);u&&c.f(d,"dblclick",a.tg)}else{c.ja(d,"mouseover",a.af).ja(d,"mousedown",a.Ub).ja(d,"mouseup",a.kd).ja(d,"mouseout",a.$e);u&&c.ja(d,"dblclick",a.tg)}}m.Da=function(){T.b.Da.call(this);this.ha&&this.ha.detach();this.I()&&this.B()&&this.h.Hb(this,false)};m.e=function(){T.b.e.call(this);if(this.ha){this.ha.w();delete this.ha}delete this.h;this.Pa=this.la=null}; +m.t=function(a){this.h.t(this.a(),a);this.la=a};function Ge(a,b){a.la=b}function We(a,b){var c=a.la;if(!c||s(c))return c;return(c=fa(c)?nb(c,b).join(""):Pc(c))&&sa(c)}m.dd=function(){return We(this,Pc)};m.Kc=function(a){T.b.Kc.call(this,a);var b=this.a();b&&this.h.Kc(b,a)};m.yd=function(a){this.Id=a;var b=this.a();b&&this.h.yd(b,a)};m.I=e("ea");m.l=function(a,b){if(b||this.ea!=a&&this.dispatchEvent(a?"show":"hide")){var c=this.a();c&&this.h.l(c,a);this.B()&&this.h.Hb(this,a);this.ea=a;return true}return false}; +m.B=function(){return!!!(this.o&1)};m.M=function(a){var b=this.z;if(!(b&&typeof b.B=="function"&&!b.B())&&Xe(this,1,!a)){if(!a){this.setActive(false);this.fb(false)}this.I()&&this.h.Hb(this,a);this.Aa(1,!a)}};m.fb=function(a){Xe(this,2,a)&&this.Aa(2,a)};m.zc=function(){return!!(this.o&4)};m.setActive=function(a){Xe(this,4,a)&&this.Aa(4,a)};m.nd=function(){return!!(this.o&8)};m.Ef=function(a){Xe(this,8,a)&&this.Aa(8,a)};m.Ac=function(){return!!(this.o&16)}; +m.zd=function(a){Xe(this,16,a)&&this.Aa(16,a)};m.N=function(a){Xe(this,64,a)&&this.Aa(64,a)};m.Aa=function(a,b){if(this.da&a&&b!=!!(this.o&a)){this.h.Aa(this,a,b);this.o=b?this.o|a:this.o&~a}};function Ye(a,b,c){if(a.u&&a.o&b&&!c)throw Error("Component already rendered");!c&&a.o&b&&a.Aa(b,false);a.da=c?a.da|b:a.da&~b}function Ze(a,b){return!!(a.Zf&b)&&!!(a.da&b)}function Xe(a,b,c){return!!(a.da&b)&&!!(a.o&b)!=c&&(!(a.Ff&b)||a.dispatchEvent(Hd(b,c)))&&!a.Pd} +m.af=function(a){!$e(a,this.a())&&this.dispatchEvent("enter")&&this.B()&&Ze(this,2)&&this.fb(true)};m.$e=function(a){if(!$e(a,this.a())&&this.dispatchEvent("leave")){Ze(this,4)&&this.setActive(false);Ze(this,2)&&this.fb(false)}};function $e(a,b){return!!a.relatedTarget&&Kc(b,a.relatedTarget)}m.Ub=function(a){if(this.B()){Ze(this,2)&&this.fb(true);if(Eb(a,0)){Ze(this,4)&&this.setActive(true);this.h.Ab(this)&&this.U().focus()}}!this.Id&&Eb(a,0)&&a.preventDefault()}; +m.kd=function(a){if(this.B()){Ze(this,2)&&this.fb(true);this.zc()&&this.Yb(a)&&Ze(this,4)&&this.setActive(false)}};m.tg=function(a){this.B()&&this.Yb(a)};m.Yb=function(a){Ze(this,16)&&this.zd(!this.Ac());Ze(this,8)&&this.Ef(true);Ze(this,64)&&this.N(!!!(this.o&64));var b=new C("action",this);if(a)for(var c=["altKey","ctrlKey","metaKey","shiftKey","platformModifierKey"],d,f=0;d=c[f];f++)b[d]=a[d];return this.dispatchEvent(b)};m.Wd=function(){Ze(this,32)&&Xe(this,32,true)&&this.Aa(32,true)}; +m.Sb=function(){Ze(this,4)&&this.setActive(false);Ze(this,32)&&Xe(this,32,false)&&this.Aa(32,false)};m.jb=function(a){if(this.I()&&this.B()&&this.Tb(a)){a.preventDefault();a.stopPropagation();return true}return false};m.Tb=function(a){return a.keyCode==13&&this.Yb(a)};if(!ia(T))throw Error("Invalid component class "+T);if(!ia(Ce))throw Error("Invalid renderer class "+Ce);var af=ka(T);Le[af]=Ce;Ie("goog-control",function(){return new T(null)});function bf(){}t(bf,Ce);r(bf);bf.prototype.d=function(a){return a.i().d("div",this.k())};bf.prototype.m=function(a,b){if(b.tagName=="HR"){var c=b;b=this.d(a);c.parentNode&&c.parentNode.insertBefore(b,c);Gc(c)}else H(b,this.k());return b};bf.prototype.t=aa();bf.prototype.k=k("goog-menuseparator");function cf(a,b){T.call(this,null,a||bf.g(),b);Ye(this,1,false);Ye(this,2,false);Ye(this,4,false);Ye(this,32,false);this.o=1}t(cf,T);cf.prototype.n=function(){cf.b.n.call(this);ae(this.a(),"separator")};Ie("goog-menuseparator",function(){return new cf});function df(){}r(df);m=df.prototype;m.Qa=aa();function ef(a,b,c){if(b)b.tabIndex=c?0:-1}m.d=function(a){return a.i().d("div",this.sc(a).join(" "))};m.L=function(a){return a};m.K=function(a){return a.tagName=="DIV"};m.m=function(a,b){b.id&&Jd(a,b.id);var c=this.k(),d=false,f=rc(b);f&&mb(f,function(g){if(g==c)d=true;else if(g)if(g==c+"-disabled")a.M(false);else if(g==c+"-horizontal")a.Cd(ff);else g==c+"-vertical"&&a.Cd(gf)},this);d||H(b,c);hf(this,a,b);return b}; +function hf(a,b,c,d){if(c){d=d||c.firstChild;for(var f;d&&d.parentNode==c;){f=d.nextSibling;if(d.nodeType==1){var g=a.fd(d);if(g){g.c=d;b.B()||g.M(false);b.oa(g);g.m(d)}}else if(!d.nodeValue||sa(d.nodeValue)=="")c.removeChild(d);d=f}}}m.fd=function(a){return Ke(a)};m.yc=function(a){a=a.a();vd(a,true,x);if(u)a.hideFocus=true;var b=this.Qa();b&&ae(a,b)};m.U=function(a){return a.a()};m.k=k("goog-container"); +m.sc=function(a){var b=this.k(),c=[b,a.C==ff?b+"-horizontal":b+"-vertical"];a.B()||c.push(b+"-disabled");return c};m.og=function(){return gf};function U(a,b,c){P.call(this,c);this.h=b||df.g();this.C=a||this.h.og()}t(U,P);var ff="horizontal",gf="vertical";m=U.prototype;m.Eg=null;m.ha=null;m.h=null;m.C=null;m.ea=true;m.Q=true;m.Te=true;m.ga=-1;m.V=null;m.mb=false;m.Wh=false;m.Xi=true;m.sb=null;m.U=function(){return this.Eg||this.h.U(this)};m.Ud=function(){return this.ha||(this.ha=new Ne(this.U()))};m.d=function(){this.c=this.h.d(this)};m.L=function(){return this.h.L(this.a())};m.K=function(a){return this.h.K(a)}; +m.A=function(a){this.c=this.h.m(this,a);if(a.style.display=="none")this.ea=false};m.n=function(){U.b.n.call(this);Nd(this,function(b){b.u&&jf(this,b)},this);var a=this.a();this.h.yc(this);this.l(this.ea,true);this.H().f(this,"enter",this.We).f(this,"highlight",this.Xe).f(this,"unhighlight",this.bf).f(this,"open",this.wi).f(this,"close",this.li).f(a,"mousedown",this.Ub).f(J(a),"mouseup",this.ni).f(a,["mousedown","mouseup","mouseover","mouseout"],this.ki);this.Ab()&&kf(this,true)}; +function kf(a,b){var c=a.H(),d=a.U();b?c.f(d,"focus",a.Wd).f(d,"blur",a.Sb).f(a.Ud(),"key",a.jb):c.ja(d,"focus",a.Wd).ja(d,"blur",a.Sb).ja(a.Ud(),"key",a.jb)}m.Da=function(){lf(this,-1);this.V&&this.V.N(false);this.mb=false;U.b.Da.call(this)};m.e=function(){U.b.e.call(this);if(this.ha){this.ha.w();this.ha=null}this.h=this.V=this.sb=null};m.We=k(true); +m.Xe=function(a){var b=Pd(this,a.target);if(b>-1&&b!=this.ga){var c=R(this,this.ga);c&&c.fb(false);this.ga=b;c=R(this,this.ga);this.mb&&c.setActive(true);if(this.Xi&&this.V&&c!=this.V)c.da&64?c.N(true):this.V.N(false)}be(this.a(),"activedescendant",a.target.a().id)};m.bf=function(a){if(a.target==R(this,this.ga))this.ga=-1;be(this.a(),"activedescendant","")};m.wi=function(a){if((a=a.target)&&a!=this.V&&a.z==this){this.V&&this.V.N(false);this.V=a}};m.li=function(a){if(a.target==this.V)this.V=null}; +m.Ub=function(a){if(this.Q)this.mb=true;var b=this.U(),c;a:{if(b)if((c=b.getAttributeNode("tabindex"))&&c.specified){c=b.tabIndex;c=ha(c)&&c>=0;break a}c=false}c?b.focus():a.preventDefault()};m.ni=function(){this.mb=false}; +m.ki=function(a){var b;a:{b=a.target;if(this.sb)for(var c=this.a();b&&b.parentNode&&b!=c;){var d=b.id;if(d in this.sb){b=this.sb[d];break a}b=b.parentNode}b=null}if(b)switch(a.type){case "mousedown":b.Ub(a);break;case "mouseup":b.kd(a);break;case "mouseover":b.af(a);break;case "mouseout":b.$e(a);break}};m.Wd=aa();m.Sb=function(){lf(this,-1);this.mb=false;this.V&&this.V.N(false)};m.jb=function(a){if(this.B()&&this.I()&&(Q(this)!=0||this.Eg)&&this.Tb(a)){a.preventDefault();a.stopPropagation();return true}return false}; +m.Tb=function(a){var b=R(this,this.ga);if(b&&typeof b.jb=="function"&&b.jb(a))return true;if(this.V&&this.V!=b&&typeof this.V.jb=="function"&&this.V.jb(a))return true;if(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)return false;switch(a.keyCode){case 27:if(this.Ab())this.U().blur();else return false;break;case 36:mf(this);break;case 35:nf(this);break;case 38:if(this.C==gf)of(this);else return false;break;case 37:if(this.C==ff)Od(this)?pf(this):of(this);else return false;break;case 40:if(this.C==gf)pf(this); +else return false;break;case 39:if(this.C==ff)Od(this)?of(this):pf(this);else return false;break;default:return false}return true};function jf(a,b){var c=b.a();c=c.id||(c.id=Id(b));if(!a.sb)a.sb={};a.sb[c]=b}m.oa=function(a,b){U.b.oa.call(this,a,b)};m.ic=function(a,b,c){a.Ff|=2;a.Ff|=64;if(this.Ab()||!this.Wh)Ye(a,32,false);Ue(a,false);U.b.ic.call(this,a,b,c);c&&this.u&&jf(this,a);b<=this.ga&&this.ga++}; +m.removeChild=function(a,b){if(a=s(a)?Ld(this,a):a){var c=Pd(this,a);if(c!=-1)if(c==this.ga)a.fb(false);else c-1&&R(a,a.ga).fb(false)}m.fb=function(a){lf(this,Pd(this,a))}; +function mf(a){qf(a,function(b,c){return(b+1)%c},Q(a)-1)}function nf(a){qf(a,function(b,c){b--;return b<0?c-1:b},0)}function pf(a){qf(a,function(b,c){return(b+1)%c},a.ga)}function of(a){qf(a,function(b,c){b--;return b<0?c-1:b},a.ga)}function qf(a,b,c){c=c<0?Pd(a,a.V):c;var d=Q(a);c=b.call(a,c,d);for(var f=0;f<=d;){var g=R(a,c);if(g&&a.bg(g)){lf(a,c);return true}f++;c=b.call(a,c,d)}return false}m.bg=function(a){return a.I()&&a.B()&&!!(a.da&2)};var W={};function rf(){}rf.prototype.id=q;rf.prototype.Ld=function(a){if(this.id()>a.id())return 1;else if(this.id()a.name())return 1;else if(this.name()0&&c.push(", ");var g;g=d[f];switch(typeof g){case "object":g=g?"object":"null";break;case "string":g=g;break;case "number":g=String(g);break;case "boolean":g=g?"true":"false";break;case "function":g=(g=Cf(g))?g:"[fn]";break;case "undefined":default:g=typeof g;break}if(g.length>40)g=g.substr(0,40)+"...";c.push(g)}b.push(a);c.push(")\n");try{c.push(Bf(a.caller, +b))}catch(h){c.push("[exception trying to get caller]\n")}}else a?c.push("[...long stack...]"):c.push("[end]");return c.join("")}function Cf(a){a=String(a);if(!Df[a]){var b=/function ([^\(]+)/.exec(a);Df[a]=b?b[1]:"[Anonymous]"}return Df[a]}var Df={};function Ef(a,b,c,d,f){this.reset(a,b,c,d,f)}Ef.prototype.fj=0;Ef.prototype.Se=null;Ef.prototype.Re=null;var Ff=0;Ef.prototype.reset=function(a,b,c,d,f){this.fj=typeof f=="number"?f:Ff++;this.kh=d||pa();this.Cc=a;this.Ni=b;this.Hi=c;delete this.Se;delete this.Re};Ef.prototype.Af=ba("Cc");function Gf(a){this.Oi=a}Gf.prototype.z=null;Gf.prototype.Cc=null;Gf.prototype.X=null;Gf.prototype.ld=null;function Hf(a,b){this.name=a;this.value=b}Hf.prototype.toString=e("name");var If=new Hf("SHOUT",1200),Jf=new Hf("SEVERE",1E3),Kf=new Hf("WARNING",900),Lf=new Hf("INFO",800),Mf=new Hf("CONFIG",700),Nf=new Hf("FINE",500),Of=new Hf("FINEST",300),Pf=new Hf("ALL",0);m=Gf.prototype;m.Af=ba("Cc"); +function Qf(a){if(a.Cc)return a.Cc;if(a.z)return Qf(a.z);kb("Root logger has no level set.");return null}m.log=function(a,b,c){if(a.value>=Qf(this).value){a=this.ji(a,b,c);for(b=this;b;){c=b;var d=a;if(c.ld)for(var f=0,g=void 0;g=c.ld[f];f++)g(d);b=b.z}}}; +m.ji=function(a,b,c){var d=new Ef(a,String(b),this.Oi);if(c){d.Se=c;var f;var g=arguments.callee.caller;try{var h,i=da("window.location.href");h=typeof c=="string"?{message:c,name:"Unknown error",lineNumber:"Not available",fileName:i,stack:"Not available"}:!c.lineNumber||!c.fileName||!c.stack?{message:c.message,name:c.name,lineNumber:c.lineNumber||c.xj||"Not available",fileName:c.fileName||c.filename||c.sourceURL||i,stack:c.stack||"Not available"}:c;f="Message: "+ua(h.message)+'\nUrl: '+h.fileName+"\nLine: "+h.lineNumber+"\n\nBrowser stack:\n"+ua(h.stack+"-> ")+"[end]\n\nJS stack traversal:\n"+ua(Af(g)+"-> ")}catch(j){f="Exception trying to expose exception! You win, we lose. "+j}d.Re=f}return d};m.info=function(a,b){this.log(Lf,a,b)};function Rf(a,b,c){a.log(Nf,b,c)}m.Dd=ba("z");var Sf={},Tf=null;function Uf(){if(!Tf){Tf=new Gf("");Sf[""]=Tf;Tf.Af(Mf)}}function Vf(){Uf();return Tf} +function Wf(a){Uf();var b;if(!(b=Sf[a])){b=new Gf(a);var c=a.lastIndexOf("."),d=a.substr(0,c);c=a.substr(c+1);d=Wf(d);if(!d.X)d.X={};d.X[c]=b;b.Dd(d);b=Sf[a]=b}return b};function Xf(){if(x){this.Mb={};this.Ee={};this.we=[]}}Xf.prototype.aa=Wf("goog.net.xhrMonitor");Xf.prototype.Q=x;Xf.prototype.M=function(a){this.Q=x&&a};function Yf(a,b){if(a.Q){var c=s(b)?b:ja(b)?ka(b):"";a.aa.log(Of,"Pushing context: "+b+" ("+c+")",void 0);a.we.push(c)}}function Zf(a){if(a.Q){var b=a.we.pop();a.aa.log(Of,"Popping context: "+b,void 0);$f(a,b)}} +function ag(a,b){if(a.Q){var c=ka(b);Rf(a.aa,"Opening XHR : "+c);for(var d=0;d0){Rf(this.aa,lg(this,"Will abort after "+this.xe+"ms if incomplete"));this.ec=Rd.setTimeout(na(this.mj,this),this.xe)}Rf(this.aa,lg(this,"Sending request"));this.Zd=true;this.F.send(a);this.Zd= +false}catch(h){Rf(this.aa,lg(this,"Send error: "+h.message));mg(this,5,h)}};m.dispatchEvent=function(a){if(this.F){Yf(cg,this.F);try{return kg.b.dispatchEvent.call(this,a)}finally{Zf(cg)}}else return kg.b.dispatchEvent.call(this,a)};m.mj=function(){if(typeof ca!="undefined")if(this.F){this.Cb="Timed out after "+this.xe+"ms, aborting";this.od=8;Rf(this.aa,lg(this,this.Cb));this.dispatchEvent("timeout");this.abort(8)}}; +function mg(a,b,c){a.hb=false;if(a.F){a.Vb=true;a.F.abort();a.Vb=false}a.Cb=c;a.od=b;ng(a);og(a)}function ng(a){if(!a.Qe){a.Qe=true;a.dispatchEvent("complete");a.dispatchEvent("error")}}m.abort=function(a){if(this.F){Rf(this.aa,lg(this,"Aborting"));this.hb=false;this.Vb=true;this.F.abort();this.Vb=false;this.od=a||7;this.dispatchEvent("complete");this.dispatchEvent("abort");og(this)}};m.e=function(){if(this.F){if(this.hb){this.hb=false;this.Vb=true;this.F.abort();this.Vb=false}og(this,true)}kg.b.e.call(this)}; +m.Rg=function(){!this.ef&&!this.Zd&&!this.Vb?this.tf():pg(this)};m.tf=function(){pg(this)}; +function pg(a){if(a.hb)if(typeof ca!="undefined")if(a.De[1]&&qg(a)==4&&rg(a)==2)Rf(a.aa,lg(a,"Local request error detected and ignored"));else if(a.Zd&&qg(a)==4)Rd.setTimeout(na(a.Rg,a),0);else{a.dispatchEvent("readystatechange");if(qg(a)==4){Rf(a.aa,lg(a,"Request complete"));a.hb=false;var b;a:switch(rg(a)){case 0:case 200:case 204:case 304:b=true;break a;default:b=false;break a}if(b){a.dispatchEvent("complete");a.dispatchEvent("success")}else{a.od=6;var c;try{c=qg(a)>2?a.F.statusText:""}catch(d){Rf(a.aa, +"Can not get status: "+d.message);c=""}a.Cb=c+" ["+rg(a)+"]";ng(a)}og(a)}}}function og(a,b){if(a.F){var c=a.F,d=a.De[0]?q:null;a.F=null;a.De=null;if(a.ec){Rd.clearTimeout(a.ec);a.ec=null}if(!b){Yf(cg,c);a.dispatchEvent("ready");Zf(cg)}if(cg.Q){var f=ka(c);Rf(cg.aa,"Closing XHR : "+f);delete cg.Ee[f];for(var g in cg.Mb){rb(cg.Mb[g],f);cg.Mb[g].length==0&&delete cg.Mb[g]}}try{c.onreadystatechange=d}catch(h){a.aa.log(Jf,"Problem encountered resetting onreadystatechange: "+h.message,void 0)}}}m.zc=e("hb"); +function qg(a){return a.F?a.F.readyState:0}function rg(a){try{return qg(a)>2?a.F.status:-1}catch(b){a.aa.log(Kf,"Can not get status: "+b.message,void 0);return-1}} +function sg(a,b){if(a.F){var c=a.F.responseText;if(b&&c.indexOf(b)==0)c=c.substring(b.length);var d;a:{c=String(c);if(/^\s*$/.test(c)?false:/^[\],:{}\s\u2028\u2029]*$/.test(c.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x10-\x1f\x80-\x9f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{d=eval("("+c+")");break a}catch(f){}throw Error("Invalid JSON string: "+c);}return d}} +function tg(a){return s(a.Cb)?a.Cb:String(a.Cb)}function lg(a,b){return b+" ["+a.Gg+" "+a.cb+" "+rg(a)+"]"}yb[yb.length]=function(a){kg.prototype.tf=a(kg.prototype.tf)};function ug(){this.vb=[]}m=ug.prototype;m.kb=0;m.dc=0;m.Sd=function(a){this.vb[this.dc++]=a};m.oc=function(){if(this.kb!=this.dc){var a=this.vb[this.kb];delete this.vb[this.kb];this.kb++;return a}};m.ma=function(){return this.dc-this.kb};m.lb=function(){return this.dc-this.kb==0};m.clear=function(){this.dc=this.kb=this.vb.length=0};m.contains=function(a){return B(this.vb,a)};m.remove=function(a){a=lb(this.vb,a);if(a<0)return false;if(a==this.kb)this.oc();else{sb(this.vb,a);this.dc--}return true}; +m.ib=function(){return this.vb.slice(this.kb,this.dc)};function vg(a,b){this.Kg=a||0;this.Xb=b||10;if(this.Kg>this.Xb)throw Error(wg);this.Z=new ug;this.yb=new xf;this.Hd()}t(vg,Ab);var wg="[goog.structs.Pool] Min can not be greater than max";m=vg.prototype;m.Ra=function(){for(var a;this.Z.ma()>0;){a=this.Z.oc();if(this.qf(a))break;else this.Hd()}if(!a&&this.ma()this.Xb&&this.Z.ma()>0;)this.Ob(a.oc())};m.lc=function(){return{}};m.Ob=function(a){if(typeof a.w=="function")a.w();else for(var b in a)a[b]=null};m.qf=function(a){if(typeof a.ai=="function")return a.ai();return true};m.contains=function(a){return this.Z.contains(a)||this.yb.contains(a)};m.ma=function(){return this.Z.ma()+this.yb.ma()}; +m.lb=function(){return this.Z.lb()&&this.yb.lb()};m.e=function(){vg.b.e.call(this);if(this.yb.ma()>0)throw Error("[goog.structs.Pool] Objects not released");delete this.yb;for(var a=this.Z;!a.lb();)this.Ob(a.oc());delete this.Z};function xg(a,b){this.$=a;this.xa=b}xg.prototype.s=e("xa");xg.prototype.Na=function(){return new xg(this.$,this.xa)};function yg(a){this.Ta=[];if(a)a:{var b,c;if(a instanceof yg){b=a.hd();c=a.ib();if(a.ma()<=0){a=this.Ta;for(var d=0;d0;){d=Math.floor((b-1)/2);if(a[d].$>c.$){a[b]=a[d];b=d}else break}a[b]=c}m=yg.prototype; +m.remove=function(){var a=this.Ta,b=a.length,c=a[0];if(!(b<=0)){if(b==1)qb(a);else{a[0]=a.pop();a=0;b=this.Ta;for(var d=b.length,f=b[a];af.$)break;b[a]=b[g];a=g}b[a]=f}return c.s()}};m.ib=function(){for(var a=this.Ta,b=[],c=a.length,d=0;d0;){var c=a.Ra();if(c)b.oc().apply(a,[c]);else return}}Bg.prototype.Je=function(a){Bg.b.Je.call(this,a);Cg(this)};Bg.prototype.Hd=function(){Bg.b.Hd.call(this);Cg(this)};Bg.prototype.e=function(){Bg.b.e.call(this);this.qe.clear();this.qe=null};function Dg(a,b,c){Bg.call(this,b,c);this.Ai=a}t(Dg,Bg);Dg.prototype.lc=function(){var a=new kg,b=this.Ai;b&&Vd(b,function(c,d){a.headers.J(d,c)});return a};Dg.prototype.Ob=function(a){a.w()};Dg.prototype.qf=function(a){return!a.Pd&&!a.zc()};W=W||{};function X(){this.Ug=new Dg({},1);this.pb={}}t(X,N);r(X);function Eg(a){C.call(this,"server_info_change");this.ac=a}t(Eg,C);function Fg(a){C.call(this,"plugin_list_change");this.plugins=a}t(Fg,C);function Gg(a){C.call(this,"universe_list_change");this.pb=a}t(Fg,C);function Hg(a){C.call(this,"plugin_change");this.Zi=a}t(Hg,C);function Ig(a){C.call(this,"universe_change");this.fc=a}t(Ig,C);function Jg(a,b){C.call(this,"uids_change");this.nh=a;this.mh=b}t(Jg,C); +function Kg(a){Y(a,"/json/server_stats",function(b){var c=sg(b.target);this.dispatchEvent(new Eg(c));Z(this,b.target)})}function Lg(a,b){Y(a,"/reload",function(c){b(c);Z(this,c.target)})}function Mg(a,b){Y(a,"/quit",function(c){b(c);Z(this,c.target)})} +function Ng(a){Y(a,"/json/universe_plugin_list",function(b){if(rg(b.target)!=200)W.Ec.info("Request failed: "+String(b.target.cb)+" : "+tg(b.target));else{var c=sg(b.target);this.pb={};for(var d=0;d0;)i=" "+i;g.push("[",Aa(i),"s] ")}d.hj&&g.push("[",ua(a.Hi),"] ");g.push('',ta(Aa(ua(a.Ni))));if(d.dh&&a.Se)g.push("
",ta(Aa(a.Re||"")));g.push("

");c.innerHTML=g.join("");this.c.appendChild(c);if(b)this.c.scrollTop=this.c.scrollHeight};dh.prototype.clear=function(){this.c.innerHTML=""};function eh(a,b,c,d,f,g,h,i){var j,l=c.offsetParent;if(l){var o=l.tagName=="HTML"||l.tagName=="BODY";if(!o||dd(l)!="static"){j=kd(l);o||(j=nc(j,new G(l.scrollLeft,l.scrollTop)))}}l=qd(a);(o=jd(a))&&l.Bg(new pc(o.left,o.top,o.right-o.left,o.bottom-o.top));o=I(a);var p=I(c);if(o.r!=p.r){var w=o.r.body;p=Bc(p.r);var V=new G(0,0),Zb=J(w)?Bc(J(w)):window,zf=w;do{var Xh=Zb==p?kd(zf):nd(zf);V.x+=Xh.x;V.y+=Xh.y}while(Zb&&Zb!=p&&(zf=Zb.frameElement)&&(Zb=Zb.parent));p=V;p=nc(p,kd(w));if(u&&!Sc(o))p=nc(p,Tc(o)); +l.left+=p.x;l.top+=p.y}a=(b&4&&ld(a)?b^2:b)&-5;b=new G(a&2?l.left+l.width:l.left,a&1?l.top+l.height:l.top);if(j)b=nc(b,j);if(f){b.x+=(a&2?-1:1)*f.x;b.y+=(a&1?-1:1)*f.y}var v;if(h)if((v=jd(c))&&j){v.top=Math.max(0,v.top-j.y);v.right-=j.x;v.bottom-=j.y;v.left=Math.max(0,v.left-j.x)}a:{f=b;v=v;f=f.Na();j=0;a=(d&4&&ld(c)?d^2:d)&-5;d=pd(c);i=i?i.Na():d;if(g||a!=0){if(a&2)f.x-=i.width+(g?g.right:0);else if(g)f.x+=g.left;if(a&1)f.y-=i.height+(g?g.bottom:0);else if(g)f.y+=g.top}if(h){if(v){g=f;j=0;if(g.x< +v.left&&h&1){g.x=v.left;j|=1}if(g.xv.right&&h&16){i.width-=g.x+i.width-v.right;j|=4}if(g.x+i.width>v.right&&h&1){g.x=Math.max(v.right-i.width,v.left);j|=1}if(h&2)j|=(g.xv.right?32:0);if(g.y=v.top&&g.y+i.height>v.bottom&&h&32){i.height-=g.y+i.height-v.bottom;j|=8}if(g.y+i.height>v.bottom&&h&4){g.y=Math.max(v.bottom-i.height,v.top);j|=2}if(h&8)j|=(g.yv.bottom?128:0);h=j}else h=256;j=h;if(j& +496){c=j;break a}}ed(c,f);mc(d,i)||od(c,i);c=j}return c};function fh(){}fh.prototype.sa=aa();function gh(a,b){this.element=a;this.kc=b}t(gh,fh);gh.prototype.sa=function(a,b,c){eh(this.element,this.kc,a,b,undefined,c)};function hh(a,b){this.Ea=new kc(this);var c=a||null;ih(this);this.c=c;if(b)this.Qc=b}t(hh,N);m=hh.prototype;m.c=null;m.Yf=true;m.Xf=null;m.Bc=false;m.gj=false;m.lf=-1;m.Fg=-1;m.wg=false;m.di=true;m.Qc="toggle_display";m.a=e("c");function ih(a){if(a.Bc)throw Error("Can not change this state of the popup while showing.");}m.I=e("Bc"); +m.l=function(a){if(a){if(!this.Bc)if(this.dispatchEvent("beforeshow")){if(!this.c)throw Error("Caller must call setElement before trying to show the popup");this.sa();a=J(this.c);this.wg&&this.Ea.f(a,gc,this.Si,true);if(this.Yf){this.Ea.f(a,"mousedown",this.Qg,true);if(u){for(var b=a.activeElement;b&&b.nodeName=="IFRAME";){try{var c=y?b.document||b.contentWindow.document:b.contentDocument||b.contentWindow.document}catch(d){break}a=c;b=a.activeElement}this.Ea.f(a,"mousedown",this.Qg,true);this.Ea.f(a, +"deactivate",this.Pg)}else this.Ea.f(a,"blur",this.Pg)}if(this.Qc=="toggle_display"){this.c.style.visibility="visible";O(this.c,true)}else this.Qc=="move_offscreen"&&this.sa();this.Bc=true;this.lf=pa();this.Fg=-1;this.dispatchEvent("show")}}else jh(this)};m.sa=q; +function jh(a,b){if(!a.Bc||!a.dispatchEvent({type:"beforehide",target:b}))return false;a.Ea&&a.Ea.ud();if(a.Qc=="toggle_display")a.gj?Td(a.xg,0,a):a.xg();else if(a.Qc=="move_offscreen"){a.c.style.left="-200px";a.c.style.top="-200px"}a.Bc=false;a.Fg=pa();a.dispatchEvent({type:"hide",target:b});return true}m.xg=function(){this.c.style.visibility="hidden";O(this.c,false)};m.Qg=function(a){a=a.target;if(!Kc(this.c,a)&&(!this.Xf||Kc(this.Xf,a))&&!(pa()-this.lf<150))jh(this,a)}; +m.Si=function(a){if(a.keyCode==27)if(jh(this,a.target)){a.preventDefault();a.stopPropagation()}};m.Pg=function(a){if(this.di){var b=J(this.c);if(u||Oa){if((a=b.activeElement)&&Kc(this.c,a))return}else if(a.target!=b)return;pa()-this.lf<150||jh(this)}};m.e=function(){hh.b.e.call(this);this.Ea.w();delete this.c;delete this.Ea};function kh(a,b,c){gh.call(this,a,b);this.Vh=c}t(kh,gh);kh.prototype.sa=function(a,b,c,d){var f=eh(this.element,this.kc,a,b,null,c,10,d);if(f&496){var g=this.kc,h=b;if(f&48){g^=2;h^=2}if(f&192){g^=1;h^=1}f=eh(this.element,g,a,h,null,c,10,d);if(f&496)this.Vh?eh(this.element,this.kc,a,b,null,c,5,d):eh(this.element,this.kc,a,b,null,c,0,d)}};function lh(a,b){this.Vg=4;this.uf=b||undefined;hh.call(this,a)}t(lh,hh);lh.prototype.Cf=function(a){this.uf=a||undefined;this.I()&&this.sa()};lh.prototype.sa=function(){if(this.uf){var a=!this.I()&&this.Qc!="move_offscreen",b=this.a();if(a){b.style.visibility="hidden";O(b,true)}this.uf.sa(b,this.Vg,this.Ji);a&&O(b,false)}};W=W||{};W.Ec=Wf("ola");function mh(){Vf().Af(Pf);var a=new dh(K("log"));if(true!=a.Cg){var b=Vf(),c=a.cj;if(!b.ld)b.ld=[];b.ld.push(c);a.Cg=true}this.ge=K("log_control");(new T).m(this.ge);D(this.ge,E,this.Ka,false,this);a=document.getElementById("log_popup");a=this.Eb=new lh(a);ih(a);a.wg=true;a=this.Eb;ih(a);a.Yf=true} +mh.prototype.Ka=function(){this.Eb.l(false);var a=this.Eb;a.Vg=2;a.I()&&a.sa();a=this.Eb;var b=new oc(2,2,2,2);a.Ji=b==null||b instanceof oc?b:new oc(b,void 0,void 0,void 0);a.I()&&a.sa();this.Eb.Cf(new kh(this.ge,3));this.Eb.l(true)};function nh(){this.dg=[]}t(nh,Ce);r(nh);function oh(a,b){var c=a.dg[b];if(!c){switch(b){case 0:c=a.k()+"-highlight";break;case 1:c=a.k()+"-checkbox";break;case 2:c=a.k()+"-content";break}a.dg[b]=c}return c}m=nh.prototype;m.Qa=k("menuitem");m.d=function(a){var b=a.i().d("div",this.sc(a).join(" "),ph(this,a.la,a.i()));qh(this,a,b,!!(a.da&8)||!!(a.da&16));return b};m.L=function(a){return a&&a.firstChild}; +m.m=function(a,b){var c=Hc(b),d=oh(this,2);c&&c.className.indexOf(d)!=-1||b.appendChild(ph(this,b.childNodes,a.i()));if(B(rc(b),"goog-option")){a.re(true);this.re(a,b,true)}return nh.b.m.call(this,a,b)};m.t=function(a,b){var c=this.L(a),d=rh(this,a)?c.firstChild:null;nh.b.t.call(this,a,b);if(d&&!rh(this,a))c.insertBefore(d,c.firstChild||null)};function ph(a,b,c){a=oh(a,2);return c.d("div",a,b)}m.Df=function(a,b,c){if(b){ae(b,c?"menuitemradio":this.Qa());qh(this,a,b,c)}}; +m.re=function(a,b,c){if(b){ae(b,c?"menuitemcheckbox":this.Qa());qh(this,a,b,c)}};function rh(a,b){var c=a.L(b);if(c){c=c.firstChild;var d=oh(a,1);return!!c&&!!c.className&&c.className.indexOf(d)!=-1}return false}function qh(a,b,c,d){if(d!=rh(a,c)){d?H(c,"goog-option"):sc(c,"goog-option");c=a.L(c);if(d){a=oh(a,1);c.insertBefore(b.i().d("div",a),c.firstChild||null)}else c.removeChild(c.firstChild)}} +m.ed=function(a){switch(a){case 2:return oh(this,0);case 16:case 8:return"goog-option-selected";default:return nh.b.ed.call(this,a)}};m.Ve=function(a){var b=oh(this,0);switch(a){case "goog-option-selected":return 16;case b:return 2;default:return nh.b.Ve.call(this,a)}};m.k=k("goog-menuitem");function sh(a,b,c,d){T.call(this,a,d||nh.g(),c);this.ia(b)}t(sh,T);m=sh.prototype;m.s=function(){var a=this.pf;return a!=null?a:this.dd()};m.ia=ba("pf");m.Df=function(a){Ye(this,8,a);this.Ac()&&!a&&this.zd(false);var b=this.a();b&&this.h.Df(this,b,a)};m.re=function(a){Ye(this,16,a);var b=this.a();b&&this.h.re(this,b,a)};m.dd=function(){return We(this,function(a){return B(rc(a),"goog-menuitem-accel")?"":Pc(a)})};Ie("goog-menuitem",function(){return new sh(null)});function th(a,b){var c=Ee(Ce,uh);T.call(this,null,c,b);Ye(this,4,false);this.Za=a!==undefined?a:vh}t(th,T);var vh=false,uh="goog-checkbox",wh=uh+"-checked",xh=uh+"-unchecked",yh=uh+"-undetermined",zh={oj:wh,rj:xh,sj:yh},Ah=gb(true,wh,vh,xh,null,yh);m=th.prototype;m.Ei=null;m.Ac=function(){return this.Za==true};m.zd=function(a){if(a!=this.Za){this.Za=a;Bh(this)}};m.Pc=function(){this.Za=this.Za?vh:true;Bh(this)};m.d=function(){this.A(this.i().createElement("span"))}; +m.A=function(a){th.b.A.call(this,a);a=rc(a);if(B(a,yh))this.Za=null;else if(B(a,wh))this.Za=true;else if(B(a,xh))this.Za=vh;else Bh(this)};m.n=function(){th.b.n.call(this);if(this.Xd)this.H().f(this.Ei||this.a(),E,this.sg)};function Bh(a){var b=a.a();if(b){a=Ah[a.Za];var c=rc(b);if(!B(c,a)){var d=[a],f=$a(zh);mb(c,function(g){B(f,g)||d.push(g)});b.className=d.join(" ")}}}m.M=function(a){th.b.M.call(this,a);if(a=this.a())a.tabIndex=this.B()?0:-1}; +m.sg=function(a){a.stopPropagation();a=this.Za?"uncheck":"check";if(this.B()&&this.dispatchEvent(a)){this.Pc();this.dispatchEvent("change")}};m.Tb=function(a){a.keyCode==32&&this.sg(a);return false};Ie(uh,function(){return new th});function Ch(a,b,c,d){kh.call(this,a,b,c);this.dj=d}t(Ch,kh);Ch.prototype.sa=function(a,b,c,d){this.dj?eh(this.element,this.kc,a,b,null,c,33,d):Ch.b.sa.call(this,a,b,c,d)};function Dh(){}t(Dh,Ce);r(Dh);m=Dh.prototype;m.Qa=k("button");m.Sc=function(a,b,c){if(x)b==16?be(a,"pressed",c):Dh.b.Sc.call(this,a,b,c)};m.d=function(a){var b=Dh.b.d.call(this,a),c=a.jd();c&&this.Ed(b,c);(c=a.s())&&this.ia(b,c);a.da&16&&this.Sc(b,16,false);return b};m.m=function(a,b){b=Dh.b.m.call(this,a,b);var c=this.s(b);a.xa=c;a.Jf=this.jd(b);a.da&16&&this.Sc(b,16,false);return b};m.s=q;m.ia=q;m.jd=function(a){return a.title};m.Ed=function(a,b){if(a)a.title=b||""};m.k=k("goog-button");function Eh(){}t(Eh,Dh);r(Eh);m=Eh.prototype;m.Qa=aa();m.d=function(a){Fh(this,a);return a.i().d("button",{"class":this.sc(a).join(" "),disabled:!a.B(),title:a.jd()||"",value:a.s()||""},a.dd()||"")};m.K=function(a){return a.tagName=="BUTTON"||a.tagName=="INPUT"&&(a.type=="button"||a.type=="submit"||a.type=="reset")};m.m=function(a,b){Fh(this,a);b.disabled&&H(b,this.ed(1));return Eh.b.m.call(this,a,b)};m.yc=function(a){a.H().f(a.a(),E,a.Yb)};m.yd=q;m.Kc=q;m.Ab=function(a){return a.B()};m.Hb=q; +m.Aa=function(a,b,c){Eh.b.Aa.call(this,a,b,c);if((a=a.a())&&b==1)a.disabled=c};m.s=function(a){return a.value};m.ia=function(a,b){if(a)a.value=b};m.Sc=q;function Fh(a,b){Ue(b,false);b.Zf&=-256;Ye(b,32,false)};function Gh(a,b,c){T.call(this,a,b||Eh.g(),c)}t(Gh,T);m=Gh.prototype;m.s=e("xa");m.ia=function(a){this.xa=a;this.h.ia(this.a(),a)};m.jd=e("Jf");m.Ed=function(a){this.Jf=a;this.h.Ed(this.a(),a)};m.e=function(){Gh.b.e.call(this);delete this.xa;delete this.Jf};m.n=function(){Gh.b.n.call(this);if(this.da&32){var a=this.U();a&&this.H().f(a,"keyup",this.Tb)}};m.Tb=function(a){if(a.keyCode==13&&a.type=="key"||a.keyCode==32&&a.type=="keyup")return this.Yb(a);return a.keyCode==32};Ie("goog-button",function(){return new Gh(null)});function Hh(){}t(Hh,df);r(Hh);m=Hh.prototype;m.Qa=k("menu");m.K=function(a){return a.tagName=="UL"||Hh.b.K.call(this,a)};m.fd=function(a){return a.tagName=="HR"?new cf:Hh.b.fd.call(this,a)};m.Lb=function(a,b){return Kc(a.a(),b)};m.k=k("goog-menu");m.yc=function(a){Hh.b.yc.call(this,a);a=a.a();be(a,"haspopup","true")};Ie("goog-menuseparator",function(){return new cf});function Ih(a,b){U.call(this,gf,b||Hh.g(),a);this.Hb(false)}t(Ih,U);m=Ih.prototype;m.Ke=true;m.Xh=false;m.k=function(){return this.h.k()};m.Lb=function(a){if(this.h.Lb(this,a))return true;for(var b=0,c=Q(this);b=1)a.za=1;a.ng=1E3/(b-a.kf);a.kf=b;ia(a.Vf)?ii(a,a.Vf(a.za)):ii(a,a.za);if(a.za==1){a.o=0;gi(a);hi(a,"finish");a.je()}else a.o==1&&a.sf()}function ii(a,b){a.coords=Array(a.Nc.length);for(var c=0;c')};function mi(a,b,c){sh.call(this,a,b,c);this.Df(true)}t(mi,sh);mi.prototype.Yb=function(){return this.dispatchEvent("action")};Ie("goog-option",function(){return new mi(null)});function ni(a){this.element=K(a);this.Zc=this.P=undefined;this.Pe=[];this.Va=undefined}function oi(a,b){pi(a,a.element);Tg(X.g(),a.P,qi(b),function(c){ri(a,c)});a.Zc=qi(b)}ni.prototype.clear=function(){this.Zc=undefined;this.element.innerHTML=""};function pi(a,b){b.innerHTML='

Loading...
'} +function ri(a,b){a.element.innerHTML="";a.Pe=[];for(var c=sg(b.target),d=c.length,f=0;f "+(o-1));return}o=c[h].max;if(o!=undefined&&l>o){ui(a,"Invalid Value",c[h].description+" must be < "+(o+1));return}g+=i+"="+j+"&"}else if(c[h].type=="string"){j= +f.elements[i].value;g+=i+"="+j+"&"}else if(c[h].type=="bool")g+=i+"="+(c[h].object.Ac()?"1":"0")+"&";else if(c[h].type=="select"){j=c[h].object.xb();j=c[h].value[j].value;g+=i+"="+j+"&"}}Vg(X.g(),a.P,a.Zc,a.Va[b].id,a.Va[b].hint,g,function(p){p=sg(p.target);p.error?ui(a,"Set Failed",p.error):si(a,b)})}function ui(a,b,c){a=$.g();a.ca("Set Failed");a.t(c);S(a,me);a.l(true)};function yi(){}t(yi,bf);r(yi);yi.prototype.d=function(a){return a.i().d("div",this.k()+" goog-inline-block","\u00a0")};yi.prototype.m=function(a,b){b=yi.b.m.call(this,a,b);H(b,"goog-inline-block");return b};yi.prototype.k=k("goog-toolbar-separator");function zi(a,b){cf.call(this,a||yi.g(),b)}t(zi,cf);Ie("goog-toolbar-separator",function(){return new zi});function Ai(){}t(Ai,df);r(Ai);Ai.prototype.Qa=k("toolbar");Ai.prototype.fd=function(a){return a.tagName=="HR"?new cf(yi.g()):Ai.b.fd.call(this,a)};Ai.prototype.k=k("goog-toolbar");Ai.prototype.og=function(){return ff};function Bi(a,b,c){U.call(this,b,a||Ai.g(),c)}t(Bi,U);function Ci(){}t(Ci,Jh);r(Ci);Ci.prototype.k=k("goog-toolbar-button");function Di(a,b,c){Gh.call(this,a,b||Ci.g(),c)}t(Di,Gh);Ie("goog-toolbar-button",function(){return new Di(null)});function Ei(a){this.c=a;this.Hg=D(this.c,x?"DOMMouseScroll":"mousewheel",this)}t(Ei,N); +Ei.prototype.handleEvent=function(a){var b=0,c=0,d=0;a=a.Oa;if(a.type=="mousewheel"){c=1;if(u||y&&(Ja||z("532.0")))c=40;d=-a.wheelDelta/c;if(a.wheelDeltaX!==undefined){b=-a.wheelDeltaX/c;c=-a.wheelDeltaY/c}else c=d}else{d=a.detail;if(d>100)d=3;else if(d<-100)d=-3;if(a.axis!==undefined&&a.axis===a.HORIZONTAL_AXIS)b=d;else c=d}if(ha(this.Ig))b=Math.min(Math.max(b,-this.Ig),this.Ig);if(ha(this.Jg))c=Math.min(Math.max(c,-this.Jg),this.Jg);b=new Fi(d,a,b,c);try{this.dispatchEvent(b)}finally{b.w()}}; +Ei.prototype.e=function(){Ei.b.e.call(this);dc(this.Hg);delete this.Hg};function Fi(a,b,c,d){b&&this.xc(b,void 0);this.type="mousewheel";this.detail=a;this.mc=c;this.nc=d}t(Fi,Cb);function Gi(a,b,c,d,f){bi.call(this,b,c,d,f);this.element=a}t(Gi,bi);Gi.prototype.Ae=q;Gi.prototype.sf=function(){this.Ae();Gi.b.sf.call(this)};Gi.prototype.je=function(){this.Ae();Gi.b.je.call(this)};Gi.prototype.rd=function(){this.Ae();Gi.b.rd.call(this)};function Hi(a,b,c){if(b.length!=2||c.length!=2)throw Error("Start and end points must be 2D");Gi.apply(this,arguments)}t(Hi,Gi); +Hi.prototype.Ae=function(){this.element.style.left=Math.round(this.coords[0])+"px";this.element.style.top=Math.round(this.coords[1])+"px"};function Ii(a,b,c,d){Hi.call(this,a,[a.offsetLeft,a.offsetTop],b,c,d)}t(Ii,Hi);Ii.prototype.rd=function(){this.Nc=[this.element.offsetLeft,this.element.offsetTop];Ii.b.rd.call(this)};function Ji(){}t(Ji,N);m=Ji.prototype;m.xa=0;m.Sa=0;m.Fa=100;m.ya=0;m.Oc=1;m.bb=false;m.Fc=false;m.ia=function(a){a=Ki(this,a);if(this.xa!=a){this.xa=a+this.ya>this.Fa?this.Fa-this.ya:athis.Fa?this.Fa-this.xa:a;!this.bb&&!this.Fc&&this.dispatchEvent("change")}}; +m.Rb=function(){var a;a=this.ya;a=this.Oc==null?a:Math.round(a/this.Oc)*this.Oc;return a};m.te=function(a){if(this.Sa!=a){var b=this.bb;this.bb=true;this.Sa=a;if(a+this.ya>this.Fa)this.ya=this.Fa-this.Sa;a>this.xa&&this.ia(a);if(a>this.Fa){this.ya=0;this.se(a);this.ia(a)}this.bb=b;!this.bb&&!this.Fc&&this.dispatchEvent("change")}};m.na=function(){return Ki(this,this.Sa)}; +m.se=function(a){a=Ki(this,a);if(this.Fa!=a){var b=this.bb;this.bb=true;this.Fa=a;athis.Ia.offsetLeft+this.Ia.offsetWidth;a=J(this.a());this.H().f(a,"mouseup",this.ug,true).f(this.a(),"mousemove",this.Gf);if(!this.zb){this.zb=new Qd(200);this.H().f(this.zb,Sd,this.vg)}this.vg();this.zb.start()}};m.vi=function(a){Ri(this,(a.detail>0?-1:1)*this.Kf);a.preventDefault()}; +m.vg=function(){var a;if(this.C=="vertical"){var b=this.ce,c=this.Ia.offsetTop;if(this.Ag){if(bc+this.Ia.offsetHeight)a=Ui(this,this.Ia)-this.qb}else{b=this.ce;c=this.Ia.offsetLeft;if(this.Ag){if(b>c+this.Ia.offsetWidth)a=Ui(this,this.Ia)+this.qb}else if(b=a.q.s()+a.pd)d=c-a.q.s();var f=d||a.q.Rb();if(b==a.R&&c>=a.na()&&c<=a.q.s()+f-a.pd){b=f-(c-a.q.s());if(Ki(a.q,c)+Ki(a.q,b)==Ki(a.q,c+b)){Wi(a,c,b);d=null}}d!=null&&a.q.Ad(d)} +function Wi(a,b,c){if(a.na()<=b&&b<=a.ra()-c&&a.pd<=c&&c<=a.ra()-b)if(!(b==a.s()&&c==a.Rb())){a.q.Fc=true;a.q.Ad(0);a.q.ia(b);a.q.Ad(c);a.q.Fc=false;Oi(a);a.dispatchEvent("change")}}m.na=function(){return this.q.na()};m.te=function(a){this.q.te(a)};m.ra=function(){return this.q.ra()};m.se=function(a){this.q.se(a)};function Ti(a,b){return b<=a.q.s()+a.q.Rb()/2?a.R:a.va}m.xi=function(){Oi(this);Ni(this);this.dispatchEvent("change")}; +function Oi(a){if(a.R&&!a.gf){var b=Xi(a,Ui(a,a.R)),c=Xi(a,Ui(a,a.va));if(a.C=="vertical"){a.R.style.top=b.y+"px";a.va.style.top=c.y+"px"}else{a.R.style.left=b.x+"px";a.va.style.left=c.x+"px"}}}function Xi(a,b){var c=new G;if(a.R){var d=a.na(),f=a.ra();d=b==d&&d==f?0:(b-d)/(f-d);if(a.C=="vertical"){f=a.R.offsetHeight;f=a.a().clientHeight-f;c.y=f-Math.round(d*f)}else{f=a.a().clientWidth-a.R.offsetWidth;c.x=Math.round(d*f)}}return c} +function Qi(a,b){b=Math.min(a.ra(),Math.max(b,a.na()));a.Yc&&a.Yc.stop(true);var c=Ti(a,b),d=Xi(a,b);d=new Ii(c,a.C=="vertical"?[c.offsetLeft,d.y]:[d.x,c.offsetTop],100);a.Yc=d;a.H().f(d,"end",a.ei);a.gf=true;Pi(a,c,b);d.play(false)}m.ei=function(){this.gf=false};m.Cd=function(a){if(this.C!=a){var b=this.k(this.C),c=this.k(a);this.C=a;if(this.a()){tc(this.a(),b,c);this.R.style.left=this.R.style.top="";this.va.style.left=this.va.style.top="";Oi(this)}}}; +m.e=function(){Li.b.e.call(this);this.zb&&this.zb.w();delete this.zb;this.Yc&&this.Yc.w();delete this.Yc;delete this.R;delete this.va;this.q.w();delete this.q;if(this.ha){this.ha.w();delete this.ha}if(this.ie){this.ie.w();delete this.ie}};m.Kf=1;m.s=function(){return this.q.s()};m.ia=function(a){Pi(this,this.R,a)};m.Rb=function(){return this.q.Rb()};m.Ad=function(a){Pi(this,this.va,this.q.s()+a)};m.l=function(a){O(this.a(),a);a&&Oi(this)}; +function Ni(a){var b=a.a();if(b){be(b,"valuemin",a.na());be(b,"valuemax",a.ra());be(b,"valuenow",a.s())}};function Yi(a){Li.call(this,a);this.q.Ad(0)}t(Yi,Li);Yi.prototype.k=function(a){return a=="vertical"?"goog-slider-vertical":"goog-slider-horizontal"};function Zi(){this.ah=false;this.Mc=[];this.eh=[];this.data=Array($i);this.ph=[];this.Wa=0;this.Hf=new Qd(1E3)}t(Zi,N);var $i=512;function aj(){C.call(this,"console-change-event")}t(aj,C);m=Zi.prototype;m.getData=e("data"); +function bj(a){if(!a.ah){var b=new Bi;a.Zb=new Di("Previous Page");a.Gc=new Di("Next Page");a.Zb.M(false);var c=new Di("Blackout");c.Ed("Set all channels to 0");var d=new Di("Full");d.Ed("Set all channels to full");b.oa(a.Zb,true);b.oa(a.Gc,true);b.oa(new zi,true);b.oa(c,true);b.oa(d,true);b.W(K("console_toolbar"));D(a.Zb,"action",a.Kh,false,a);D(a.Gc,"action",a.Jh,false,a);D(c,"action",a.Gh,false,a);D(d,"action",a.Ih,false,a);c=K("channel_values");for(b=0;b<$i;++b){d=M("div");d.innerHTML=0;d.title= +"Channel "+(b+1);c.appendChild(d);a.ph.push(d)}c=K("console_channel_row");d=K("console_value_row");var f=K("console_slider_row");for(b=0;b<16;++b){var g=M("td");g.innerHTML=b+1;c.appendChild(g);g=M("td");g.innerHTML="0";d.appendChild(g);a.eh.push(g);g=M("td");f.appendChild(g);var h=new Yi;h.Cd(Mi.Ch);h.te(0);h.se(255);h.W(g);D(h,"change",function(i){return function(){var j=this.Mc[i].s();this.eh[i].innerHTML=j;var l=this.Wa+i;cj(this,l,j);if(this.data[l]!=j){this.data[l]=j;this.dispatchEvent(new aj)}}}(b), +false,a);a.Mc.push(h)}a.ah=true;dj(a,0);D(a.Hf,Sd,function(){this.dispatchEvent(new aj)},false,a)}}m.update=function(){this.Wa==0?this.Zb.M(false):this.Zb.M(true);this.Wa==$i-16?this.Gc.M(false):this.Gc.M(true);ej(this);for(var a=0;a=a){this.Wa=a;this.Gc.M(false)}ej(this)}; +m.Kh=function(){this.Wa-=16;this.Gc.M(true);if(this.Wa<=0){this.Wa=0;this.Zb.M(false)}ej(this)};function ej(a){var b=K("console_channel_row");b=Hc(b);for(var c=a.Wa;c90?"#ffffff":"#000000"}};function fj(a,b,c,d){this.p=c||I();this.qa=a;this.Ga=[];this.kj=b?b:gj;this.oh=!!d;this.qa.className="goog-tabpane";a=[];for(b=Hc(this.qa);b;){a.push(b);b=Jc(b)}this.ua=this.p.d("ul",{className:"goog-tabpane-tabs",tabIndex:"0"});this.G=this.p.d("div","goog-tabpane-cont");this.qa.appendChild(this.G);switch(this.kj){case gj:this.qa.insertBefore(this.ua,this.G);this.qa.insertBefore(hj(this),this.G);H(this.qa,"goog-tabpane-top");break;case 1:this.qa.appendChild(this.ua);this.qa.appendChild(hj(this)); +H(this.qa,"goog-tabpane-bottom");break;case 2:this.qa.insertBefore(this.ua,this.G);H(this.qa,"goog-tabpane-left");break;case 3:this.qa.insertBefore(this.ua,this.G);H(this.qa,"goog-tabpane-right");break;default:throw Error("Invalid tab location");}this.ua.tabIndex=0;D(this.ua,this.oh?"mousedown":E,this.ke,false,this);D(this.ua,gc,this.le,false,this);for(c=0;b=a[c];c++)ij(this,new jj(b))}t(fj,N);var gj=0; +function hj(a){sd(".goog-tabpane-clear { clear: both; height: 0px; overflow: hidden }");return a.p.d("div","goog-tabpane-clear")}m=fj.prototype;m.e=function(){fj.b.e.call(this);bc(this.ua,this.oh?"mousedown":E,this.ke,false,this);bc(this.ua,gc,this.le,false,this);delete this.qa;this.G=this.ua=null}; +function ij(a,b,c){if(b.z&&b.z!=a&&b.z instanceof fj){var d=b.z,f=b;if(ha(f))f=d.Ga[f];d.Ga.splice(f.wc,1);f.Dd(null);Gc(f.qc);Gc(f.G);for(var g=0;f=d.Ga[g];g++)f.Dd(d,g)}d=a.Ga.length;if(c!==undefined&&c!=d){d=c;a.Ga.splice(d,0,b);a.ua.insertBefore(b.qc,a.ua.childNodes[d])}else{a.Ga.push(b);a.ua.appendChild(b.qc)}b.Dd(a,d);if(!a.Ha){a.Ha=b;a.dispatchEvent(new kj("change",a,a.Ha))}a.G.appendChild(b.G);lj(b,b==a.Ha);for(c=d+1;b=a.Ga[c];c++)b.wc=c} +m.ta=function(a){if(a>=0&&a=this.Ga.length?0:a);break;case 36:this.ta(0);break;case 35:this.ta(this.Ga.length-1);break}};function jj(a,b,c){var d,f;if(s(a)&&b===undefined)d=a;else if(b){d=b;f=a}else if(a){if(b=Hc(a)){d=Pc(b);b.parentNode.removeChild(b)}f=a}this.p=c||I();this.G=f||this.p.d("div");this.qc=this.p.d("li",null,d);this.wc=this.z=null;this.Q=true}m=jj.prototype; +m.ca=function(a){Lc(this.qc,a)};m.L=e("G");m.M=function(a){this.Q=a;this.qc.className=a?"goog-tabpane-tab":"goog-tabpane-tab-disabled"};m.B=e("Q");function lj(a,b){if(a.B()){a.G.style.display=b?"":"none";a.qc.className=b?"goog-tabpane-tab-selected":"goog-tabpane-tab"}}m.Dd=function(a,b){this.z=a;this.wc=b!==undefined?b:null};function kj(a,b,c){C.call(this,a,b);this.page=c}t(kj,C);function mj(a,b){P.call(this,b);this.data=a}t(mj,P);mj.prototype.K=k(false);mj.prototype.d=function(){var a=this.p.d("tr",{});a.style.cursor="pointer";var b=L("td",{},"");this.p.appendChild(a,b);this.rb=new th;this.rb.W(b);this.p.appendChild(a,L("td",{},this.data.device));this.p.appendChild(a,L("td",{},this.data.is_output?"Output":"Input"));this.p.appendChild(a,L("td",{},this.data.description));this.c=a;D(a,E,function(){this.rb.Pc()},false,this)};mj.prototype.td=function(){return this.data.id}; +mj.prototype.nd=function(){return this.rb.Ac()};function nj(a){P.call(this,a)}t(nj,P);m=nj.prototype;m.d=function(){this.A(this.p.createElement("tbody"))};m.A=function(a){nj.b.A.call(this,a)};m.K=function(a){return a.tagName=="TBODY"};function oj(a){for(var b=[],c=Q(a),d=0;da.Xc)return 1;else if(this.Xc65535){a.ca("Invalid Universe Number");S(a,me);a.t("The universe number must be between 0 and 65535")}else{var c=X.g();if(c.pb[b]!=undefined){a.ca("Universe already exists");S(a,me);a.t("Universe "+b+" already exists")}else{var d=K("new_universe_name").value,f=oj(this.Jb);if(f.length==0){a.ca("No ports selected");S(a,me);a.t("At least one port must be bound to the universe")}else{var g=this;Rg(c, +b,d,f,function(h){var i=$.g();if(rg(h.target)!=200){i.ca("New Universe Failed");i.t(String(h.target.cb)+" : "+tg(h.target));S(i,me);i.l(true)}else{h=sg(h.target);if(h.ok){i.l(false);i=g.rf;h=h.universe;Hj(i);i.Rc.Ka(h,true);Ng(X.g())}else{i.ca("New Universe Failed");S(i,me);i.t(h.message);i.l(true)}}});li(a)}}}a.l(true)};W=W||{};function Ij(a){this.element=K(a);D(X.g(),"plugin_change",this.Eh,false,this)}t(Ij,pj);Ij.prototype.Eh=function(a){K("plugin_description").innerHTML=a.Zi.description};function Jj(a){this.gc=a||window;this.ee=D(this.gc,"resize",this.yi,false,this);this.Lc=Ac(this.gc||window);if(y&&Ja||Oa&&this.gc.self!=this.gc.top)this.Ce=window.setInterval(na(this.cg,this),Kj)}t(Jj,N);var Kj=500;m=Jj.prototype;m.ee=null;m.gc=null;m.Lc=null;m.Ce=null;m.qg=function(){return this.Lc?this.Lc.Na():null};m.e=function(){Jj.b.e.call(this);if(this.ee){dc(this.ee);this.ee=null}if(this.Ce){window.clearInterval(this.Ce);this.Ce=null}this.Lc=this.gc=null};m.yi=function(){this.cg()}; +m.cg=function(){var a=Ac(this.gc||window);if(!mc(a,this.Lc)){this.Lc=a;this.dispatchEvent("resize")}};W.qj={};W=W||{};W.wh=5E3;W.vh="home_frame";W.Bh="universe_frame";W.yh="plugin_frame";W.Of="split_pane";W.xh="new_universe_frame";function tj(a,b,c,d){sf.call(this,a,b,c,d);this.t(a.name())}t(tj,sf);tj.prototype.n=function(){tj.b.n.call(this);this.a().title="Universe "+this.La.id()};function Lj(a,b,c,d){sf.call(this,a,b,c,d);this.t(a.name())}t(Lj,sf);Lj.prototype.n=function(){Lj.b.n.call(this);this.a().title=this.La.name()+" Plugin"};function Mj(a){this.Kb=a} +Mj.prototype.qd=function(a){return new tj(a,this.Kb)};function Nj(a){this.Kb=a}Nj.prototype.qd=function(a){return new Lj(a,this.Kb)}; +function Oj(){this.Ii=new mh;this.Hc=X.g();this.yg=new Fj(W.vh);this.Rc=new vj(W.Bh,this);this.Tg=new Ij(W.yh,this.Hc);this.Ng=new Gj(W.xh,this);D(K("new_universe_button"),E,this.Dh,false,this);var a=new P,b=new P;this.ve=new ve(a,b,"horizontal");this.ve.ff=130;this.ve.uc=2;this.ve.m(K(W.Of));this.rh=new Jj;this.Pf();D(this.rh,"resize",this.Pf,false,this);Pj(this);this.Uc();K(W.Of).style.visibility="visible"} +function Pj(a){var b=K("home_control");Me(b);D(b,E,a.Uc,false,a);new ki("plugin_list_control","plugin_container");new ki("universe_list_control","universe_container");b=new U;b.m(K("plugin_container"));a.$i=new tf(b,new Nj(function(c){c=c.id();Og(a.Hc,c);Hj(a);a.Tg.Ka()}));D(a.Hc,"plugin_list_change",a.Qh,false,a);b=new U;b.m(K("universe_container"));a.Lf=new tf(b,new Mj(function(c){c=c.id();Hj(a);a.Rc.Ka(c,void 0)}));D(a.Hc,"universe_list_change",a.Th,false,a);a.lh=new Qd(W.wh);D(a.lh,Sd,function(){Ng(this)}, +false,a.Hc);Ng(a.Hc);a.lh.start()}m=Oj.prototype;m.Th=function(a){var b=this.Rc.P,c=[],d=false;W.Ec.info("Got "+a.pb.length+" universes");for(var f=0;f/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.cpp new file mode 100644 index 0000000..6e5dcf0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.cpp @@ -0,0 +1,201 @@ +/* + * 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 Library 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. + * + * artnetdevice.cpp + * Art-Net device + * Copyright (C) 2005 Simon Newton + * + * An Art-Net device is an instance of libartnet bound to a single IP address + * Art-Net is limited to four ports per direction per IP, so in this case + * our device has 8 ports : + * + * Ids 0-3 : Input ports (recv dmx) + * Ids 4-7 : Output ports (send dmx) + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/NetworkUtils.h" +#include "olad/PluginAdaptor.h" +#include "olad/Port.h" +#include "olad/Preferences.h" +#include "plugins/artnet/ArtNetDevice.h" +#include "plugins/artnet/ArtNetPort.h" + +namespace ola { +namespace plugin { +namespace artnet { + +using google::protobuf::RpcController; +using google::protobuf::Closure; +using ola::network::AddressToString; +using ola::plugin::artnet::Request; +using ola::plugin::artnet::Reply; + +const char ArtNetDevice::K_SHORT_NAME_KEY[] = "short_name"; +const char ArtNetDevice::K_LONG_NAME_KEY[] = "long_name"; +const char ArtNetDevice::K_SUBNET_KEY[] = "subnet"; +const char ArtNetDevice::K_IP_KEY[] = "ip"; +const char ArtNetDevice::K_DEVICE_NAME[] = "ArtNet"; + +/* + * Create a new Artnet Device + */ +ArtNetDevice::ArtNetDevice(AbstractPlugin *owner, + ola::Preferences *preferences, + const PluginAdaptor *plugin_adaptor): + Device(owner, K_DEVICE_NAME), + m_preferences(preferences), + m_node(NULL), + m_plugin_adaptor(plugin_adaptor), + m_timeout_id(ola::network::INVALID_TIMEOUT) { +} + + +/* + * Start this device + * @return true on success, false on failure + */ +bool ArtNetDevice::StartHook() { + string value = m_preferences->GetValue(K_SUBNET_KEY); + unsigned int subnet; + if (!ola::StringToUInt(m_preferences->GetValue(K_SUBNET_KEY), &subnet)) + subnet = 0; + + ola::network::Interface interface; + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&interface, m_preferences->GetValue(K_IP_KEY))) { + delete picker; + OLA_INFO << "Failed to find an interface"; + return false; + } + delete picker; + + m_node = new ArtNetNode(interface, + m_preferences->GetValue(K_SHORT_NAME_KEY), + m_preferences->GetValue(K_LONG_NAME_KEY), + m_plugin_adaptor, + subnet); + + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + AddPort(new ArtNetOutputPort(this, i, m_node)); + AddPort(new ArtNetInputPort(this, + i, + m_plugin_adaptor->WakeUpTime(), + m_node)); + } + + if (!m_node->Start()) { + DeleteAllPorts(); + delete m_node; + m_node = NULL; + return false; + } + + stringstream str; + str << K_DEVICE_NAME << " [" << AddressToString(interface.ip_address) << "]"; + SetName(str.str()); + + m_timeout_id = m_plugin_adaptor->RegisterRepeatingTimeout( + POLL_INTERVAL, + NewClosure(m_node, &ArtNetNode::MaybeSendPoll)); + return true; +} + + +/* + * Stop this device + */ +void ArtNetDevice::PostPortStop() { + if (m_timeout_id != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_timeout_id); + m_timeout_id = ola::network::INVALID_TIMEOUT; + } + m_node->Stop(); + delete m_node; + m_node = NULL; +} + + +/* + * Handle device config messages + * @param controller An RpcController + * @param request the request data + * @param response the response to return + * @param done the closure to call once the request is complete + */ +void ArtNetDevice::Configure(RpcController *controller, + const string &request, + string *response, + Closure *done) { + Request request_pb; + if (!request_pb.ParseFromString(request)) { + controller->SetFailed("Invalid Request"); + done->Run(); + return; + } + + switch (request_pb.type()) { + case ola::plugin::artnet::Request::ARTNET_OPTIONS_REQUEST: + HandleOptions(&request_pb, response); + break; + default: + controller->SetFailed("Invalid Request"); + } + done->Run(); +} + + +/* + * Handle an options request + */ +void ArtNetDevice::HandleOptions(Request *request, string *response) { + bool status = true; + if (request->has_options()) { + const ola::plugin::artnet::OptionsRequest options = request->options(); + if (options.has_short_name()) { + status &= m_node->SetShortName(options.short_name()); + } + if (options.has_long_name()) { + status &= m_node->SetLongName(options.long_name()); + } + if (options.has_subnet()) { + status &= m_node->SetSubnetAddress(options.subnet()); + } + } + + ola::plugin::artnet::Reply reply; + reply.set_type(ola::plugin::artnet::Reply::ARTNET_OPTIONS_REPLY); + ola::plugin::artnet::OptionsReply *options_reply = reply.mutable_options(); + options_reply->set_status(status); + options_reply->set_short_name(m_node->ShortName()); + options_reply->set_long_name(m_node->LongName()); + options_reply->set_subnet(m_node->SubnetAddress()); + reply.SerializeToString(response); +} +} // artnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.h new file mode 100644 index 0000000..ab34ef0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetDevice.h @@ -0,0 +1,80 @@ +/* + * 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 Library 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. + * + * ArtNetDevice.h + * Interface for the ArtNet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ARTNET_ARTNETDEVICE_H_ +#define PLUGINS_ARTNET_ARTNETDEVICE_H_ + +#include + +#include "olad/Device.h" +#include "plugins/artnet/messages/ArtnetConfigMessages.pb.h" +#include "plugins/artnet/ArtNetNode.h" + +namespace ola { + + +class Preferences; + +namespace plugin { +namespace artnet { + +using google::protobuf::RpcController; +using ola::Device; +using ola::plugin::artnet::Request; +using std::string; + +class ArtNetDevice: public Device { + public: + ArtNetDevice(AbstractPlugin *owner, + class Preferences *preferences, + const class PluginAdaptor *plugin_adaptor); + + // only one ArtNet device + string DeviceId() const { return "1"; } + + void Configure(RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done); + + static const char K_SHORT_NAME_KEY[]; + static const char K_LONG_NAME_KEY[]; + static const char K_SUBNET_KEY[]; + static const char K_IP_KEY[]; + static const char K_DEVICE_NAME[]; + // 10s between polls when we're sending data, DMX-workshop uses 8s; + static const unsigned int POLL_INTERVAL = 10000; + + protected: + bool StartHook(); + void PostPortStop(); + + private: + class Preferences *m_preferences; + ArtNetNode *m_node; + const class PluginAdaptor *m_plugin_adaptor; + timeout_id m_timeout_id; + + void HandleOptions(Request *request, string *response); +}; +} // arntnet +} // plugin +} // ola +#endif // PLUGINS_ARTNET_ARTNETDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.cpp b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.cpp new file mode 100644 index 0000000..e647fb5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.cpp @@ -0,0 +1,1628 @@ +/* + * 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 Library 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. + * + * ArtNetNode.cpp + * An ArtNet node + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/artnet/ArtNetNode.h" + + +namespace ola { +namespace plugin { +namespace artnet { + +using ola::Callback1; +using ola::Closure; +using ola::network::AddressToString; +using ola::network::HostToLittleEndian; +using ola::network::HostToNetwork; +using ola::network::LittleEndianToHost; +using ola::network::NetworkToHost; +using ola::network::UdpSocket; +using std::pair; +using std::string; + + +const char ArtNetNode::ARTNET_ID[] = "Art-Net"; + +/* + * Create a new node + * @param interface the interface to use. + * @param short_name the short node name + * @param long_name the long node name + * @param subnet_address the ArtNet 'subnet' address, 4 bits. + */ +ArtNetNode::ArtNetNode(const ola::network::Interface &interface, + const string &short_name, + const string &long_name, + const PluginAdaptor *plugin_adaptor, + uint8_t subnet_address) + : m_running(false), + m_send_reply_on_change(true), + m_short_name(short_name), + m_long_name(long_name), + m_broadcast_threshold(BROADCAST_THRESHOLD), + m_unsolicited_replies(0), + m_plugin_adaptor(plugin_adaptor), + m_interface(interface), + m_socket(NULL), + m_discovery_timeout(ola::network::INVALID_TIMEOUT) { + + // reset all the port structures + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + m_input_ports[i].universe_address = 0; + m_input_ports[i].sequence_number = 0; + m_input_ports[i].enabled = false; + m_input_ports[i].on_tod = NULL; + m_input_ports[i].on_rdm_response = NULL; + m_input_ports[i].discovery_running = false; + m_input_ports[i].rdm_send_timeout = ola::network::INVALID_TIMEOUT; + m_input_ports[i].overflowed_response = NULL; + + m_output_ports[i].universe_address = 0; + m_output_ports[i].sequence_number = 0; + m_output_ports[i].enabled = false; + m_output_ports[i].is_merging = false; + m_output_ports[i].merge_mode = ARTNET_MERGE_HTP; + m_output_ports[i].buffer = NULL; + m_output_ports[i].on_data = NULL; + m_output_ports[i].on_discover = NULL; + m_output_ports[i].on_flush = NULL; + m_output_ports[i].on_rdm_request = NULL; + for (unsigned int j = 0; j < MAX_MERGE_SOURCES; j++) + m_output_ports[i].sources[j].address.s_addr = 0; + } + + SetSubnetAddress(subnet_address); +} + + +/* + * Cleanup + */ +ArtNetNode::~ArtNetNode() { + Stop(); + + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + if (m_input_ports[i].on_tod) + delete m_input_ports[i].on_tod; + if (m_input_ports[i].on_rdm_response) + delete m_input_ports[i].on_rdm_response; + + if (m_output_ports[i].on_data) + delete m_output_ports[i].on_data; + if (m_output_ports[i].on_discover) + delete m_output_ports[i].on_discover; + if (m_output_ports[i].on_flush) + delete m_output_ports[i].on_flush; + if (m_output_ports[i].on_rdm_request) + delete m_output_ports[i].on_rdm_request; + } +} + + +/* + * Start this node. The port modifying functions can be called before this. + */ +bool ArtNetNode::Start() { + if (m_running) + return false; + + if (!InitNetwork()) + return false; + + m_running = true; + + MaybeSendPoll(); // send a poll, this will result in us repling as well + SendPollReply(m_interface.bcast_address); + return true; +} + + +/* + * Stop this node + */ +bool ArtNetNode::Stop() { + if (!m_running) + return false; + + if (m_discovery_timeout != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_discovery_timeout); + m_discovery_timeout = ola::network::INVALID_TIMEOUT; + } + + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + if (m_input_ports[i].rdm_send_timeout != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_input_ports[i].rdm_send_timeout); + m_input_ports[i].rdm_send_timeout = ola::network::INVALID_TIMEOUT; + } + + // clean up any pending RDM messsages. + while (!m_input_ports[i].pending_rdm_requests.empty()) { + delete m_input_ports[i].pending_rdm_requests.front(); + m_input_ports[i].pending_rdm_requests.pop(); + } + } + + m_plugin_adaptor->RemoveSocket(m_socket); + + if (m_socket) { + delete m_socket; + m_socket = NULL; + } + + m_running = false; + return true; +} + + +/* + * Set the short name + */ +bool ArtNetNode::SetShortName(const string &name) { + m_short_name = name; + if (m_running && m_send_reply_on_change) { + m_unsolicited_replies++; + return SendPollReply(m_interface.bcast_address); + } + return true; +} + + +/* + * Set the long name + */ +bool ArtNetNode::SetLongName(const string &name) { + m_long_name = name; + if (m_running && m_send_reply_on_change) { + m_unsolicited_replies++; + return SendPollReply(m_interface.bcast_address); + } + return true; +} + + +/* + * The the subnet address for this node + */ +bool ArtNetNode::SetSubnetAddress(uint8_t subnet_address) { + uint8_t old_address = m_input_ports[0].universe_address >> 4; + if (old_address == subnet_address) + return true; + + subnet_address = subnet_address << 4; + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + m_input_ports[i].universe_address = subnet_address | + (m_input_ports[i].universe_address & 0x0f); + m_output_ports[i].universe_address = subnet_address | + (m_output_ports[i].universe_address & 0x0f); + m_input_ports[i].uids.clear(); + } + + if (m_running && m_send_reply_on_change) { + m_unsolicited_replies++; + return SendPollReply(m_interface.bcast_address); + } + return true; +} + + +/* + * Set the universe for a port + */ +bool ArtNetNode::SetPortUniverse(artnet_port_type type, + uint8_t port_id, + uint8_t universe_id) { + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + if (type == ARTNET_INPUT_PORT) { + uint8_t old_universe = m_input_ports[port_id].universe_address; + m_input_ports[port_id].universe_address = ( + (universe_id & 0x0f) | + (m_input_ports[port_id].universe_address & 0xf0)); + + if (old_universe != m_input_ports[port_id].universe_address) + // clear the uid map + m_input_ports[port_id].uids.clear(); + + bool ports_previously_enabled = false; + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) + ports_previously_enabled |= m_input_ports[i].enabled; + + m_input_ports[port_id].enabled = universe_id != ARTNET_DISABLE_PORT; + if (!ports_previously_enabled && m_input_ports[port_id].enabled) + MaybeSendPoll(); + } else { + m_output_ports[port_id].universe_address = ( + (universe_id & 0x0f) | + (m_output_ports[port_id].universe_address & 0xf0)); + m_output_ports[port_id].enabled = universe_id != ARTNET_DISABLE_PORT; + } + + if (m_running && m_send_reply_on_change) { + m_unsolicited_replies++; + return SendPollReply(m_interface.bcast_address); + } + return true; +} + + +/* + * Return the current universe address for a port + */ +uint8_t ArtNetNode::GetPortUniverse(artnet_port_type type, uint8_t port_id) { + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return 0; + } + + if (type == ARTNET_INPUT_PORT) + return m_input_ports[port_id].universe_address; + else + return m_output_ports[port_id].universe_address; +} + + +/* + * Set the merge mode for an output port + */ +bool ArtNetNode::SetMergeMode(uint8_t port_id, artnet_merge_mode merge_mode) { + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + m_output_ports[port_id].merge_mode = merge_mode; + if (m_running && m_send_reply_on_change) { + m_unsolicited_replies++; + return SendPollReply(m_interface.bcast_address); + } + return true; +} + + +/* + * Send an ArtPoll if any of the ports are sending data + */ +bool ArtNetNode::MaybeSendPoll() { + if (!m_running) + return false; + + bool send = false; + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) + send |= m_input_ports[i].enabled; + + if (!send) + return true; + + OLA_DEBUG << "Sending ArtPoll"; + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_POLL); + memset(&packet.data.poll, 0, sizeof(packet.data.poll)); + packet.data.poll.version = HostToNetwork(ARTNET_VERSION); + // send PollReplies when something changes + packet.data.poll.talk_to_me = 0x02; + unsigned int size = sizeof(packet.data.poll); + + return SendPacket(packet, size, m_interface.bcast_address); +} + + +/* + * Send some DMX data + * @param universe the id of the universe to send + * @param buffer the DMX data + * @return true if it was send successfully, false otherwise + */ +bool ArtNetNode::SendDMX(uint8_t port_id, const DmxBuffer &buffer) { + if (!CheckInputPortState(port_id, "ArtDMX")) + return false; + + if (!buffer.Size()) { + OLA_DEBUG << "Not sending 0 length packet"; + return true; + } + + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_DMX); + memset(&packet.data.dmx, 0, sizeof(packet.data.dmx)); + + packet.data.poll.version = HostToNetwork(ARTNET_VERSION); + packet.data.dmx.sequence = m_input_ports[port_id].sequence_number; + packet.data.dmx.physical = 1 + port_id; + packet.data.dmx.universe = m_input_ports[port_id].universe_address; + unsigned int buffer_size = sizeof(packet.data.dmx.data); + packet.data.dmx.length[0] = buffer_size >> 8; + packet.data.dmx.length[1] = buffer_size & 0xff; + buffer.Get(packet.data.dmx.data, &buffer_size); + + // the packet size needs to be a multiple of two, correct here if needed + if (buffer_size % 2) + buffer_size++; + unsigned int size = sizeof(packet.data.dmx) - DMX_UNIVERSE_SIZE + buffer_size; + + bool sent_ok = false; + if (m_input_ports[port_id].subscribed_nodes.size() >= BROADCAST_THRESHOLD) { + sent_ok = SendPacket(packet, size, m_interface.bcast_address); + m_input_ports[port_id].sequence_number++; + } else { + map::iterator iter = + m_input_ports[port_id].subscribed_nodes.begin(); + + TimeStamp last_heard_threshold = ( + *m_plugin_adaptor->WakeUpTime() - TimeInterval(NODE_TIMEOUT, 0)); + while (iter != m_input_ports[port_id].subscribed_nodes.end()) { + // if this node has timed out, remove it from the set + if (iter->second < last_heard_threshold) { + m_input_ports[port_id].subscribed_nodes.erase(iter++); + continue; + } + sent_ok |= SendPacket(packet, size, iter->first); + ++iter; + } + + if (!m_input_ports[port_id].subscribed_nodes.size()) { + OLA_DEBUG << + "Suppressing data transmit due to no active nodes for universe" << + static_cast(m_input_ports[port_id].universe_address); + sent_ok = true; + } else { + // We sent at least one packet, increment the sequence number + m_input_ports[port_id].sequence_number++; + } + } + + if (!sent_ok) + OLA_WARN << "Failed to send ArtNet DMX packet"; + return sent_ok; +} + + +/* + * Send a TODRequest + * @param port_id port to send on + */ +bool ArtNetNode::SendTodRequest(uint8_t port_id) { + if (!CheckInputPortState(port_id, "ArtTodRequest")) + return false; + + if (!GrabDiscoveryLock(port_id)) + return true; + + OLA_DEBUG << "Sending ArtTodRequest for address " << + static_cast(m_input_ports[port_id].universe_address); + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_TODREQUEST); + memset(&packet.data.tod_request, 0, sizeof(packet.data.tod_request)); + packet.data.tod_request.version = HostToNetwork(ARTNET_VERSION); + packet.data.tod_request.address_count = 1; // only one universe address + packet.data.tod_request.addresses[0] = + m_input_ports[port_id].universe_address; + unsigned int size = sizeof(packet.data.tod_request); + return SendPacket(packet, size, m_interface.bcast_address); +} + + +/* + * Flush the TOD and force discovery + * @param port_id port to send on + */ +bool ArtNetNode::ForceDiscovery(uint8_t port_id) { + if (!CheckInputPortState(port_id, "ArtTodControl")) + return false; + + if (!GrabDiscoveryLock(port_id)) + return true; + + OLA_DEBUG << "Sending ArtTodControl"; + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_TODCONTROL); + memset(&packet.data.tod_control, 0, sizeof(packet.data.tod_control)); + packet.data.tod_control.version = HostToNetwork(ARTNET_VERSION); + packet.data.tod_control.command = TOD_FLUSH_COMMAND; + packet.data.tod_control.address = m_input_ports[port_id].universe_address; + unsigned int size = sizeof(packet.data.tod_control); + return SendPacket(packet, size, m_interface.bcast_address); +} + + +/* + * Send an RDMRequest on this port, this may defer the sending if there are + * other outstanding messages in the queue. + * @param port_id the if of the port to send the request on + * @param request the RDMRequest object + */ +bool ArtNetNode::SendRDMRequest(uint8_t port_id, const RDMRequest *request) { + if (!CheckInputPortState(port_id, "ArtRDM")) + return false; + + if (m_input_ports[port_id].pending_rdm_requests.size() >= + RDM_REQUEST_QUEUE_LIMIT) { + OLA_WARN << "RDM Request queue limit reached. " << + m_input_ports[port_id].pending_rdm_requests.size() << + " requests in queue, limit is " << RDM_REQUEST_QUEUE_LIMIT; + return false; + } + m_input_ports[port_id].pending_rdm_requests.push(request); + MaybeSendRDMRequest(port_id); + return true; +} + + +/* + * Set the RDM handlers for an Input port + * @param port_id the id of the port to set the handlers for + * @param on_tod the callback to be invoked when a ArtTod message is recieved, + * this callback is passed two UIDSets, one for the UIDs added and one for + * the UIDs that were removed + * @param on_rdm_response the callback to be invoked when a RDMResponse message + * is received. The callback is responsible for deleting the RDMResponse + * object. + */ +bool ArtNetNode::SetInputPortRDMHandlers( + uint8_t port_id, + rdm_tod_callback *on_tod, + rdm_response_callback *on_rdm_response) { + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + if (m_input_ports[port_id].on_tod) + delete m_input_ports[port_id].on_tod; + if (m_input_ports[port_id].on_rdm_response) + delete m_input_ports[port_id].on_rdm_response; + + m_input_ports[port_id].on_tod = on_tod; + m_input_ports[port_id].on_rdm_response = on_rdm_response; + return true; +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool ArtNetNode::SetDMXHandler(uint8_t port_id, + DmxBuffer *buffer, + Closure *on_data) { + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + if (m_output_ports[port_id].on_data) + delete m_output_ports[port_id].on_data; + m_output_ports[port_id].buffer = buffer; + m_output_ports[port_id].on_data = on_data; + return true; +} + + +/* + * Send an set of UIDs in one of more ArtTod packets + */ +bool ArtNetNode::SendTod(uint8_t port_id, const UIDSet &uid_set) { + if (!CheckOutputPortState(port_id, "ArtTodData")) + return false; + + OLA_DEBUG << "Sending ArtTodRequest"; + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_TODDATA); + memset(&packet.data.tod_data, 0, sizeof(packet.data.tod_data)); + packet.data.tod_data.version = HostToNetwork(ARTNET_VERSION); + packet.data.tod_data.rdm_version = RDM_VERSION; + packet.data.tod_data.port = 1 + port_id; + packet.data.tod_data.address = m_output_ports[port_id].universe_address; + uint16_t uids = std::min(uid_set.Size(), + (unsigned int) MAX_UIDS_PER_UNIVERSE); + packet.data.tod_data.uid_total = HostToNetwork(uids); + packet.data.tod_data.uid_count = ARTNET_MAX_UID_COUNT; + + uint8_t (*ptr)[ola::rdm::UID::UID_SIZE] = packet.data.tod_data.tod; + unsigned int i = 0; + UIDSet::Iterator iter = uid_set.Begin(); + + while (iter != uid_set.End()) { + iter->Pack(*ptr, ola::rdm::UID::UID_SIZE); + + i++; + iter++; + if (i % ARTNET_MAX_UID_COUNT == 0) { + packet.data.tod_data.block_count = i / ARTNET_MAX_UID_COUNT - 1; + SendPacket(packet, + sizeof(packet.data.tod_data), + m_interface.bcast_address); + ptr = packet.data.tod_data.tod; + } else { + ptr++; + } + } + + if (i == 0 || i % ARTNET_MAX_UID_COUNT) { + packet.data.tod_data.uid_count = i % ARTNET_MAX_UID_COUNT; + packet.data.tod_data.block_count = i / ARTNET_MAX_UID_COUNT; + unsigned int size = sizeof(packet.data.tod_data) - + sizeof(packet.data.tod_data.tod) + i * ola::rdm::UID::UID_SIZE; + SendPacket(packet, size, m_interface.bcast_address); + } + return true; +} + + +/* + * Send a RDMResponse + * @param port_id the port id to send the response on + * @param response the RDMResponse to send + */ +bool ArtNetNode::SendRDMResponse(uint8_t port_id, const RDMResponse &response) { + if (!CheckOutputPortState(port_id, "ArtRDM")) + return false; + + const UID &uid_destination = response.DestinationUID(); + map::const_iterator iter = + m_output_ports[port_id].uid_map.find(uid_destination); + + IPAddress destination = m_interface.bcast_address; + + if (iter == m_output_ports[port_id].uid_map.end()) { + OLA_WARN << "Couldn't find " << uid_destination << + " in the uid map, broadcasting packet"; + } else { + destination = iter->second; + } + return SendRDMCommand(response, + destination, + m_output_ports[port_id].universe_address); +} + + +/* + * Set the RDM handlers for an Output port + */ +bool ArtNetNode::SetOutputPortRDMHandlers( + uint8_t port_id, + ola::Closure *on_discover, + ola::Closure *on_flush, + rdm_request_callback *on_rdm_request) { + + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + if (m_output_ports[port_id].on_discover) + delete m_output_ports[port_id].on_discover; + if (m_output_ports[port_id].on_flush) + delete m_output_ports[port_id].on_flush; + if (m_output_ports[port_id].on_rdm_request) + delete m_output_ports[port_id].on_rdm_request; + m_output_ports[port_id].on_discover = on_discover; + m_output_ports[port_id].on_flush = on_flush; + m_output_ports[port_id].on_rdm_request = on_rdm_request; + return true; +} + + +/* + * Called when there is data on this socket + */ +void ArtNetNode::SocketReady() { + artnet_packet packet; + ssize_t packet_size = sizeof(packet); + struct sockaddr_in source; + socklen_t source_length = sizeof(source); + + if (!m_socket->RecvFrom(reinterpret_cast(&packet), + &packet_size, + source, + source_length)) + return; + + // skip packets sent by us + if (source.sin_addr.s_addr != m_interface.ip_address.s_addr) + HandlePacket(source.sin_addr, packet, packet_size); +} + + +/* + * Send an ArtPollReply message + */ +bool ArtNetNode::SendPollReply(const IPAddress &destination) { + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_REPLY); + memset(&packet.data.reply, 0, sizeof(packet.data.reply)); + + memcpy(packet.data.reply.ip, + &m_interface.ip_address.s_addr, + sizeof(packet.data.reply.ip)); + packet.data.reply.port = HostToLittleEndian(ARTNET_PORT); + packet.data.reply.subnet_address[1] = m_input_ports[0].universe_address >> 4; + packet.data.reply.oem = HostToNetwork(OEM_CODE); + packet.data.reply.status1 = 0xd2; // normal indicators, rdm enabled + packet.data.reply.esta_id = HostToLittleEndian(OPEN_LIGHTING_ESTA_CODE); + strncpy(reinterpret_cast(packet.data.reply.short_name), + m_short_name.data(), + ARTNET_SHORT_NAME_LENGTH); + strncpy(reinterpret_cast(packet.data.reply.long_name), + m_long_name.data(), + ARTNET_LONG_NAME_LENGTH); + + std::stringstream str; + str << "#0001 [" << m_unsolicited_replies << "] OLA"; + strncpy(reinterpret_cast(packet.data.reply.node_report), + str.str().data(), + ARTNET_REPORT_LENGTH); + packet.data.reply.number_ports[1] = ARTNET_MAX_PORTS; + for (unsigned int i = 0; i < ARTNET_MAX_PORTS; i++) { + packet.data.reply.port_types[i] = 0xc0; // input and output DMX + packet.data.reply.good_input[i] = m_input_ports[i].enabled ? 0x0 : 0x8; + packet.data.reply.sw_in[i] = m_input_ports[i].universe_address; + packet.data.reply.good_output[i] = ( + (m_output_ports[i].enabled ? 0x80 : 0x00) | + (m_output_ports[i].merge_mode == ARTNET_MERGE_LTP ? 0x2 : 0x0) | + (m_output_ports[i].is_merging ? 0x8 : 0x0)); + packet.data.reply.sw_out[i] = m_output_ports[i].universe_address; + } + packet.data.reply.style = NODE_CODE; + memcpy(packet.data.reply.mac, + m_interface.hw_address, + ola::network::MAC_LENGTH); + memcpy(packet.data.reply.bind_ip, + &m_interface.ip_address.s_addr, + sizeof(packet.data.reply.bind_ip)); + // maybe set status2 here if the web UI is enabled + if (!SendPacket(packet, sizeof(packet.data.reply), destination)) { + OLA_INFO << "Failed to send ArtPollReply"; + return false; + } + return true; +} + + +/* + * Send an IPProgReply + */ +bool ArtNetNode::SendIPReply(const IPAddress &destination) { + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_REPLY); + memset(&packet.data.ip_reply, 0, sizeof(packet.data.ip_reply)); + packet.data.ip_reply.version = HostToNetwork(ARTNET_VERSION); + + memcpy(packet.data.ip_reply.ip, + &m_interface.ip_address.s_addr, + sizeof(packet.data.ip_reply.ip)); + memcpy(packet.data.ip_reply.subnet, + &m_interface.ip_address.s_addr, + sizeof(packet.data.ip_reply.subnet)); + packet.data.ip_reply.port = HostToLittleEndian(ARTNET_PORT); + + if (!SendPacket(packet, sizeof(packet.data.ip_reply), destination)) { + OLA_INFO << "Failed to send ArtIpProgReply"; + return false; + } + return true; +} + + +/* + * Handle a artnet packet + */ +void ArtNetNode::HandlePacket(const IPAddress &source_address, + const artnet_packet &packet, + unsigned int packet_size) { + unsigned int header_size = sizeof(packet) - sizeof(packet.data); + + if (packet_size <= header_size) { + OLA_WARN << "Skipping small artnet packet received, size=" << packet_size; + return; + } + + switch (LittleEndianToHost(packet.op_code)) { + case ARTNET_POLL: + HandlePollPacket(source_address, + packet.data.poll, + packet_size - header_size); + break; + case ARTNET_REPLY: + HandleReplyPacket(source_address, + packet.data.reply, + packet_size - header_size); + break; + case ARTNET_DMX: + HandleDataPacket(source_address, + packet.data.dmx, + packet_size - header_size); + break; + case ARTNET_TODREQUEST: + HandleTodRequest(source_address, + packet.data.tod_request, + packet_size - header_size); + break; + case ARTNET_TODDATA: + HandleTodData(source_address, + packet.data.tod_data, + packet_size - header_size); + break; + case ARTNET_TODCONTROL: + HandleTodControl(source_address, + packet.data.tod_control, + packet_size - header_size); + break; + case ARTNET_RDM: + HandleRdm(source_address, + packet.data.rdm, + packet_size - header_size); + break; + case ARTNET_IP_PROGRAM: + HandleIPProgram(source_address, + packet.data.ip_program, + packet_size - header_size); + break; + case ARTNET_RDM_SUB: + // Not implemented + break; + default: + OLA_INFO << "ArtNet got unknown packet " << std::hex << + LittleEndianToHost(packet.op_code); + } +} + + +/* + * Handle an ArtPoll packet + */ +void ArtNetNode::HandlePollPacket(const IPAddress &source_address, + const artnet_poll_t &packet, + unsigned int packet_size) { + if (!CheckPacketSize(source_address, "ArtPoll", packet_size, sizeof(packet))) + return; + + if (!CheckPacketVersion(source_address, "ArtPoll", packet.version)) + return; + + m_send_reply_on_change = packet.talk_to_me & 0x02; + // It's unclear if this should be broadcast or unicast, stick with broadcast + SendPollReply(m_interface.bcast_address); + (void) source_address; +} + + +/* + * Handle an ArtPollReply packet + */ +void ArtNetNode::HandleReplyPacket(const IPAddress &source_address, + const artnet_reply_t &packet, + unsigned int packet_size) { + // older versions don't have the bind_ip and the extra filler, make sure we + // support these + unsigned int minimum_reply_size = ( + sizeof(packet) - + sizeof(packet.filler) - + sizeof(packet.status2) - + sizeof(packet.bind_index) - + sizeof(packet.bind_ip)); + if (!CheckPacketSize(source_address, "ArtPollReply", packet_size, + minimum_reply_size)) + return; + + // Update the subscribed nodes list + unsigned int port_limit = std::min((uint8_t) ARTNET_MAX_PORTS, + packet.number_ports[1]); + for (unsigned int i = 0; i < port_limit; i++) { + if (packet.port_types[i] & 0x80) { + // port is of type output + uint8_t universe_id = packet.sw_out[i]; + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_input_ports[port_id].enabled && + m_input_ports[port_id].universe_address == universe_id) { + m_input_ports[port_id].subscribed_nodes[source_address] = + *m_plugin_adaptor->WakeUpTime(); + } + } + } + } +} + + +/* + * Handle a DMX Data packet, this takes care of the merging + */ +void ArtNetNode::HandleDataPacket(const IPAddress &source_address, + const artnet_dmx_t &packet, + unsigned int packet_size) { + // The data section needs to be at least 2 bytes according to the spec + unsigned int header_size = sizeof(artnet_dmx_t) - DMX_UNIVERSE_SIZE; + if (!CheckPacketSize(source_address, "ArtDmx", packet_size, header_size + 2)) + return; + + if (!CheckPacketVersion(source_address, "ArtDmx", packet.version)) + return; + + uint16_t universe_id = LittleEndianToHost(packet.universe); + uint16_t data_size = std::min( + (unsigned int) ((packet.length[0] << 8) + packet.length[1]), + packet_size - header_size); + + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_output_ports[port_id].enabled && + m_output_ports[port_id].universe_address == universe_id && + m_output_ports[port_id].on_data && + m_output_ports[port_id].buffer) { + // update this port, doing a merge if necessary + DMXSource source; + source.address = source_address; + source.timestamp = *m_plugin_adaptor->WakeUpTime(); + source.buffer.Set(packet.data, data_size); + UpdatePortFromSource(&m_output_ports[port_id], source); + } + } +} + + +/* + * Handle a TOD Request packet + */ +void ArtNetNode::HandleTodRequest(const IPAddress &source_address, + const artnet_todrequest_t &packet, + unsigned int packet_size) { + unsigned int header_size = sizeof(packet) - sizeof(packet.addresses); + if (!CheckPacketSize(source_address, "ArtTodRequest", packet_size, + header_size)) + return; + + if (!CheckPacketVersion(source_address, "ArtTodRequest", packet.version)) + return; + + if (packet.command) { + OLA_INFO << "ArtTodRequest received but command field was " << + static_cast(packet.command); + return; + } + + unsigned int addresses = std::min( + packet_size - header_size, + static_cast(packet.address_count)); + + addresses = std::min( + static_cast(ARTNET_MAX_RDM_ADDRESS_COUNT), + addresses); + + bool handler_called[ARTNET_MAX_PORTS]; + memset(handler_called, 0, sizeof(handler_called)); + + for (unsigned int i = 0; i < addresses; i++) { + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_output_ports[port_id].enabled && + m_output_ports[port_id].universe_address == packet.addresses[i] && + m_output_ports[port_id].on_discover && + !handler_called[port_id]) { + m_output_ports[port_id].on_discover->Run(); + handler_called[port_id] = true; + } + } + } +} + + +/* + * Handle a TOD data packet + */ +void ArtNetNode::HandleTodData(const IPAddress &source_address, + const artnet_toddata_t &packet, + unsigned int packet_size) { + unsigned int expected_size = sizeof(packet) - sizeof(packet.tod); + if (!CheckPacketSize(source_address, "ArtTodData", packet_size, + expected_size)) + return; + + if (!CheckPacketVersion(source_address, "ArtTodData", packet.version)) + return; + + if (packet.rdm_version != RDM_VERSION) { + OLA_WARN << "Dropping non standard RDM version: " << + static_cast(packet.rdm_version); + return; + } + + if (packet.command_response) { + OLA_WARN << "Command response 0x" << std::hex << packet.command_response << + " != 0x0"; + return; + } + + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_input_ports[port_id].enabled && + m_input_ports[port_id].universe_address == packet.address) { + UpdatePortFromTodPacket(port_id, source_address, packet, packet_size); + } + } +} + + +/* + * Handle a TOD Control packet + */ +void ArtNetNode::HandleTodControl(const IPAddress &source_address, + const artnet_todcontrol_t &packet, + unsigned int packet_size) { + if (!CheckPacketSize(source_address, "ArtTodControl", packet_size, + sizeof(packet))) + return; + + if (!CheckPacketVersion(source_address, "ArtTodControl", packet.version)) + return; + + if (packet.command != TOD_FLUSH_COMMAND) + return; + + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_output_ports[port_id].enabled && + m_output_ports[port_id].universe_address == packet.address && + m_output_ports[port_id].on_flush) { + m_output_ports[port_id].on_flush->Run(); + } + } +} + + +/* + * Handle an RDM packet + */ +void ArtNetNode::HandleRdm(const IPAddress &source_address, + const artnet_rdm_t &packet, + unsigned int packet_size) { + unsigned int header_size = sizeof(packet) - ARTNET_MAX_RDM_DATA; + if (!CheckPacketSize(source_address, "ArtRDM", packet_size, header_size)) + return; + + if (!CheckPacketVersion(source_address, "ArtRDM", packet.version)) + return; + + if (packet.rdm_version != RDM_VERSION) { + OLA_INFO << "Dropping non standard RDM version: " << + static_cast(packet.rdm_version); + return; + } + + if (packet.command) { + OLA_WARN << "Unknown RDM command " << static_cast(packet.command); + return; + } + + unsigned int rdm_length = packet_size - header_size; + if (!rdm_length) + return; + + // look for the port that this was sent to, once we know the port we can try + // to parse the message + for (unsigned int port_id = 0; port_id < ARTNET_MAX_PORTS; port_id++) { + if (m_output_ports[port_id].enabled && + m_output_ports[port_id].universe_address == packet.address && + m_output_ports[port_id].on_rdm_request) { + RDMRequest *request = RDMRequest::InflateFromData(packet.data, + rdm_length); + + if (request) { + // update the output port uid map + m_output_ports[port_id].uid_map[request->SourceUID()] = source_address; + m_output_ports[port_id].on_rdm_request->Run(request); + } + } + + if (m_input_ports[port_id].enabled && + m_input_ports[port_id].universe_address == packet.address && + m_input_ports[port_id].on_rdm_response) { + RDMResponse *response = RDMResponse::InflateFromData(packet.data, + rdm_length); + if (response) + HandleRdmResponse(port_id, response); + } + } +} + + +/** + * Handle an RDM response, taking care to deal with ACK_OVERFLOW messages. + * + * ArtNet as a protocol is broken, the nodes don't buffer ACK_OVERFLOW messages + * so if another GET/SET message arrives from *any* controller the ACK_OVERFLOW + * session will be reset, causing the controller to spin in a loop. + * TODO(simonn): lock out sending when we see an ACK_OVERFLOW to give us a + * better chance of completing the session. + * + */ +void ArtNetNode::HandleRdmResponse(unsigned int port_id, + const RDMResponse *response) { + InputPort &input_port = m_input_ports[port_id]; + if (input_port.pending_rdm_requests.empty()) + return; + + const RDMRequest *request = input_port.pending_rdm_requests.front(); + if (request->SourceUID() != response->DestinationUID() || + request->DestinationUID() != response->SourceUID() || + request->SubDevice() != response->SubDevice() || + request->ParamId() != response->ParamId()) { + OLA_INFO << "Got an unexpected RDM response"; + return; + } + + if ((request->CommandClass() == RDMCommand::GET_COMMAND && + response->CommandClass() != RDMCommand::GET_COMMAND_RESPONSE) || + (request->CommandClass() == RDMCommand::SET_COMMAND && + response->CommandClass() != RDMCommand::SET_COMMAND_RESPONSE)) { + OLA_INFO << "Unmatched RDM response, request CC was " << std::hex << + static_cast(request->CommandClass()) << ", response CC was " << + static_cast(response->CommandClass()); + return; + } + + if (input_port.overflowed_response) { + if (response->ResponseType() == ola::rdm::ACK_OVERFLOW) { + OLA_INFO << "Continued ACK_OVERFLOW session for " << + response->SourceUID() << " -> " << response->DestinationUID() << + ", PID " << std::hex << response->ParamId(); + const RDMResponse *existing_reponse = input_port.overflowed_response; + input_port.overflowed_response = RDMResponse::CombineResponses( + existing_reponse, + response); + delete response; + delete existing_reponse; + + if (input_port.overflowed_response) { + // combine worked + if (SendFirstRDMRequest(port_id)) { + input_port.overflowed_response = response; + return; + } else { + // send failed, abort + delete input_port.overflowed_response; + input_port.overflowed_response = NULL; + } + } + } else if (response->ResponseType() == ola::rdm::ACK) { + // end of the session, remove and call handler + OLA_INFO << "Final packet in ACK_OVERFLOW session for " << + response->SourceUID() << " -> " << response->DestinationUID() << + ", PID " << std::hex << response->ParamId(); + const RDMResponse *full_response = RDMResponse::CombineResponses( + input_port.overflowed_response, + response); + delete input_port.overflowed_response; + input_port.overflowed_response = NULL; + delete response; + + if (full_response) + input_port.on_rdm_response->Run(full_response); + } else { + // not an ack or overflow, abort transfer + OLA_INFO << "Got " << static_cast(response->ResponseType()) << + " in ACK_OVERFLOW session for " << + response->SourceUID() << " -> " << response->DestinationUID() << + ", PID " << std::hex << response->ParamId() << ", aborting session"; + delete response; + } + } else if (response->ResponseType() == ola::rdm::ACK_OVERFLOW) { + OLA_INFO << "Got new ACK_OVERFLOW for " << + response->SourceUID() << " -> " << response->DestinationUID() << + ", PID " << std::hex << response->ParamId(); + + if (SendFirstRDMRequest(port_id)) { + input_port.overflowed_response = response; + return; + } else { + // send failed, abort + delete response; + } + } else { + // this is just a normal response + input_port.on_rdm_response->Run(response); + } + ClearPendingRDMRequest(port_id); + MaybeSendRDMRequest(port_id); +} + + +/** + * Handle an IP Program message. + */ +void ArtNetNode::HandleIPProgram(const IPAddress &source_address, + const artnet_ip_prog_t &packet, + unsigned int packet_size) { + if (!CheckPacketSize(source_address, "ArtIpProg", packet_size, + sizeof(packet))) + return; + + if (!CheckPacketVersion(source_address, "ArtIpProg", packet.version)) + return; + + OLA_INFO << + "Got ArtIpProgram, ignoring because we don't support remote configuration"; +} + +/* + * Fill in the header for a packet + */ +void ArtNetNode::PopulatePacketHeader(artnet_packet *packet, + uint16_t op_code) { + strncpy(reinterpret_cast(packet->id), ARTNET_ID, sizeof(packet->id)); + packet->op_code = HostToLittleEndian(op_code); +} + + + +/* + * Increment the counts for all the uids + */ +void ArtNetNode::IncrementUIDCounts(uint8_t port_id) { + uid_map::iterator iter = m_input_ports[port_id].uids.begin(); + + for (; iter != m_input_ports[port_id].uids.end(); ++iter) { + iter->second.second++; + } +} + + +/* + * Send an ArtNet packet + * @param packet + * @param size the size of the packet, excluding the header portion + * @param destination where to send the packet to + */ +bool ArtNetNode::SendPacket(const artnet_packet &packet, + unsigned int size, + const IPAddress &ip_destination) { + struct sockaddr_in destination; + destination.sin_family = AF_INET; + destination.sin_port = HostToNetwork(ARTNET_PORT); + destination.sin_addr = ip_destination; + + size += sizeof(packet.id) + sizeof(packet.op_code); + unsigned int bytes_sent = m_socket->SendTo( + reinterpret_cast(&packet), + size, + destination); + + if (bytes_sent != size) { + OLA_WARN << "Only sent " << bytes_sent << " of " << size; + return false; + } + return true; +} + + +/** + * Send an pending RDM request if we can. + * @param port_id the id of the port to send the requests for. + */ +void ArtNetNode::MaybeSendRDMRequest(uint8_t port_id) { + InputPort &input_port = m_input_ports[port_id]; + + if (input_port.pending_rdm_requests.empty()) + return; + + if (input_port.rdm_send_timeout != ola::network::INVALID_TIMEOUT) + return; + + if (SendFirstRDMRequest(port_id)) { + input_port.rdm_send_timeout = m_plugin_adaptor->RegisterSingleTimeout( + RDM_REQUEST_TIMEOUT_MS, + ola::NewSingleClosure(this, &ArtNetNode::TimeoutRDMRequest, port_id)); + } else { + // send failed, remove this request and try the next one. + ClearPendingRDMRequest(port_id); + MaybeSendRDMRequest(port_id); + } +} + + +/** + * Send the RDM request from the head of the queue. + * @param port_id the id of the port to send the requests for. + */ +bool ArtNetNode::SendFirstRDMRequest(uint8_t port_id) { + InputPort &input_port = m_input_ports[port_id]; + const RDMRequest *request = input_port.pending_rdm_requests.front(); + + const UID &uid_destination = request->DestinationUID(); + uid_map::const_iterator iter = + m_input_ports[port_id].uids.find(uid_destination); + + IPAddress destination = m_interface.bcast_address; + + if (iter == m_input_ports[port_id].uids.end()) { + OLA_WARN << "Couldn't find " << uid_destination << + " in the uid map, broadcasting packet"; + } else { + destination = iter->second.first; + } + + return SendRDMCommand(*request, + destination, + m_input_ports[port_id].universe_address); +} + + +/** + * Timeout a pending RDM request + * @param port_id the id of the port to timeout. + */ +void ArtNetNode::TimeoutRDMRequest(uint8_t port_id) { + OLA_INFO << "RDM Request timed out."; + m_input_ports[port_id].rdm_send_timeout = ola::network::INVALID_TIMEOUT; + ClearPendingRDMRequest(port_id); + MaybeSendRDMRequest(port_id); +} + + +/** + * Remove the head of the pending queue and reset the timeout. + */ +void ArtNetNode::ClearPendingRDMRequest(uint8_t port_id) { + InputPort &input_port = m_input_ports[port_id]; + if (!input_port.pending_rdm_requests.empty()) { + delete input_port.pending_rdm_requests.front(); + input_port.pending_rdm_requests.pop(); + } + if (input_port.rdm_send_timeout != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(input_port.rdm_send_timeout); + input_port.rdm_send_timeout = ola::network::INVALID_TIMEOUT; + } +} + + +/* + * Send a generic ArtRdm message + */ +bool ArtNetNode::SendRDMCommand(const RDMCommand &command, + const IPAddress &destination, + uint8_t universe) { + artnet_packet packet; + PopulatePacketHeader(&packet, ARTNET_RDM); + memset(&packet.data.rdm, 0, sizeof(packet.data.rdm)); + packet.data.rdm.version = HostToNetwork(ARTNET_VERSION); + packet.data.rdm.rdm_version = RDM_VERSION; + packet.data.rdm.address = universe; + unsigned int rdm_size = ARTNET_MAX_RDM_DATA; + command.Pack(packet.data.rdm.data, &rdm_size); + unsigned int packet_size = sizeof(packet.data.rdm) - ARTNET_MAX_RDM_DATA + + rdm_size; + return SendPacket(packet, packet_size, destination); +} + + +/* + * Update a port from a source, merging if necessary + */ +void ArtNetNode::UpdatePortFromSource(OutputPort *port, + const DMXSource &source) { + TimeStamp merge_time_threshold = ( + *m_plugin_adaptor->WakeUpTime() - TimeInterval(MERGE_TIMEOUT, 0)); + unsigned int first_empty_slot = MAX_MERGE_SOURCES; + unsigned int source_slot = MAX_MERGE_SOURCES; + unsigned int active_sources = 0; + + for (unsigned int i = 0; i < MAX_MERGE_SOURCES; i++) { + if (port->sources[i].address.s_addr == source.address.s_addr) + source_slot = i; + // timeout old sources + if (port->sources[i].timestamp < merge_time_threshold) + port->sources[i].address.s_addr = 0; + + if (port->sources[i].address.s_addr != 0) + active_sources++; + else if (i < first_empty_slot) + first_empty_slot = i; + } + + if (source_slot == MAX_MERGE_SOURCES) { + if (first_empty_slot == MAX_MERGE_SOURCES) { + // No room at the inn + OLA_WARN << "Max merge sources reached, ignoring"; + return; + } + if (active_sources == 0) { + port->is_merging = false; + } else { + OLA_INFO << "Entered merge mode for universe " << + static_cast(port->universe_address); + port->is_merging = true; + if (m_send_reply_on_change) { + m_unsolicited_replies++; + SendPollReply(m_interface.bcast_address); + } + } + source_slot = first_empty_slot; + } else if (active_sources == 1) { + port->is_merging = false; + } + + port->sources[source_slot] = source; + + // Now we need to merge + if (port->merge_mode == ARTNET_MERGE_LTP) { + // the current source is the latest + (*port->buffer) = source.buffer; + } else { + // HTP merge + bool first = true; + for (unsigned int i = 0; i < MAX_MERGE_SOURCES; i++) { + if (port->sources[i].address.s_addr != 0) { + if (first) { + (*port->buffer) = port->sources[i].buffer; + first = false; + } else { + port->buffer->HTPMerge(port->sources[i].buffer); + } + } + } + } + port->on_data->Run(); +} + + +/* + * Check the version number of a incomming packet + */ +bool ArtNetNode::CheckPacketVersion(const IPAddress &source_address, + const string &packet_type, + uint16_t version) { + if (NetworkToHost(version) != ARTNET_VERSION) { + OLA_INFO << packet_type << " version mismatch, was " << + NetworkToHost(version) << " from " << + AddressToString(source_address); + return false; + } + return true; +} + + +/* + * Check the size of an incoming packet + */ +bool ArtNetNode::CheckPacketSize(const IPAddress &source_address, + const string &packet_type, + unsigned int actual_size, + unsigned int expected_size) { + if (actual_size < expected_size) { + OLA_INFO << packet_type << " from " << AddressToString(source_address) << + " was too small, got " << actual_size << + " required at least " << expected_size; + return false; + } + return true; +} + + +/* + * Check if the input port is available for sending + */ +bool ArtNetNode::CheckInputPortState(uint8_t port_id, const string &action) { + return CheckPortState(port_id, action, false); +} + + +/* + * Check if the output port is available for sending + */ +bool ArtNetNode::CheckOutputPortState(uint8_t port_id, const string &action) { + return CheckPortState(port_id, action, true); +} + + +/* + * Check if a port is available for sending + */ +bool ArtNetNode::CheckPortState(uint8_t port_id, + const string &action, + bool is_output) { + if (!m_running) + return false; + + if (port_id > ARTNET_MAX_PORTS) { + OLA_WARN << "Port index of out bounds: " << port_id << " > " << + ARTNET_MAX_PORTS; + return false; + } + + if ((is_output && !m_output_ports[port_id].enabled) || + (!is_output && !m_input_ports[port_id].enabled)) { + OLA_INFO << "Attempt to send " << action << " on an inactive port"; + return false; + } + return true; +} + + +/* + * Setup the networking components. + */ +bool ArtNetNode::InitNetwork() { + m_socket = new UdpSocket(); + + if (!m_socket->Init()) { + OLA_WARN << "Socket init failed"; + delete m_socket; + return false; + } + + if (!m_socket->Bind(ARTNET_PORT)) { + OLA_WARN << "Failed to bind to:" << ARTNET_PORT; + delete m_socket; + return false; + } + + if (!m_socket->EnableBroadcast()) { + OLA_WARN << "Failed to enable broadcasting"; + delete m_socket; + return false; + } + + m_socket->SetOnData(NewClosure(this, &ArtNetNode::SocketReady)); + m_plugin_adaptor->AddSocket(m_socket); + return true; +} + + +/* + * Update a port with a new TOD list + */ +void ArtNetNode::UpdatePortFromTodPacket(uint8_t port_id, + const IPAddress &source_address, + const artnet_toddata_t &packet, + unsigned int packet_size) { + unsigned int tod_size = packet_size - (sizeof(packet) - sizeof(packet.tod)); + unsigned int uid_count = std::min(tod_size / ola::rdm::UID::UID_SIZE, + (unsigned int) packet.uid_count); + + OLA_DEBUG << "Got TOD data packet with " << uid_count << " uids"; + bool changed = false; + uid_map &port_uids = m_input_ports[port_id].uids; + UIDSet uid_set; + + for (unsigned int i = 0; i < uid_count; i++) { + UID uid(packet.tod[i]); + uid_set.AddUID(uid); + uid_map::iterator iter = port_uids.find(uid); + if (iter == port_uids.end()) { + port_uids[uid] = std::pair(source_address, 0); + changed = true; + } else { + if (iter->second.first.s_addr != source_address.s_addr) { + OLA_WARN << "UID " << uid << " changed from " << + AddressToString(iter->second.first) << " to " << + AddressToString(source_address); + iter->second.first = source_address; + } + iter->second.second = 0; + } + } + + // If this is the one and only block from this node, we can remove all uids + // that don't appear in it. + // There is a bug in ArtNet nodes where sometimes UidCount > UidTotal. + if (uid_count >= NetworkToHost(packet.uid_total)) { + uid_map::iterator iter = port_uids.begin(); + while (iter != port_uids.end()) { + if (iter->second.first.s_addr == source_address.s_addr && + !uid_set.Contains(iter->first)) { + port_uids.erase(iter++); + changed = true; + } else { + ++iter; + } + } + } + + // Removing uids from multi-block messages is much harder as you need to + // consider dropped packets. For the moment we rely on the + // RDM_MISSED_TODDATA_LIMIT to clean these up. + // TODO(simon): figure this out sometime + + if (changed) + NotifyClientOfNewTod(port_id); +} + + +/* + * Start the discovery process, this puts the port into discovery mode and + * sets up the completion callback + */ +bool ArtNetNode::GrabDiscoveryLock(uint8_t port_id) { + if (m_input_ports[port_id].discovery_running) { + OLA_INFO << + "ArtNet UID discovery already running, ignoring additional requests"; + return false; + } + m_input_ports[port_id].discovery_running = true; + + // increment the count of all current uids + uid_map::iterator iter = m_input_ports[port_id].uids.begin(); + for (; iter != m_input_ports[port_id].uids.end(); ++iter) { + iter->second.second++; + } + + m_discovery_timeout = m_plugin_adaptor->RegisterSingleTimeout( + RDM_TOD_TIMEOUT_MS, + ola::NewSingleClosure(this, &ArtNetNode::ReleaseDiscoveryLock, port_id)); + return true; +} + + +/* + * Called when the discovery process times out. + */ +void ArtNetNode::ReleaseDiscoveryLock(uint8_t port_id) { + OLA_INFO << "Discovery process timeout"; + m_discovery_timeout = ola::network::INVALID_TIMEOUT; + + // delete all uids that have reached the max count + bool changed = false; + uid_map::iterator iter = m_input_ports[port_id].uids.begin(); + while (iter != m_input_ports[port_id].uids.end()) { + if (iter->second.second == RDM_MISSED_TODDATA_LIMIT) { + changed = true; + m_input_ports[port_id].uids.erase(iter++); + } else { + ++iter; + } + } + + if (changed) { + OLA_INFO << "Some uids have timed out, updating."; + NotifyClientOfNewTod(port_id); + } + m_input_ports[port_id].discovery_running = false; +} + + +/* + * Notify the client of a new TOD + */ +void ArtNetNode::NotifyClientOfNewTod(uint8_t port_id) { + if (m_input_ports[port_id].on_tod) { + uid_map &port_uids = m_input_ports[port_id].uids; + UIDSet uids; + uid_map::iterator uid_iter = port_uids.begin(); + for (; uid_iter != port_uids.end(); ++uid_iter) + uids.AddUID(uid_iter->first); + m_input_ports[port_id].on_tod->Run(uids); + } +} +} // artnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.h b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.h new file mode 100644 index 0000000..a0bbe91 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetNode.h @@ -0,0 +1,296 @@ +/* + * 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 Library 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. + * + * ArtNetNode.h + * Header file for the ArtNetNode class + * Copyright (C) 2005-2010 Simon Newton + */ + +#ifndef PLUGINS_ARTNET_ARTNETNODE_H_ +#define PLUGINS_ARTNET_ARTNETNODE_H_ + +#include +#include +#include +#include + +#include "ola/Clock.h" +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/rdm/RDMCommand.h" +#include "ola/rdm/UIDSet.h" +#include "ola/network/Interface.h" +#include "ola/network/Socket.h" +#include "olad/PluginAdaptor.h" +#include "plugins/artnet/ArtNetPackets.h" + +namespace ola { +namespace plugin { +namespace artnet { + +using std::map; +using std::queue; +using std::string; +using ola::rdm::RDMCommand; +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; +using ola::rdm::UID; +using ola::rdm::UIDSet; + + +class ArtNetNode { + public: + // The directions are the opposite from what OLA uses + typedef enum { + ARTNET_INPUT_PORT, // sends ArtNet data + ARTNET_OUTPUT_PORT, // receives ArtNet data + } artnet_port_type; + + typedef enum { + ARTNET_MERGE_HTP, // default + ARTNET_MERGE_LTP, + } artnet_merge_mode; + + typedef struct in_addr IPAddress; + + struct ltIpAddress { + bool operator()(const IPAddress &ip1, const IPAddress &ip2) { + return ip1.s_addr < ip2.s_addr; + } + }; + + // This can be passed to SetPortUniverse to disable ports + static const uint8_t ARTNET_DISABLE_PORT = 0xf0; + + // Typedef our callbacks + typedef ola::Callback1 rdm_tod_callback; + typedef ola::Callback1 rdm_response_callback; + typedef ola::Callback1 rdm_request_callback; + + private: + struct GenericPort { + uint8_t universe_address; + uint8_t sequence_number; + bool enabled; + }; + + typedef map > uid_map; + + struct InputPort: public GenericPort { + map subscribed_nodes; + // This maps each uid to the IP address and the number of TodRequests + // since it was last seen + uid_map uids; + rdm_tod_callback *on_tod; + rdm_response_callback *on_rdm_response; + bool discovery_running; + + // these control the sending of RDM requests. + timeout_id rdm_send_timeout; + queue pending_rdm_requests; + const RDMResponse *overflowed_response; + }; + + enum { MAX_MERGE_SOURCES = 2 }; + + struct DMXSource { + DmxBuffer buffer; + TimeStamp timestamp; + IPAddress address; + }; + + struct OutputPort: public GenericPort { + artnet_merge_mode merge_mode; + bool is_merging; + DMXSource sources[MAX_MERGE_SOURCES]; + DmxBuffer *buffer; + map uid_map; + Closure *on_data; + Closure *on_discover; + Closure *on_flush; + rdm_request_callback *on_rdm_request; + }; + + public: + explicit ArtNetNode(const ola::network::Interface &interface, + const string &short_name, + const string &long_name, + const PluginAdaptor *adaptor, + uint8_t subnet_address = 0); + virtual ~ArtNetNode(); + + bool Start(); + bool Stop(); + + // Various parameters to control the behaviour + bool SetShortName(const string &name); + string ShortName() const { return m_short_name; } + bool SetLongName(const string &name); + string LongName() const { return m_long_name; } + + bool SetSubnetAddress(uint8_t subnet_address); + uint8_t SubnetAddress() const { + return m_input_ports[0].universe_address >> 4; + } + + bool SetPortUniverse(artnet_port_type type, + uint8_t port_id, + uint8_t universe_id); + uint8_t GetPortUniverse(artnet_port_type type, uint8_t port_id); + + void SetBroadcastThreshold(unsigned int threshold) { + m_broadcast_threshold = threshold; + } + + bool SetMergeMode(uint8_t port_id, artnet_merge_mode merge_mode); + + + // Poll, this should be called periodically if we're sending data. + bool MaybeSendPoll(); + + // The following apply to Input Ports (those which send data) + bool SendDMX(uint8_t port_id, const ola::DmxBuffer &buffer); + bool SendTodRequest(uint8_t port_id); + bool ForceDiscovery(uint8_t port_id); + bool SendRDMRequest(uint8_t port_id, const RDMRequest *request); + bool SetInputPortRDMHandlers( + uint8_t port_id, + rdm_tod_callback *on_tod, + rdm_response_callback *on_rdm_response); + + // The following apply to Output Ports (those which receive data); + bool SetDMXHandler(uint8_t port_id, + DmxBuffer *buffer, + ola::Closure *handler); + bool SendTod(uint8_t port_id, const UIDSet &uid_set); + bool SendRDMResponse(uint8_t port_id, const RDMResponse &response); + bool SetOutputPortRDMHandlers( + uint8_t port_id, + ola::Closure *on_discover, + ola::Closure *on_flush, + rdm_request_callback *on_rdm_request); + + // socket management + void SocketReady(); + + private: + bool m_running; + bool m_send_reply_on_change; + string m_short_name; + string m_long_name; + unsigned int m_broadcast_threshold; + unsigned int m_unsolicited_replies; + const PluginAdaptor *m_plugin_adaptor; + + InputPort m_input_ports[ARTNET_MAX_PORTS]; + OutputPort m_output_ports[ARTNET_MAX_PORTS]; + ola::network::Interface m_interface; + ola::network::UdpSocket *m_socket; + timeout_id m_discovery_timeout; + + ArtNetNode(const ArtNetNode&); + ArtNetNode& operator=(const ArtNetNode&); + bool SendPollReply(const IPAddress &destination); + bool SendIPReply(const IPAddress &destination); + void HandlePacket(const IPAddress &source_address, + const artnet_packet &packet, + unsigned int packet_size); + void HandlePollPacket(const IPAddress &source_address, + const artnet_poll_t &packet, + unsigned int packet_size); + void HandleReplyPacket(const IPAddress &source_address, + const artnet_reply_t &packet, + unsigned int packet_size); + void HandleDataPacket(const IPAddress &source_address, + const artnet_dmx_t &packet, + unsigned int packet_size); + void HandleTodRequest(const IPAddress &source_address, + const artnet_todrequest_t &packet, + unsigned int packet_size); + void HandleTodData(const IPAddress &source_address, + const artnet_toddata_t &packet, + unsigned int packet_size); + void HandleTodControl(const IPAddress &source_address, + const artnet_todcontrol_t &packet, + unsigned int packet_size); + void HandleRdm(const IPAddress &source_address, + const artnet_rdm_t &packet, + unsigned int packet_size); + void HandleRdmResponse(unsigned int port_id, + const RDMResponse *response); + void HandleIPProgram(const IPAddress &source_address, + const artnet_ip_prog_t &packet, + unsigned int packet_size); + void PopulatePacketHeader(artnet_packet *packet, uint16_t op_code); + void IncrementUIDCounts(uint8_t port_id); + bool SendPacket(const artnet_packet &packet, + unsigned int size, + const IPAddress &destination); + void MaybeSendRDMRequest(uint8_t port_id); + bool SendFirstRDMRequest(uint8_t port_id); + void TimeoutRDMRequest(uint8_t port_id); + void ClearPendingRDMRequest(uint8_t port_id); + bool SendRDMCommand(const RDMCommand &command, + const IPAddress &destination, + uint8_t universe); + void UpdatePortFromSource(OutputPort *port, const DMXSource &source); + bool CheckPacketVersion(const IPAddress &source_address, + const string &packet_type, + uint16_t version); + bool CheckPacketSize(const IPAddress &source_address, + const string &packet_type, + unsigned int actual_size, + unsigned int expected_size); + bool CheckInputPortState(uint8_t port_id, const string &action); + bool CheckOutputPortState(uint8_t port_id, const string &action); + bool CheckPortState(uint8_t port_id, const string &action, bool is_output); + void UpdatePortFromTodPacket(uint8_t port_id, + const IPAddress &source_address, + const artnet_toddata_t &packet, + unsigned int packet_size); + bool GrabDiscoveryLock(uint8_t port_id); + void ReleaseDiscoveryLock(uint8_t port_id); + void NotifyClientOfNewTod(uint8_t port_id); + + bool InitNetwork(); + + static const char ARTNET_ID[]; + static const uint16_t ARTNET_PORT = 6454; + static const uint16_t OEM_CODE = 0x0431; + static const uint16_t ARTNET_VERSION = 14; + static const unsigned int BROADCAST_THRESHOLD = 30; // picked randomly... + // after not receiving a PollReply after this many seconds we declare the + // node as dead. This is set to 3x the POLL_INTERVAL in ArtNetDevice. + static const uint8_t NODE_CODE = 0x00; + static const uint16_t MAX_UIDS_PER_UNIVERSE = 0xffff; + static const uint8_t RDM_VERSION = 0x01; // v1.0 standard baby! + static const uint8_t TOD_FLUSH_COMMAND = 0x01; + static const unsigned int MERGE_TIMEOUT = 10; // As per the spec + // seconds after which a node is marked as inactive for the dmx merging + static const unsigned int NODE_TIMEOUT = 31; + // mseconds we wait for a TodData packet before declaring a node missing + static const unsigned int RDM_TOD_TIMEOUT_MS = 10000; + // Number of missed TODs before we decide a UID has gone + static const unsigned int RDM_MISSED_TODDATA_LIMIT = 3; + // The maximum number of requests we'll allow in the queue. This is a per + // port (universe) limit. + static const unsigned int RDM_REQUEST_QUEUE_LIMIT = 100; + // How long to wait for a response to an RDM Request + static const unsigned int RDM_REQUEST_TIMEOUT_MS = 2000; +}; +} // artnet +} // plugin +} // ola +#endif // PLUGINS_ARTNET_ARTNETNODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPackets.h b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPackets.h new file mode 100644 index 0000000..8a190f8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPackets.h @@ -0,0 +1,240 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ArtNetPackets.h + * Datagram definitions for ArtNet + * Copyright (C) 2004-2010 Simon Newton + */ + +#ifndef PLUGINS_ARTNET_ARTNETPACKETS_H_ +#define PLUGINS_ARTNET_ARTNETPACKETS_H_ + +#include "ola/BaseTypes.h" +#include "ola/rdm/UID.h" +#include "ola/network/InterfacePicker.h" + +namespace ola { +namespace plugin { +namespace artnet { + +// various length enums +enum { ARTNET_LONG_NAME_LENGTH = 64 }; +enum { ARTNET_MAX_PORTS = 4 }; +enum { ARTNET_MAX_RDM_ADDRESS_COUNT = 32 }; +// According to the rdm spec, this should be 256 bytes +// We'll set to 512 here just to be safe +enum { ARTNET_MAX_RDM_DATA = 512 }; +enum { ARTNET_MAX_UID_COUNT = 200 }; +enum { ARTNET_REPORT_LENGTH = 64 }; +enum { ARTNET_SHORT_NAME_LENGTH = 18 }; + + +/* + * The subset of packets we're interested in + */ +typedef enum artnet_packet_type_e { + ARTNET_POLL = 0x2000, + ARTNET_REPLY = 0x2100, + ARTNET_DMX = 0x5000, + ARTNET_TODREQUEST = 0x8000, + ARTNET_TODDATA = 0x8100, + ARTNET_TODCONTROL = 0x8200, + ARTNET_RDM = 0x8300, + ARTNET_RDM_SUB = 0x8400, + ARTNET_IP_PROGRAM = 0xf800, + ARTNET_IP_PROGRAM_REPLY = 0xf900, +} artnet_packet_type; + + +struct artnet_poll_s { + uint16_t version; + uint8_t talk_to_me; + uint8_t priority; +} __attribute__((packed)); + +typedef struct artnet_poll_s artnet_poll_t; + +struct artnet_reply_s { + uint8_t ip[ola::network::IPV4_LENGTH]; + uint16_t port; + uint16_t version; + uint8_t subnet_address[2]; + uint16_t oem; + uint8_t ubea; + uint8_t status1; + uint16_t esta_id; + uint8_t short_name[ARTNET_SHORT_NAME_LENGTH]; + uint8_t long_name[ARTNET_LONG_NAME_LENGTH]; + uint8_t node_report[ARTNET_REPORT_LENGTH]; + uint8_t number_ports[2]; + uint8_t port_types[ARTNET_MAX_PORTS]; + uint8_t good_input[ARTNET_MAX_PORTS]; + uint8_t good_output[ARTNET_MAX_PORTS]; + uint8_t sw_in[ARTNET_MAX_PORTS]; + uint8_t sw_out[ARTNET_MAX_PORTS]; + uint8_t sw_video; + uint8_t sw_macro; + uint8_t sw_remote; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t style; + uint8_t mac[ola::network::MAC_LENGTH]; + uint8_t bind_ip[ola::network::IPV4_LENGTH]; + uint8_t bind_index; + uint8_t status2; + uint8_t filler[26]; +} __attribute__((packed)); + +typedef struct artnet_reply_s artnet_reply_t; + + +struct artnet_dmx_s { + uint16_t version; + uint8_t sequence; + uint8_t physical; + uint16_t universe; + uint8_t length[2]; + uint8_t data[DMX_UNIVERSE_SIZE]; +} __attribute__((packed)); + +typedef struct artnet_dmx_s artnet_dmx_t; + + +struct artnet_todrequest_s { + uint16_t version; + uint8_t filler1; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t command; + uint8_t address_count; + uint8_t addresses[ARTNET_MAX_RDM_ADDRESS_COUNT]; +} __attribute__((packed)); + +typedef struct artnet_todrequest_s artnet_todrequest_t; + + +struct artnet_toddata_s { + uint16_t version; + uint8_t rdm_version; + uint8_t port; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t command_response; + uint8_t address; + uint16_t uid_total; + uint8_t block_count; + uint8_t uid_count; + uint8_t tod[ARTNET_MAX_UID_COUNT][ola::rdm::UID::UID_SIZE]; +} __attribute__((packed)); + +typedef struct artnet_toddata_s artnet_toddata_t; + +struct artnet_todcontrol_s { + uint16_t version; + uint8_t filler1; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t command; + uint8_t address; +} __attribute__((packed)); + +typedef struct artnet_todcontrol_s artnet_todcontrol_t; + +struct artnet_rdm_s { + uint16_t version; + uint8_t rdm_version; + uint8_t filler2; + uint8_t spare1; + uint8_t spare2; + uint8_t spare3; + uint8_t spare4; + uint8_t spare5; + uint8_t spare6; + uint8_t spare7; + uint8_t spare8; + uint8_t command; + uint8_t address; + uint8_t data[ARTNET_MAX_RDM_DATA]; +} __attribute__((packed)); + +typedef struct artnet_rdm_s artnet_rdm_t; + +struct artnet_ip_prog_s { + uint16_t version; + uint16_t filler; + uint8_t command; + uint8_t filler1; + uint8_t ip[ola::network::IPV4_LENGTH]; + uint8_t subnet[ola::network::IPV4_LENGTH]; + uint16_t port; + uint8_t spare[8]; +} __attribute__((packed)); + +typedef struct artnet_ip_prog_s artnet_ip_prog_t; + +struct artnet_ip_reply_s { + uint16_t version; + uint16_t filler; + uint8_t command; + uint8_t filler1; + uint8_t ip[ola::network::IPV4_LENGTH]; + uint8_t subnet[ola::network::IPV4_LENGTH]; + uint16_t port; + uint8_t spare[8]; +} __attribute__((packed)); + +typedef struct artnet_ip_reply_s artnet_ip_reply_t; + +// union of all artnet packets +typedef struct { + uint8_t id[8]; + uint16_t op_code; + union { + artnet_poll_t poll; + artnet_reply_t reply; + artnet_dmx_t dmx; + artnet_todrequest_t tod_request; + artnet_toddata_t tod_data; + artnet_todcontrol_t tod_control; + artnet_rdm_t rdm; + artnet_ip_prog_t ip_program; + artnet_ip_reply_t ip_reply; + } data; +} artnet_packet; +} // artnet +} // plugin +} // ola +#endif // PLUGINS_ARTNET_ARTNETPACKETS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.cpp new file mode 100644 index 0000000..44e5f56 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.cpp @@ -0,0 +1,161 @@ +/* + * 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 Library 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. + * + * ArtNetPlugin.cpp + * The ArtNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/artnet/ArtNetPlugin.h" +#include "plugins/artnet/ArtNetDevice.h" + + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create(const ola::PluginAdaptor *adaptor) { + return new ola::plugin::artnet::ArtNetPlugin(adaptor); +} + +namespace ola { +namespace plugin { +namespace artnet { + +const char ArtNetPlugin::ARTNET_LONG_NAME[] = "OLA - ArtNet node"; +const char ArtNetPlugin::ARTNET_SHORT_NAME[] = "OLA - ArtNet node"; +const char ArtNetPlugin::ARTNET_SUBNET[] = "0"; +const char ArtNetPlugin::PLUGIN_NAME[] = "ArtNet"; +const char ArtNetPlugin::PLUGIN_PREFIX[] = "artnet"; + +/* + * Start the plugin, for now we just have one device. + * TODO: allow multiple devices on different IPs ? + * @returns true if we started ok, false otherwise + */ +bool ArtNetPlugin::StartHook() { + m_device = new ArtNetDevice(this, + m_preferences, + m_plugin_adaptor); + + if (!m_device->Start()) { + delete m_device; + return false; + } + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool ArtNetPlugin::StopHook() { + if (m_device) { + // stop the device + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin. + * @return a string description of the plugin + */ +string ArtNetPlugin::Description() const { + return +"ArtNet Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with four input and four output ports.\n" +"\n" +"ArtNet limits a single device (identified by a unique IP) to four input and\n" +"four output ports, each bound to a separate ArtNet universe address. The \n" +"universe address is built from the subnet address as the upper for bits, \n" +"and the OLA universe number as the lower four bits.\n\n" +" ArtNet Subnet | Bound Universe | ArtNet Universe\n" +" 0 | 0 | 0\n" +" 0 | 1 | 1\n" +" 0 | 15 | 15\n" +" 0 | 16 | 0\n" +" 0 | 17 | 1\n" +" 1 | 0 | 16\n" +" 1 | 1 | 17\n" +" 15 | 0 | 240\n" +" 15 | 15 | 255\n\n" +"--- Config file : ola-artnet.conf ---\n" +"\n" +"ip = a.b.c.d\n" +"The ip address to bind to. If not specified it will use the first\n" +"non-loopback ip.\n" +"\n" +"long_name = ola - ArtNet node\n" +"The long name of the node.\n" +"\n" +"short_name = ola - ArtNet node\n" +"The short name of the node (first 17 chars will be used)\n" +"\n" +"subnet = 0\n" +"The ArtNet subnet to use (0-15).\n"; +} + + +/* + * Set default preferences. + */ +bool ArtNetPlugin::SetDefaultPreferences() { + bool save = false; + + if (!m_preferences) + return false; + + save |= m_preferences->SetDefaultValue(ArtNetDevice::K_IP_KEY, + IPv4Validator(), ""); + save |= m_preferences->SetDefaultValue(ArtNetDevice::K_SHORT_NAME_KEY, + StringValidator(), + ARTNET_SHORT_NAME); + save |= m_preferences->SetDefaultValue(ArtNetDevice::K_LONG_NAME_KEY, + StringValidator(), + ARTNET_LONG_NAME); + save |= m_preferences->SetDefaultValue(ArtNetDevice::K_SUBNET_KEY, + IntValidator(0, 15), + ARTNET_SUBNET); + + if (save) + m_preferences->Save(); + + // check if this save correctly + // we don't want to use it if null + if (m_preferences->GetValue(ArtNetDevice::K_SHORT_NAME_KEY).empty() || + m_preferences->GetValue(ArtNetDevice::K_LONG_NAME_KEY).empty() || + m_preferences->GetValue(ArtNetDevice::K_SUBNET_KEY).empty()) + return false; + + return true; +} +} // artnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.h new file mode 100644 index 0000000..c6f22a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPlugin.h @@ -0,0 +1,67 @@ +/* + * 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 Library 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. + * + * ArtNetPlugin.h + * Interface for the ArtNet plugin class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ARTNET_ARTNETPLUGIN_H_ +#define PLUGINS_ARTNET_ARTNETPLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace artnet { + +using ola::Plugin; +using ola::PluginAdaptor; +using std::string; + +class ArtNetDevice; + +class ArtNetPlugin : public Plugin { + public: + explicit ArtNetPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_device(NULL) {} + + ~ArtNetPlugin() {} + + string Name() const { return PLUGIN_NAME; } + ola_plugin_id Id() const { return OLA_PLUGIN_ARTNET; } + string Description() const; + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + ArtNetDevice *m_device; // only have one device + + static const char ARTNET_SUBNET[]; + static const char ARTNET_LONG_NAME[]; + static const char ARTNET_SHORT_NAME[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; +}; +} // artnet +} // plugin +} // ola +#endif // PLUGINS_ARTNET_ARTNETPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.cpp new file mode 100644 index 0000000..3478212 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.cpp @@ -0,0 +1,216 @@ +/* + * 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 Library 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. + * + * ArtNetPort.cpp + * The ArtNet plugin for ola + * Copyright (C) 2005 - 2009 Simon Newton + */ +#include +#include + +#include "ola/Logging.h" +#include "olad/Universe.h" +#include "plugins/artnet/ArtNetDevice.h" +#include "plugins/artnet/ArtNetPort.h" + +namespace ola { +namespace plugin { +namespace artnet { + +using ola::NewClosure; + +/* + * Reprogram our port. + */ +void ArtNetPortHelper::PostSetUniverse(Universe *new_universe, + unsigned int port_id) { + ArtNetNode::artnet_port_type direction = m_is_output ? + ArtNetNode::ARTNET_INPUT_PORT : ArtNetNode::ARTNET_OUTPUT_PORT; + + uint8_t universe_id = new_universe ? new_universe->UniverseId() % 0x10 : + ArtNetNode::ARTNET_DISABLE_PORT; + + m_node->SetPortUniverse(direction, port_id, universe_id); +} + + +/* + * Return the port description + */ +string ArtNetPortHelper::Description(const Universe *universe, + unsigned int port_id) const { + if (!universe) + return ""; + + ArtNetNode::artnet_port_type direction = m_is_output ? + ArtNetNode::ARTNET_INPUT_PORT : ArtNetNode::ARTNET_OUTPUT_PORT; + + std::stringstream str; + str << "ArtNet Universe " << + static_cast(m_node->GetPortUniverse(direction, port_id)); + return str.str(); +} + + +/* + * Send a RDM response over ArtNet + */ +bool ArtNetInputPort::HandleRDMResponse( + const ola::rdm::RDMResponse *response) { + // TODO(simonn): handle fragmentation here? + m_helper.GetNode()->SendRDMResponse( + PortId(), + *response); + delete response; + return true; +} + + +/* + * Set the DMX Handlers as needed + */ +void ArtNetInputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + m_helper.PostSetUniverse(new_universe, PortId()); + + if (new_universe && !old_universe) { + m_helper.GetNode()->SetDMXHandler( + PortId(), + &m_buffer, + NewClosure(this, &ArtNetInputPort::DmxChanged)); + m_helper.GetNode()->SetOutputPortRDMHandlers( + PortId(), + NewClosure( + this, + &ArtNetInputPort::RespondWithTod), + NewClosure( + this, + &ArtNetInputPort::TriggerRDMDiscovery), + ola::NewCallback( + this, + &ArtNetInputPort::PolitelyHandleRDMRequest)); + + } else if (!new_universe) { + m_helper.GetNode()->SetDMXHandler(PortId(), NULL, NULL); + m_helper.GetNode()->SetOutputPortRDMHandlers( + PortId(), + NULL, + NULL, + NULL); + } + + if (new_universe) + RespondWithTod(); +} + + +/* + * Handle an RDM request, and send a TodData if this uid wasn't found + */ +void ArtNetInputPort::PolitelyHandleRDMRequest( + const ola::rdm::RDMRequest *request) { + + if (!HandleRDMRequest(request)) { + OLA_INFO << "Request for an unknown UID, sending updated TOD"; + RespondWithTod(); + } +} + + +/* + * Respond With Tod + */ +void ArtNetInputPort::RespondWithTod() { + ola::rdm::UIDSet uids; + if (GetUniverse()) + GetUniverse()->GetUIDs(&uids); + m_helper.GetNode()->SendTod(PortId(), uids); +} + + +/* + * Write operation + * @param data pointer to the dmx data + * @param length the length of the data + * @return true if the write succeeded, false otherwise + */ +bool ArtNetOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + if (PortId() >= ARTNET_MAX_PORTS) { + OLA_WARN << "Invalid artnet port id " << PortId(); + return false; + } + + return m_helper.GetNode()->SendDMX(PortId(), buffer); + (void) priority; +} + + +/* + * Handle an RDMRequest + */ +bool ArtNetOutputPort::HandleRDMRequest(const ola::rdm::RDMRequest *request) { + // Discovery requests aren't proxied + bool ret = true; + if (request->CommandClass() != RDMCommand::DISCOVER_COMMAND) + ret = m_helper.GetNode()->SendRDMRequest(PortId(), request); + return ret; +} + + +/* + * Run the RDM discovery process + */ +void ArtNetOutputPort::RunRDMDiscovery() { + m_helper.GetNode()->ForceDiscovery(PortId()); +} + + +/* + * Set the RDM handlers as appropriate + */ +void ArtNetOutputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + m_helper.PostSetUniverse(new_universe, PortId()); + + if (new_universe && !old_universe) { + m_helper.GetNode()->SetInputPortRDMHandlers( + PortId(), + ola::NewCallback( + this, + &ArtNetOutputPort::NewUIDList), + ola::NewCallback( + this, + &ArtNetOutputPort::PolitelyHandleRDMResponse)); + } else if (!new_universe) { + m_helper.GetNode()->SetInputPortRDMHandlers(PortId(), NULL, NULL); + } + + if (new_universe) + m_helper.GetNode()->SendTodRequest(PortId()); +} + + +/* + * Handle a RDMResponse from the node + */ +void ArtNetOutputPort::PolitelyHandleRDMResponse(const RDMResponse *response) { + HandleRDMResponse(response); +} +} // artnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.h b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.h new file mode 100644 index 0000000..a24ae5e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/ArtNetPort.h @@ -0,0 +1,101 @@ +/* + * 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 Library 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. + * + * ArtnetPort.h + * The ArtNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ARTNET_ARTNETPORT_H_ +#define PLUGINS_ARTNET_ARTNETPORT_H_ + +#include +#include "olad/Port.h" +#include "plugins/artnet/ArtNetNode.h" +#include "plugins/artnet/ArtNetDevice.h" + +namespace ola { +namespace plugin { +namespace artnet { + +class ArtNetPortHelper { + public: + ArtNetPortHelper(ArtNetNode *node, bool is_output) + : m_is_output(is_output), + m_node(node) {} + + ArtNetNode *GetNode() const { return m_node; } + void PostSetUniverse(Universe *new_universe, unsigned int port_id); + string Description(const Universe *universe, unsigned int port_id) const; + + private: + bool m_is_output; + ArtNetNode *m_node; +}; + + +class ArtNetInputPort: public BasicInputPort { + public: + ArtNetInputPort(ArtNetDevice *parent, + unsigned int port_id, + const TimeStamp *wake_time, + ArtNetNode *node) + : BasicInputPort(parent, port_id, wake_time), + m_helper(node, false) {} + + const DmxBuffer &ReadDMX() const { return m_buffer; } + + bool HandleRDMResponse(const ola::rdm::RDMResponse *response); + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + void PolitelyHandleRDMRequest(const ola::rdm::RDMRequest *request); + void RespondWithTod(); + + string Description() const { + return m_helper.Description(GetUniverse(), PortId()); + } + + private: + DmxBuffer m_buffer; + ArtNetPortHelper m_helper; +}; + + +class ArtNetOutputPort: public BasicOutputPort { + public: + ArtNetOutputPort(ArtNetDevice *device, + unsigned int port_id, + ArtNetNode *node) + : BasicOutputPort(device, port_id), + m_helper(node, true) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + bool HandleRDMRequest(const ola::rdm::RDMRequest *request); + void RunRDMDiscovery(); + + void PolitelyHandleRDMResponse(const RDMResponse *response); + + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + + string Description() const { + return m_helper.Description(GetUniverse(), PortId()); + } + + private: + ArtNetPortHelper m_helper; +}; +} // artnet +} // plugin +} // ola +#endif // PLUGINS_ARTNET_ARTNETPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.am new file mode 100644 index 0000000..e1533cd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.am @@ -0,0 +1,10 @@ +include $(top_srcdir)/common.mk +libdir = $(plugindir) +SUBDIRS = messages +EXTRA_DIST = ArtNetDevice.h ArtNetNode.h ArtNetPackets.h ArtNetPlugin.h \ + ArtNetPort.h + +lib_LTLIBRARIES = libolaartnet.la +libolaartnet_la_SOURCES = ArtNetPlugin.cpp ArtNetDevice.cpp ArtNetNode.cpp \ + ArtNetPort.cpp +libolaartnet_la_LIBADD = messages/libolaartnetconf.la diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.in new file mode 100644 index 0000000..d8577b2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/Makefile.in @@ -0,0 +1,616 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/artnet +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolaartnet_la_DEPENDENCIES = messages/libolaartnetconf.la +am_libolaartnet_la_OBJECTS = ArtNetPlugin.lo ArtNetDevice.lo \ + ArtNetNode.lo ArtNetPort.lo +libolaartnet_la_OBJECTS = $(am_libolaartnet_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaartnet_la_SOURCES) +DIST_SOURCES = $(libolaartnet_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +SUBDIRS = messages +EXTRA_DIST = ArtNetDevice.h ArtNetNode.h ArtNetPackets.h ArtNetPlugin.h \ + ArtNetPort.h + +lib_LTLIBRARIES = libolaartnet.la +libolaartnet_la_SOURCES = ArtNetPlugin.cpp ArtNetDevice.cpp ArtNetNode.cpp \ + ArtNetPort.cpp + +libolaartnet_la_LIBADD = messages/libolaartnetconf.la +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/artnet/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/artnet/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaartnet.la: $(libolaartnet_la_OBJECTS) $(libolaartnet_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolaartnet_la_OBJECTS) $(libolaartnet_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtNetDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtNetNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtNetPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtNetPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/ArtnetConfigMessages.proto b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/ArtnetConfigMessages.proto new file mode 100644 index 0000000..8371949 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/ArtnetConfigMessages.proto @@ -0,0 +1,52 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ConfigMessages.proto + * Defines the protocol buffers used to configure the Artnet device + * Copyright (C) 2005 - 2008 Simon Newton + */ + +package ola.plugin.artnet; + +message OptionsRequest { + optional string short_name = 1; + optional string long_name = 2; + optional int32 subnet = 3; +} + +message OptionsReply { + required uint32 status = 1; + required string short_name = 2; + required string long_name = 3; + required int32 subnet = 4; +} + +message Request { + enum RequestType { + ARTNET_OPTIONS_REQUEST = 1; + } + + required RequestType type = 1; + optional OptionsRequest options = 2; +} + +message Reply { + enum ReplyType { + ARTNET_OPTIONS_REPLY = 1; + } + required ReplyType type = 1; + + optional OptionsReply options = 2; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.am new file mode 100644 index 0000000..d9d34de --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.am @@ -0,0 +1,19 @@ +include $(top_srcdir)/common.mk + +pkgincludedir = $(includedir)/ola/artnet +lib_LTLIBRARIES = libolaartnetconf.la +nodist_pkginclude_HEADERS = ArtnetConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolaartnetconf.pc + +BUILT_SOURCES = ArtnetConfigMessages.pb.cc ArtnetConfigMessages.pb.h + +nodist_libolaartnetconf_la_SOURCES = ArtnetConfigMessages.pb.cc + +EXTRA_DIST = ArtnetConfigMessages.proto + +ArtnetConfigMessages.pb.cc ArtnetConfigMessages.pb.h: ArtnetConfigMessages.proto + protoc --cpp_out ./ ArtnetConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.in new file mode 100644 index 0000000..3a4384a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/Makefile.in @@ -0,0 +1,553 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libolaartnetconf.pc.in $(top_srcdir)/common.mk +subdir = plugins/artnet/messages +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libolaartnetconf.pc +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolaartnetconf_la_LIBADD = +nodist_libolaartnetconf_la_OBJECTS = ArtnetConfigMessages.pb.lo +libolaartnetconf_la_OBJECTS = $(nodist_libolaartnetconf_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nodist_libolaartnetconf_la_SOURCES) +DIST_SOURCES = +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +nodist_pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(nodist_pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/artnet +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +lib_LTLIBRARIES = libolaartnetconf.la +nodist_pkginclude_HEADERS = ArtnetConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolaartnetconf.pc +BUILT_SOURCES = ArtnetConfigMessages.pb.cc ArtnetConfigMessages.pb.h +nodist_libolaartnetconf_la_SOURCES = ArtnetConfigMessages.pb.cc +EXTRA_DIST = ArtnetConfigMessages.proto +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/artnet/messages/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/artnet/messages/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +libolaartnetconf.pc: $(top_builddir)/config.status $(srcdir)/libolaartnetconf.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaartnetconf.la: $(libolaartnetconf_la_OBJECTS) $(libolaartnetconf_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolaartnetconf_la_OBJECTS) $(libolaartnetconf_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArtnetConfigMessages.pb.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(nodist_pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-nodist_pkgincludeHEADERS \ + install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ + install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + + +ArtnetConfigMessages.pb.cc ArtnetConfigMessages.pb.h: ArtnetConfigMessages.proto + protoc --cpp_out ./ ArtnetConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} +# 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/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/libolaartnetconf.pc.in b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/libolaartnetconf.pc.in new file mode 100644 index 0000000..4c1527c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/artnet/messages/libolaartnetconf.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libolaartnetconf +Version: @VERSION@ +Description: Open Lighting Architecture - Artnet Config Messages +Libs: -lprotobuf diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.cpp new file mode 100644 index 0000000..162d752 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.cpp @@ -0,0 +1,45 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxDevice.cpp + * Dmx4Linux device + * Copyright (C) 2006-2009 Simon Newton + * + */ +#include +#include "plugins/dmx4linux/Dmx4LinuxPlugin.h" +#include "plugins/dmx4linux/Dmx4LinuxDevice.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + +using ola::Device; + +/* + * Create a new device + * @param owner the plugin that owns this device + * @param name the device name + * @param device_id the device id + */ +Dmx4LinuxDevice::Dmx4LinuxDevice(Dmx4LinuxPlugin *owner, + const string &name, + const string &device_id): + Device(owner, name), + m_device_id(device_id) { +} +} // dmx4linux +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.h new file mode 100644 index 0000000..721b5eb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxDevice.h @@ -0,0 +1,44 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxDevice.h + * Interface for the dmx4linux device + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_DMX4LINUX_DMX4LINUXDEVICE_H_ +#define PLUGINS_DMX4LINUX_DMX4LINUXDEVICE_H_ + +#include +#include "olad/Device.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + +class Dmx4LinuxDevice: public ola::Device { + public: + Dmx4LinuxDevice(class Dmx4LinuxPlugin *owner, + const string &name, + const string &device_id); + string DeviceId() const { return m_device_id; } + + private: + string m_device_id; +}; +} // dmx4linux +} // plugin +} // ola +#endif // PLUGINS_DMX4LINUX_DMX4LINUXDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.cpp new file mode 100644 index 0000000..0c71cf8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.cpp @@ -0,0 +1,315 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxPlugin.cpp + * The Dmx4Linux plugin for ola + * Copyright (C) 2006-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" + +#include "plugins/dmx4linux/Dmx4LinuxDevice.h" +#include "plugins/dmx4linux/Dmx4LinuxPlugin.h" +#include "plugins/dmx4linux/Dmx4LinuxPort.h" +#include "plugins/dmx4linux/Dmx4LinuxSocket.h" + + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create( + const ola::PluginAdaptor *plugin_adaptor) { + return new ola::plugin::dmx4linux::Dmx4LinuxPlugin(plugin_adaptor); +} + +namespace ola { +namespace plugin { +namespace dmx4linux { + +const char Dmx4LinuxPlugin::DMX4LINUX_OUT_DEVICE[] = "/dev/dmx"; +const char Dmx4LinuxPlugin::DMX4LINUX_IN_DEVICE[] = "/dev/dmxin"; +const char Dmx4LinuxPlugin::IN_DEV_KEY[] = "in_device"; +const char Dmx4LinuxPlugin::OUT_DEV_KEY[] = "out_device"; +const char Dmx4LinuxPlugin::PLUGIN_NAME[] = "Dmx4Linux"; +const char Dmx4LinuxPlugin::PLUGIN_PREFIX[] = "dmx4linux"; + + +Dmx4LinuxPlugin::~Dmx4LinuxPlugin() { + CleanupSockets(); +} + + +/* + * Start the plugin + */ +bool Dmx4LinuxPlugin::StartHook() { + if (!SetupSockets()) + return false; + + if (!SetupDevices()) { + CleanupSockets(); + return false; + } + + if (m_devices.size() > 0) { + m_in_socket->SetOnData( + ola::NewClosure(this, &Dmx4LinuxPlugin::SocketReady)); + m_plugin_adaptor->AddSocket(m_in_socket); + return true; + } else { + CleanupSockets(); + return false; + } +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool Dmx4LinuxPlugin::StopHook() { + vector::iterator it; + m_plugin_adaptor->RemoveSocket(m_in_socket); + + for (it = m_devices.begin(); it != m_devices.end(); ++it) { + m_plugin_adaptor->UnregisterDevice(*it); + (*it)->Stop(); + delete *it; + } + CleanupSockets(); + m_devices.clear(); + m_in_ports.clear(); + return 0; +} + + +/* + * Return the description for this plugin + */ +string Dmx4LinuxPlugin::Description() const { + return +"DMX 4 Linux Plugin\n" +"----------------------------\n" +"\n" +"This plugin exposes DMX 4 Linux devices.\n" +"\n" +"--- Config file : ola-dmx4linux.conf ---\n" +"\n" +"in_device = /dev/dmxin\n" +"out_device = /dev/dmx\n"; +} + + +/* + * Called when there is input for us + */ +int Dmx4LinuxPlugin::SocketReady() { + vector::iterator iter; + unsigned int data_read, offset; + int ret; + + if (lseek(m_in_socket->ReadDescriptor(), 0, SEEK_SET) != 0) { + OLA_WARN << "failed to seek: " << strerror(errno); + return -1; + } + ret = m_in_socket->Receive(reinterpret_cast(m_in_buffer), + DMX_UNIVERSE_SIZE * m_in_devices_count, + data_read); + iter = m_in_ports.begin(); + offset = 0; + while (offset < data_read && iter != m_in_ports.end()) { + (*iter)->UpdateData(m_in_buffer + offset, data_read - offset); + iter++; + } + return 0; +} + + +/* + * load the plugin prefs and default to sensible values + */ +bool Dmx4LinuxPlugin::SetDefaultPreferences() { + bool save = false; + + if (!m_preferences) + return false; + + save |= m_preferences->SetDefaultValue(IN_DEV_KEY, StringValidator(), + DMX4LINUX_IN_DEVICE); + save |= m_preferences->SetDefaultValue(OUT_DEV_KEY, StringValidator(), + DMX4LINUX_OUT_DEVICE); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue(IN_DEV_KEY).empty() || + m_preferences->GetValue(OUT_DEV_KEY).empty()) + return false; + + m_in_dev = m_preferences->GetValue(IN_DEV_KEY); + m_out_dev = m_preferences->GetValue(OUT_DEV_KEY); + return true; +} + + +/* + * Open the input and output fds + */ +bool Dmx4LinuxPlugin::SetupSockets() { + if (!m_in_socket && !m_out_socket) { + int fd = open(m_out_dev.c_str(), O_WRONLY); + + if (fd < 0) { + OLA_WARN << "failed to open " << m_out_dev << " " << strerror(errno); + return false; + } + m_out_socket = new Dmx4LinuxSocket(fd); + + fd = open(m_in_dev.c_str(), O_RDONLY | O_NONBLOCK); + if (fd < 0) { + OLA_WARN << "failed to open " << m_in_dev << " " << strerror(errno); + CleanupSockets(); + return false; + } + m_in_socket = new Dmx4LinuxSocket(fd); + return true; + } + return false; +} + + +/* + * Close all fds + */ +int Dmx4LinuxPlugin::CleanupSockets() { + if (m_in_socket) { + delete m_in_socket; + m_in_socket = NULL; + } + + if (m_out_socket) { + delete m_out_socket; + m_out_socket = NULL; + } + + if (m_in_buffer) { + delete[] m_in_buffer; + m_in_buffer = NULL; + } + return 0; +} + + +/* + * setup a single device + * @param family the dmx4linux family + * @param d4l_uni the dmx4linux universe + * @param dir in|out + */ +bool Dmx4LinuxPlugin::SetupDevice(string family, int d4l_uni, int dir) { + string device_id = IntToString((d4l_uni << 1) + dir); + string name = string("dmx4linux_"); + name.append(family); + name.append(dir ? "_in_" : "_out_"); + name.append(IntToString(d4l_uni)); + + OLA_INFO << "Dmx4LinuxPlugin creates a device : name = " << name << + " / uni = " << d4l_uni << " / dir = " << dir; + Dmx4LinuxDevice *dev = new Dmx4LinuxDevice(this, name, device_id); + dev->Start(); + + if (dir == DMX_DIRECTION_INPUT) { + Dmx4LinuxInputPort *port = new Dmx4LinuxInputPort( + dev, + m_plugin_adaptor->WakeUpTime()); + m_in_ports.push_back(port); + dev->AddPort(port); + } else { + Dmx4LinuxOutputPort *port = new Dmx4LinuxOutputPort(dev, + m_out_socket, + d4l_uni); + dev->AddPort(port); + } + m_plugin_adaptor->RegisterDevice(dev); + m_devices.push_back(dev); + return true; +} + + +/* + * Find all the devices connected and setup ports for them. + */ +bool Dmx4LinuxPlugin::SetupDevices() { + struct dmx_capabilities cap; + struct dmx_info info; + + if (ioctl(m_in_socket->ReadDescriptor(), DMX_IOCTL_GET_INFO, &info) < 0) { + OLA_WARN << "failed to fetch universe list"; + return false; + } + + if (info.max_in_universes > 0) { + m_in_devices_count = info.max_in_universes; + try { + m_in_buffer = new uint8_t[DMX_UNIVERSE_SIZE * info.max_in_universes]; + } catch (std::bad_alloc& ex) { + m_in_buffer = NULL; + } + } + + for (int i = 0; i < info.max_in_universes; i++) { + cap.direction = DMX_DIRECTION_INPUT; + cap.universe = i; + + if (ioctl(m_in_socket->ReadDescriptor(), DMX_IOCTL_GET_CAP, &cap) >= 0) { + if (cap.maxSlots > 0) { + SetupDevice(cap.family, cap.universe, cap.direction); + } + } + } + + for (int i = 0; i < info.max_out_universes; i++) { + cap.direction = DMX_DIRECTION_OUTPUT; + cap.universe = i; + + if (ioctl(m_in_socket->ReadDescriptor(), DMX_IOCTL_GET_CAP, &cap) >= 0) { + if (cap.maxSlots > 0) { + SetupDevice(cap.family, cap.universe, cap.direction); + } + } + } + return true; +} +} // dmx4linux +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.h new file mode 100644 index 0000000..5526788 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPlugin.h @@ -0,0 +1,86 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxPlugin.h + * Interface for the dmx4linux plugin class + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_ +#define PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_ + +#include +#include +#include "ola/DmxBuffer.h" +#include "olad/Plugin.h" +#include "ola/network/Socket.h" +#include "ola/plugin_id.h" +#include "plugins/dmx4linux/Dmx4LinuxPort.h" +#include "plugins/dmx4linux/Dmx4LinuxSocket.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + +class Dmx4LinuxDevice; + +class Dmx4LinuxPlugin: public ola::Plugin { + public: + explicit Dmx4LinuxPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_in_socket(NULL), + m_out_socket(NULL), + m_in_devices_count(0), + m_in_buffer(NULL) {} + ~Dmx4LinuxPlugin(); + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_DMX4LINUX; } + + int SocketReady(); + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + bool SetupSockets(); + int CleanupSockets(); + bool SetupDevice(string family, int d4l_uni, int dir); + bool SetupDevices(); + + vector m_devices; // list of out devices + vector m_in_ports; // list of in ports + string m_out_dev; // path to the dmx output device + string m_in_dev; // path to the dmx input device + Dmx4LinuxSocket *m_in_socket; + Dmx4LinuxSocket *m_out_socket; + int m_in_devices_count; // number of input devices + uint8_t *m_in_buffer; // input buffer + + static const char DMX4LINUX_OUT_DEVICE[]; + static const char DMX4LINUX_IN_DEVICE[]; + static const char OUT_DEV_KEY[]; + static const char IN_DEV_KEY[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; +}; +} // dmx4linux +} // plugin +} // ola + +#endif // PLUGINS_DMX4LINUX_DMX4LINUXPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.cpp new file mode 100644 index 0000000..c6c937a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.cpp @@ -0,0 +1,80 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxPort.cpp + * The DMX 4 Linux plugin + * Copyright (C) 2006-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "plugins/dmx4linux/Dmx4LinuxPort.h" +#include "plugins/dmx4linux/Dmx4LinuxDevice.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + + +/* + * Write operation + * @param buffer the DmxBuffer to write + * @return true on success, false on failure + */ +bool Dmx4LinuxOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + int offset = DMX_UNIVERSE_SIZE * m_d4l_universe; + if (lseek(m_socket->WriteDescriptor(), offset, SEEK_SET) == offset) { + ssize_t r = m_socket->Send(buffer.GetRaw(), buffer.Size()); + if ((uint) r != buffer.Size()) { + OLA_WARN << "only wrote " << r << "/" << buffer.Size() << " bytes: " << + strerror(errno); + return false; + } + } else { + OLA_WARN << "failed to seek: " << strerror(errno); + return false; + } + return true; +} + + +/* + * Read operation + * @return a DmxBufer with the data + */ +const DmxBuffer &Dmx4LinuxInputPort::ReadDMX() const { + return m_read_buffer; +} + + +/* + * Process new Data + */ +bool Dmx4LinuxInputPort::UpdateData(const uint8_t *in_buffer, + unsigned int length) { + DmxBuffer tmp_buffer = DmxBuffer(in_buffer, length); + if (!(tmp_buffer == m_read_buffer)) { + m_read_buffer.Set(tmp_buffer); + DmxChanged(); + } + return true; +} +} // dmx4linux +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.h b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.h new file mode 100644 index 0000000..173f2b8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxPort.h @@ -0,0 +1,80 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxPort.h + * The Dmx4Linux plugin for ola + * Copyright (C) 2006-2008 Simon Newton + */ + +#ifndef PLUGINS_DMX4LINUX_DMX4LINUXPORT_H_ +#define PLUGINS_DMX4LINUX_DMX4LINUXPORT_H_ + +#include +#include "ola/BaseTypes.h" +#include "ola/DmxBuffer.h" +#include "plugins/dmx4linux/Dmx4LinuxDevice.h" +#include "plugins/dmx4linux/Dmx4LinuxSocket.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + + +/* + * A Dmx4Linux output port, we only have 1 port per device so the port id is + * always 0. + */ +class Dmx4LinuxOutputPort: public BasicOutputPort { + public: + Dmx4LinuxOutputPort(Dmx4LinuxDevice *parent, + Dmx4LinuxSocket *socket, + int d4l_universe) : + BasicOutputPort(parent, 0), + m_socket(socket), + m_d4l_universe(d4l_universe) { + } + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return ""; } + + private: + Dmx4LinuxSocket *m_socket; + int m_d4l_universe; // dmx4linux universe that this maps to +}; + + +/* + * A Dmx4Linux input port, we only have 1 port per device so the port id is + * always 0. + */ +class Dmx4LinuxInputPort: public BasicInputPort { + public: + explicit Dmx4LinuxInputPort(Dmx4LinuxDevice *parent, + const TimeStamp *wake_time): + BasicInputPort(parent, 0, wake_time) { + m_read_buffer.SetRangeToValue(0, 0, DMX_UNIVERSE_SIZE); + } + + const DmxBuffer &ReadDMX() const; + bool UpdateData(const uint8_t *in_buffer, unsigned int length); + string Description() const { return ""; } + + private: + DmxBuffer m_read_buffer; +}; +} // dmx4linux +} // plugin +} // ola +#endif // PLUGINS_DMX4LINUX_DMX4LINUXPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxSocket.h b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxSocket.h new file mode 100644 index 0000000..98ea352 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Dmx4LinuxSocket.h @@ -0,0 +1,40 @@ +/* + * 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 Library 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. + * + * Dmx4LinuxSocket.h + * Interface for the dmx4linux socket class + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_DMX4LINUX_DMX4LINUXSOCKET_H_ +#define PLUGINS_DMX4LINUX_DMX4LINUXSOCKET_H_ + +#include "ola/network/Socket.h" + +namespace ola { +namespace plugin { +namespace dmx4linux { + +class Dmx4LinuxSocket: public ola::network::DeviceSocket { + public: + explicit Dmx4LinuxSocket(int fd): ola::network::DeviceSocket(fd) {} + protected: + virtual bool IsClosed() const {return false;} +}; +} // dmx4linux +} // plugin +} // ola + +#endif // PLUGINS_DMX4LINUX_DMX4LINUXSOCKET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.am new file mode 100644 index 0000000..eabe8d2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/common.mk +libdir = $(plugindir) + +EXTRA_DIST = Dmx4LinuxPlugin.h Dmx4LinuxDevice.h Dmx4LinuxPort.h \ + Dmx4LinuxSocket.h + +if HAVE_DMX4LINUX + lib_LTLIBRARIES = liboladmx4linux.la + liboladmx4linux_la_SOURCES = Dmx4LinuxPlugin.cpp Dmx4LinuxDevice.cpp \ + Dmx4LinuxPort.cpp +endif diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.in new file mode 100644 index 0000000..c62b830 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dmx4linux/Makefile.in @@ -0,0 +1,503 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/dmx4linux +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +liboladmx4linux_la_LIBADD = +am__liboladmx4linux_la_SOURCES_DIST = Dmx4LinuxPlugin.cpp \ + Dmx4LinuxDevice.cpp Dmx4LinuxPort.cpp +@HAVE_DMX4LINUX_TRUE@am_liboladmx4linux_la_OBJECTS = \ +@HAVE_DMX4LINUX_TRUE@ Dmx4LinuxPlugin.lo Dmx4LinuxDevice.lo \ +@HAVE_DMX4LINUX_TRUE@ Dmx4LinuxPort.lo +liboladmx4linux_la_OBJECTS = $(am_liboladmx4linux_la_OBJECTS) +@HAVE_DMX4LINUX_TRUE@am_liboladmx4linux_la_rpath = -rpath $(libdir) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liboladmx4linux_la_SOURCES) +DIST_SOURCES = $(am__liboladmx4linux_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = Dmx4LinuxPlugin.h Dmx4LinuxDevice.h Dmx4LinuxPort.h \ + Dmx4LinuxSocket.h + +@HAVE_DMX4LINUX_TRUE@lib_LTLIBRARIES = liboladmx4linux.la +@HAVE_DMX4LINUX_TRUE@liboladmx4linux_la_SOURCES = Dmx4LinuxPlugin.cpp Dmx4LinuxDevice.cpp \ +@HAVE_DMX4LINUX_TRUE@ Dmx4LinuxPort.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dmx4linux/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/dmx4linux/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liboladmx4linux.la: $(liboladmx4linux_la_OBJECTS) $(liboladmx4linux_la_DEPENDENCIES) + $(CXXLINK) $(am_liboladmx4linux_la_rpath) $(liboladmx4linux_la_OBJECTS) $(liboladmx4linux_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dmx4LinuxDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dmx4LinuxPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dmx4LinuxPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.cpp new file mode 100644 index 0000000..b7dc600 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.cpp @@ -0,0 +1,48 @@ +/* + * 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 Library 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. + * + * DummyDevice.cpp + * A dummy device + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "plugins/dummy/DummyDevice.h" +#include "plugins/dummy/DummyPort.h" + +namespace ola { +namespace plugin { +namespace dummy { + + +/* + * Start this device + */ +bool DummyDevice::StartHook() { + DummyPort *port = new DummyPort(this, 0); + + if (!AddPort(port)) { + delete port; + return false; + } + return true; +} +} // dummy +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.h new file mode 100644 index 0000000..646782d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyDevice.h @@ -0,0 +1,48 @@ +/* + * 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 Library 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. + * + * DummyDevice.h + * Interface for the dummy device + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef PLUGINS_DUMMY_DUMMYDEVICE_H_ +#define PLUGINS_DUMMY_DUMMYDEVICE_H_ + +#include +#include "olad/Device.h" + +namespace ola { + +class AbstractPlugin; + +namespace plugin { +namespace dummy { + +using std::string; + +class DummyDevice: public Device { + public: + DummyDevice(AbstractPlugin *owner, const string &name): + Device(owner, name) {} + string DeviceId() const { return "1"; } + + protected: + bool StartHook(); +}; +} // dummy +} // plugin +} // ola +#endif // PLUGINS_DUMMY_DUMMYDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.cpp new file mode 100644 index 0000000..e5a49e0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.cpp @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * DummyPlugin.cpp + * The Dummy plugin for ola, contains a single dummy device + * Copyright (C) 2005-2007 Simon Newton + */ + +#include +#include +#include + +#include "olad/PluginAdaptor.h" +#include "plugins/dummy/DummyDevice.h" +#include "plugins/dummy/DummyPlugin.h" + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create( + const ola::PluginAdaptor *plugin_adaptor) { + return new ola::plugin::dummy::DummyPlugin(plugin_adaptor); +} + +namespace ola { +namespace plugin { +namespace dummy { + +using std::string; + +const char DummyPlugin::PLUGIN_NAME[] = "Dummy"; +const char DummyPlugin::PLUGIN_PREFIX[] = "dummy"; +const char DummyPlugin::DEVICE_NAME[] = "Dummy Device"; + +/* + * Start the plugin + * + * Lets keep it simple, one device for this plugin + */ +bool DummyPlugin::StartHook() { + m_device = new DummyDevice(this, DEVICE_NAME); + m_device->Start(); + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool DummyPlugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +string DummyPlugin::Description() const { + return +"Dummy Plugin\n" +"----------------------------\n" +"\n" +"The plugin creates a single device with one port. When used as an output\n" +"port it prints the first two bytes of dmx data to stdout.\n\n" +"It also creates a fake RDM device which can be querried and the DMX start\n" +"address can be changed.\n"; +} +} // dummy +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.h new file mode 100644 index 0000000..25f576f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPlugin.h @@ -0,0 +1,61 @@ +/* + * 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 Library 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. + * + * DummyPlugin.h + * Interface for the dummyplugin class + * Copyright (C) 2005-2007 Simon Newton + */ + +#ifndef PLUGINS_DUMMY_DUMMYPLUGIN_H_ +#define PLUGINS_DUMMY_DUMMYPLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace dummy { + +using ola::Plugin; +using ola::PluginAdaptor; + +class DummyDevice; + +class DummyPlugin: public Plugin { + public: + explicit DummyPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_device(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_DUMMY; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences() { return true; } + + DummyDevice *m_device; // the dummy device + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char DEVICE_NAME[]; +}; +} // dummy +} // plugin +} // ola +#endif // PLUGINS_DUMMY_DUMMYPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPluginTester.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPluginTester.cpp new file mode 100644 index 0000000..bff4185 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPluginTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * DummyPluginTester.cpp + * Runs tests for the dummy plugin + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.cpp new file mode 100644 index 0000000..495348b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.cpp @@ -0,0 +1,317 @@ +/* + * 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 Library 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. + * + * + * DummyPort.cpp + * The Dummy Port for ola + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "ola/rdm/RDMEnums.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/dummy/DummyPort.h" + +namespace ola { +namespace plugin { +namespace dummy { + +using ola::network::HostToNetwork; +using ola::network::NetworkToHost; +using ola::rdm::GetResponseWithData; +using ola::rdm::NackWithReason; +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; + +/* + * Write operation + * @param data pointer to the dmx data + * @param length the length of the data + */ +bool DummyPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + (void) priority; + m_buffer = buffer; + stringstream str; + string data = buffer.Get(); + + str << "Dummy port: got " << buffer.Size() << " bytes: "; + for (unsigned int i = 0; i < 10 && i < data.size(); i++) + str << "0x" << std::hex << 0 + (uint8_t) data.at(i) << " "; + OLA_INFO << str.str(); + return true; +} + + +/* + * This returns a single device + */ +void DummyPort::RunRDMDiscovery() { + ola::rdm::UID uid(OPEN_LIGHTING_ESTA_CODE, 0xffffff00); + ola::rdm::UIDSet uid_set; + uid_set.AddUID(uid); + NewUIDList(uid_set); +} + + +/* + * Handle an RDM Request + */ +bool DummyPort::HandleRDMRequest(const RDMRequest *request) { + switch (request->ParamId()) { + case ola::rdm::PID_SUPPORTED_PARAMETERS: + return HandleSupportedParams(request); + case ola::rdm::PID_DEVICE_INFO: + return HandleDeviceInfo(request); + case ola::rdm::PID_PRODUCT_DETAIL_ID_LIST: + return HandleProductDetailList(request); + case ola::rdm::PID_MANUFACTURER_LABEL: + return HandleStringResponse(request, "Open Lighting"); + case ola::rdm::PID_DEVICE_LABEL: + return HandleStringResponse(request, "Dummy RDM Device"); + case ola::rdm::PID_DEVICE_MODEL_DESCRIPTION: + return HandleStringResponse(request, "Dummy Model"); + case ola::rdm::PID_SOFTWARE_VERSION_LABEL: + return HandleStringResponse(request, "Dummy Software Version"); + case ola::rdm::PID_DMX_START_ADDRESS: + return HandleDmxStartAddress(request); + default: + return HandleUnknownPacket(request); + } +} + + +bool DummyPort::HandleUnknownPacket(const RDMRequest *request) { + // no responses for broadcasts + if (!request->DestinationUID().IsBroadcast()) { + RDMResponse *response = NackWithReason(request, ola::rdm::NR_UNKNOWN_PID); + HandleRDMResponse(response); + } + delete request; + return true; +} + + +bool DummyPort::HandleSupportedParams(const RDMRequest *request) { + if (request->DestinationUID().IsBroadcast()) { + delete request; + return true; + } + + RDMResponse *response; + if (request->CommandClass() == ola::rdm::RDMCommand::SET_COMMAND) { + response = NackWithReason(request, ola::rdm::NR_UNSUPPORTED_COMMAND_CLASS); + } else if (request->SubDevice()) { + response = NackWithReason(request, ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + } else if (request->ParamDataSize()) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + uint16_t supported_params[] = { + ola::rdm::PID_SUPPORTED_PARAMETERS, + ola::rdm::PID_DEVICE_INFO, + ola::rdm::PID_PRODUCT_DETAIL_ID_LIST, + ola::rdm::PID_DEVICE_MODEL_DESCRIPTION, + ola::rdm::PID_MANUFACTURER_LABEL, + ola::rdm::PID_DEVICE_LABEL, + ola::rdm::PID_SOFTWARE_VERSION_LABEL, + ola::rdm::PID_DMX_START_ADDRESS + }; + + for (unsigned int i = 0; i < sizeof(supported_params) / 2; i++) + supported_params[i] = HostToNetwork(supported_params[i]); + + response = GetResponseWithData( + request, + reinterpret_cast(supported_params), + sizeof(supported_params)); + } + HandleRDMResponse(response); + delete request; + return true; +} + + +bool DummyPort::HandleDeviceInfo(const RDMRequest *request) { + if (request->DestinationUID().IsBroadcast()) { + delete request; + return true; + } + + RDMResponse *response; + if (request->CommandClass() == ola::rdm::RDMCommand::SET_COMMAND) { + response = NackWithReason(request, ola::rdm::NR_UNSUPPORTED_COMMAND_CLASS); + } else if (request->SubDevice()) { + response = NackWithReason(request, ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + } else if (request->ParamDataSize()) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + struct device_info_s { + uint16_t rdm_version; + uint16_t model; + uint16_t product_category; + uint32_t software_version; + uint16_t dmx_footprint; + uint8_t current_personality; + uint8_t personality_count; + uint16_t dmx_start_address; + uint16_t sub_device_count; + uint8_t sensor_count; + } __attribute__((packed)); + + struct device_info_s device_info; + device_info.rdm_version = HostToNetwork(static_cast(0x100)); + device_info.model = HostToNetwork(static_cast(1)); + device_info.product_category = HostToNetwork( + static_cast(ola::rdm::PRODUCT_CATEGORY_OTHER)); + device_info.software_version = HostToNetwork(static_cast(1)); + device_info.dmx_footprint = + HostToNetwork(static_cast(DUMMY_DMX_FOOTPRINT)); + device_info.current_personality = 1; + device_info.personality_count = 1; + device_info.dmx_start_address = HostToNetwork(m_start_address); + device_info.sub_device_count = 0; + device_info.sensor_count = 0; + response = GetResponseWithData(request, + reinterpret_cast(&device_info), + sizeof(device_info)); + } + HandleRDMResponse(response); + delete request; + return true; +} + + +/** + * Handle a request for PID_PRODUCT_DETAIL_ID_LIST + */ +bool DummyPort::HandleProductDetailList(const RDMRequest *request) { + if (request->DestinationUID().IsBroadcast()) { + delete request; + return true; + } + + RDMResponse *response; + if (request->CommandClass() == ola::rdm::RDMCommand::SET_COMMAND) { + response = NackWithReason(request, ola::rdm::NR_UNSUPPORTED_COMMAND_CLASS); + } else if (request->SubDevice()) { + response = NackWithReason(request, ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + } else if (request->ParamDataSize()) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + uint16_t product_details[] = { + ola::rdm::PRODUCT_DETAIL_TEST, + ola::rdm::PRODUCT_DETAIL_OTHER + }; + + for (unsigned int i = 0; i < sizeof(product_details) / 2; i++) + product_details[i] = HostToNetwork(product_details[i]); + + response = GetResponseWithData( + request, + reinterpret_cast(&product_details), + sizeof(product_details)); + } + HandleRDMResponse(response); + delete request; + return true; +} + + +/* + * Handle a request that returns a string + */ +bool DummyPort::HandleStringResponse(const ola::rdm::RDMRequest *request, + const string &value) { + if (request->DestinationUID().IsBroadcast()) { + delete request; + return true; + } + + RDMResponse *response; + if (request->CommandClass() == ola::rdm::RDMCommand::SET_COMMAND) { + response = NackWithReason(request, ola::rdm::NR_UNSUPPORTED_COMMAND_CLASS); + } else if (request->SubDevice()) { + response = NackWithReason(request, ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + } else if (request->ParamDataSize()) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + response = GetResponseWithData( + request, + reinterpret_cast(value.data()), + value.size()); + } + HandleRDMResponse(response); + delete request; + return true; +} + + +/* + * Handle getting/setting the dmx start address + */ +bool DummyPort::HandleDmxStartAddress(const RDMRequest *request) { + RDMResponse *response; + if (request->SubDevice()) { + response = NackWithReason(request, ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + } else if (request->CommandClass() == ola::rdm::RDMCommand::SET_COMMAND) { + // do set + if (request->ParamDataSize() != sizeof(m_start_address)) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + uint16_t address = + NetworkToHost(*(reinterpret_cast(request->ParamData()))); + if (address == 0 || address > DMX_UNIVERSE_SIZE - DUMMY_DMX_FOOTPRINT) { + response = NackWithReason(request, ola::rdm::NR_DATA_OUT_OF_RANGE); + } else { + m_start_address = address; + response = new ola::rdm::RDMSetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + ola::rdm::ACK, + 0, + request->SubDevice(), + request->ParamId(), + NULL, + 0); + } + } + } else { + if (request->ParamDataSize()) { + response = NackWithReason(request, ola::rdm::NR_FORMAT_ERROR); + } else { + uint16_t address = HostToNetwork(m_start_address); + response = GetResponseWithData( + request, + reinterpret_cast(&address), + sizeof(address)); + } + } + if (request->DestinationUID().IsBroadcast()) { + delete response; + } else { + HandleRDMResponse(response); + } + delete request; + return true; +} +} // dummy +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.h b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.h new file mode 100644 index 0000000..4f874fa --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPort.h @@ -0,0 +1,62 @@ +/* + * 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 Library 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. + * + * DummyPort_h + * The interface to the Dummy port + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_DUMMY_DUMMYPORT_H_ +#define PLUGINS_DUMMY_DUMMYPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "ola/rdm/RDMEnums.h" +#include "olad/Port.h" +#include "plugins/dummy/DummyDevice.h" + +namespace ola { +namespace plugin { +namespace dummy { + +class DummyPort: public BasicOutputPort { + public: + DummyPort(DummyDevice *parent, unsigned int id): + BasicOutputPort(parent, id, true), + m_start_address(1) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return "Dummy Port"; } + void RunRDMDiscovery(); + bool HandleRDMRequest(const ola::rdm::RDMRequest *request); + + private: + bool HandleUnknownPacket(const ola::rdm::RDMRequest *request); + bool HandleSupportedParams(const ola::rdm::RDMRequest *request); + bool HandleDeviceInfo(const ola::rdm::RDMRequest *request); + bool HandleProductDetailList(const ola::rdm::RDMRequest *request); + bool HandleStringResponse(const ola::rdm::RDMRequest *request, + const string &value); + bool HandleDmxStartAddress(const ola::rdm::RDMRequest *request); + + uint16_t m_start_address; + DmxBuffer m_buffer; + + static const uint16_t DUMMY_DMX_FOOTPRINT = 10; +}; +} // dummy +} // plugin +} // ola +#endif // PLUGINS_DUMMY_DUMMYPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPortTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPortTest.cpp new file mode 100644 index 0000000..7c21493 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/DummyPortTest.cpp @@ -0,0 +1,484 @@ +/* + * 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 Library 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. + * + * DummyPortTest.cpp + * Test fixture for the E131PDU class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/dummy/DummyPort.h" // NOLINT, this has to be first +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/RDMAPI.h" +#include "ola/rdm/RDMCommand.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" + +namespace ola { +namespace plugin { +namespace dummy { + +using ola::network::HostToNetwork; +using ola::rdm::RDMGetRequest; +using ola::rdm::RDMGetResponse; +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; +using ola::rdm::RDMSetRequest; +using ola::rdm::RDMSetResponse; +using ola::rdm::UID; +using ola::rdm::UIDSet; + +class MockDummyPort: public DummyPort { + public: + MockDummyPort(): + DummyPort(NULL, 0), + m_expected_response(NULL) { + } + + bool HandleRDMResponse(const RDMResponse *response); + void NewUIDList(const UIDSet &uids) { + m_uid_set = uids; + } + + const UIDSet &GetUIDSet() const { return m_uid_set; } + void SetExpectedResponse(const RDMResponse *response); + private: + UIDSet m_uid_set; + const RDMResponse *m_expected_response; +}; + + +class DummyPortTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DummyPortTest); + CPPUNIT_TEST(testRDMDiscovery); + CPPUNIT_TEST(testUnknownPid); + CPPUNIT_TEST(testSupportedParams); + CPPUNIT_TEST(testDeviceInfo); + CPPUNIT_TEST(testSoftwareVersion); + CPPUNIT_TEST(testDmxAddress); + CPPUNIT_TEST_SUITE_END(); + + public: + DummyPortTest(): + TestFixture(), + m_expected_uid(0x7a70, 0xffffff00), + m_test_source(1, 2) { + } + + void testRDMDiscovery(); + void testUnknownPid(); + void testSupportedParams(); + void testDeviceInfo(); + void testSoftwareVersion(); + void testDmxAddress(); + + private: + UID m_expected_uid; + UID m_test_source; + MockDummyPort m_port; + + void checkSubDeviceOutOfRange(ola::rdm::rdm_pid pid); + void checkMalformedRequest(ola::rdm::rdm_pid pid); + void checkSetRequest(ola::rdm::rdm_pid pid); + void checkNoBroadcastResponse(ola::rdm::rdm_pid pid); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(DummyPortTest); + + +bool MockDummyPort::HandleRDMResponse(const ola::rdm::RDMResponse *response) { + CPPUNIT_ASSERT(m_expected_response); + CPPUNIT_ASSERT(*m_expected_response == *response); + delete response; + delete m_expected_response; + m_expected_response = NULL; + return true; +} + +void MockDummyPort::SetExpectedResponse(const RDMResponse *response) { + CPPUNIT_ASSERT(!m_expected_response); + m_expected_response = response; +} + + +/* + * Check that RDM discovery works + */ +void DummyPortTest::testRDMDiscovery() { + MockDummyPort port; + const UIDSet &uids = port.GetUIDSet(); + CPPUNIT_ASSERT_EQUAL(static_cast(0), uids.Size()); + port.RunRDMDiscovery(); + CPPUNIT_ASSERT_EQUAL(static_cast(1), uids.Size()); + CPPUNIT_ASSERT(uids.Contains(m_expected_uid)); +} + + +/* + * Check that unknown pids fail + */ +void DummyPortTest::testUnknownPid() { + UID source(1, 2); + MockDummyPort port; + + RDMRequest *request = new RDMGetRequest( + source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_COMMS_STATUS, // param id + NULL, // data + 0); // data length + + RDMResponse *response = NackWithReason( + request, + ola::rdm::NR_UNKNOWN_PID); + + port.SetExpectedResponse(response); + CPPUNIT_ASSERT(port.HandleRDMRequest(request)); +} + + +/* + * Check that the supported params command work + */ +void DummyPortTest::testSupportedParams() { + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_SUPPORTED_PARAMETERS, // param id + NULL, // data + 0); // data length + + uint16_t supported_params[] = { + ola::rdm::PID_SUPPORTED_PARAMETERS, + ola::rdm::PID_DEVICE_INFO, + ola::rdm::PID_PRODUCT_DETAIL_ID_LIST, + ola::rdm::PID_DEVICE_MODEL_DESCRIPTION, + ola::rdm::PID_MANUFACTURER_LABEL, + ola::rdm::PID_DEVICE_LABEL, + ola::rdm::PID_SOFTWARE_VERSION_LABEL, + ola::rdm::PID_DMX_START_ADDRESS + }; + + for (unsigned int i = 0; i < sizeof(supported_params) / 2; i++) + supported_params[i] = HostToNetwork(supported_params[i]); + + RDMResponse *response = GetResponseWithData( + request, + reinterpret_cast(&supported_params), + sizeof(supported_params)); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + checkSubDeviceOutOfRange(ola::rdm::PID_SUPPORTED_PARAMETERS); + checkMalformedRequest(ola::rdm::PID_SUPPORTED_PARAMETERS); + checkSetRequest(ola::rdm::PID_SUPPORTED_PARAMETERS); + checkNoBroadcastResponse(ola::rdm::PID_SUPPORTED_PARAMETERS); +} + + +/* + * Check that the device info command works + */ +void DummyPortTest::testDeviceInfo() { + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_DEVICE_INFO, // param id + NULL, // data + 0); // data length + + ola::rdm::DeviceDescriptor device_descriptor; + device_descriptor.protocol_version_high = 1; + device_descriptor.protocol_version_low = 0; + device_descriptor.device_model = HostToNetwork(static_cast(1)); + device_descriptor.product_category = HostToNetwork( + static_cast(ola::rdm::PRODUCT_CATEGORY_OTHER)); + device_descriptor.software_version = HostToNetwork(static_cast(1)); + device_descriptor.dmx_footprint = + HostToNetwork(static_cast(10)); + device_descriptor.current_personality = 1; + device_descriptor.personaility_count = 1; + device_descriptor.dmx_start_address = + HostToNetwork(static_cast(1)); + device_descriptor.sub_device_count = 0; + device_descriptor.sensor_count = 0; + + RDMResponse *response = GetResponseWithData( + request, + reinterpret_cast(&device_descriptor), + sizeof(device_descriptor)); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + checkSubDeviceOutOfRange(ola::rdm::PID_DEVICE_INFO); + checkMalformedRequest(ola::rdm::PID_DEVICE_INFO); + checkSetRequest(ola::rdm::PID_DEVICE_INFO); + checkNoBroadcastResponse(ola::rdm::PID_DEVICE_INFO); +} + + +/* + * Check that the software version command works + */ +void DummyPortTest::testSoftwareVersion() { + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_SOFTWARE_VERSION_LABEL, // param id + NULL, // data + 0); // data length + + const string version = "Dummy Software Version"; + RDMResponse *response = GetResponseWithData( + request, + reinterpret_cast(version.data()), + version.size()); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + checkSubDeviceOutOfRange(ola::rdm::PID_SOFTWARE_VERSION_LABEL); + checkMalformedRequest(ola::rdm::PID_SOFTWARE_VERSION_LABEL); + checkSetRequest(ola::rdm::PID_SOFTWARE_VERSION_LABEL); + checkNoBroadcastResponse(ola::rdm::PID_SOFTWARE_VERSION_LABEL); +} + + +/* + * Check that the dmx address command works + */ +void DummyPortTest::testDmxAddress() { + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_DMX_START_ADDRESS, // param id + NULL, // data + 0); // data length + + uint16_t dmx_address = HostToNetwork(static_cast(1)); + RDMResponse *response = GetResponseWithData( + request, + reinterpret_cast(&dmx_address), + sizeof(dmx_address)); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + // now attempt to set it + dmx_address = HostToNetwork(static_cast(99)); + request = new RDMSetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 2, // message count + 0, // sub device + ola::rdm::PID_DMX_START_ADDRESS, // param id + reinterpret_cast(&dmx_address), + sizeof(dmx_address)); + + response = GetResponseWithData(request, NULL, 0); + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + // now check it updated + request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_DMX_START_ADDRESS, // param id + NULL, // data + 0); // data length + + dmx_address = HostToNetwork(static_cast(99)); + response = GetResponseWithData( + request, + reinterpret_cast(&dmx_address), + sizeof(dmx_address)); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + // check that broadcasting changes the address + dmx_address = HostToNetwork(static_cast(48)); + UID broadcast_uid = UID::AllManufactureDevices(OPEN_LIGHTING_ESTA_CODE); + request = new RDMSetRequest( + m_test_source, + broadcast_uid, + 0, // transaction # + 1, // port id + 3, // message count + 0, // sub device + ola::rdm::PID_DMX_START_ADDRESS, // param id + reinterpret_cast(&dmx_address), + sizeof(dmx_address)); + + // no response expected + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + // now check it updated + request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + ola::rdm::PID_DMX_START_ADDRESS, // param id + NULL, // data + 0); // data length + + dmx_address = HostToNetwork(static_cast(48)); + response = GetResponseWithData( + request, + reinterpret_cast(&dmx_address), + sizeof(dmx_address)); + + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + checkSubDeviceOutOfRange(ola::rdm::PID_DMX_START_ADDRESS); + checkMalformedRequest(ola::rdm::PID_DMX_START_ADDRESS); + checkNoBroadcastResponse(ola::rdm::PID_DMX_START_ADDRESS); +} + + +void DummyPortTest::checkSubDeviceOutOfRange(ola::rdm::rdm_pid pid) { + // a request with a non-0 subdevice + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 1, // sub device + pid, + NULL, // data + 0); // data length + + RDMResponse *response = NackWithReason( + request, + ola::rdm::NR_SUB_DEVICE_OUT_OF_RANGE); + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); +} + + +void DummyPortTest::checkMalformedRequest(ola::rdm::rdm_pid pid) { + // a malformed request + uint16_t bad_data = 0; + RDMRequest *request = new RDMGetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + pid, + reinterpret_cast(&bad_data), // data + sizeof(bad_data)); // data length + + RDMResponse *response = NackWithReason( + request, + ola::rdm::NR_FORMAT_ERROR); + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); +} + + +void DummyPortTest::checkSetRequest(ola::rdm::rdm_pid pid) { + // a set request + RDMRequest *request = new RDMSetRequest( + m_test_source, + m_expected_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + pid, + NULL, // data + 0); // data length + + RDMResponse *response = NackWithReason( + request, + ola::rdm::NR_UNSUPPORTED_COMMAND_CLASS); + m_port.SetExpectedResponse(response); + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); +} + + +void DummyPortTest::checkNoBroadcastResponse(ola::rdm::rdm_pid pid) { + // a broadcast request + UID broadcast_uid = UID::AllDevices(); + RDMRequest *request = new RDMGetRequest( + m_test_source, + broadcast_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + pid, // param id + NULL, // data + 0); // data length + + // we don't expect any response to this + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); + + broadcast_uid = UID::AllManufactureDevices(OPEN_LIGHTING_ESTA_CODE); + request = new RDMGetRequest( + m_test_source, + broadcast_uid, + 0, // transaction # + 1, // port id + 0, // message count + 0, // sub device + pid, // param id + NULL, // data + 0); // data length + + // we don't expect any response to this + CPPUNIT_ASSERT(m_port.HandleRDMRequest(request)); +} +} // dummy +} // ola +} // plugin diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.am new file mode 100644 index 0000000..11c5330 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.am @@ -0,0 +1,18 @@ +include $(top_srcdir)/common.mk +libdir = $(plugindir) + +EXTRA_DIST = DummyPlugin.h DummyDevice.h DummyPort.h + +lib_LTLIBRARIES = liboladummy.la +liboladummy_la_SOURCES = DummyPlugin.cpp DummyDevice.cpp DummyPort.cpp +liboladummy_la_LIBADD = @LIBS@ + +TESTS = DummyPluginTester +check_PROGRAMS = $(TESTS) +DummyPluginTester_SOURCES = DummyPluginTester.cpp DummyPortTest.cpp +DummyPluginTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +DummyPluginTester_LDFLAGS = $(CPPUNIT_LIBS) -ldl -lprotobuf +DummyPluginTester_LDADD = @LIBS@ \ + ./liboladummy.la \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la diff --git a/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.in new file mode 100644 index 0000000..5450682 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/dummy/Makefile.in @@ -0,0 +1,633 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = DummyPluginTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = plugins/dummy +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +liboladummy_la_DEPENDENCIES = +am_liboladummy_la_OBJECTS = DummyPlugin.lo DummyDevice.lo DummyPort.lo +liboladummy_la_OBJECTS = $(am_liboladummy_la_OBJECTS) +am__EXEEXT_1 = DummyPluginTester$(EXEEXT) +am_DummyPluginTester_OBJECTS = \ + DummyPluginTester-DummyPluginTester.$(OBJEXT) \ + DummyPluginTester-DummyPortTest.$(OBJEXT) +DummyPluginTester_OBJECTS = $(am_DummyPluginTester_OBJECTS) +DummyPluginTester_DEPENDENCIES = ./liboladummy.la \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la +DummyPluginTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) \ + $(DummyPluginTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(liboladummy_la_SOURCES) $(DummyPluginTester_SOURCES) +DIST_SOURCES = $(liboladummy_la_SOURCES) $(DummyPluginTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = DummyPlugin.h DummyDevice.h DummyPort.h +lib_LTLIBRARIES = liboladummy.la +liboladummy_la_SOURCES = DummyPlugin.cpp DummyDevice.cpp DummyPort.cpp +liboladummy_la_LIBADD = @LIBS@ +DummyPluginTester_SOURCES = DummyPluginTester.cpp DummyPortTest.cpp +DummyPluginTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +DummyPluginTester_LDFLAGS = $(CPPUNIT_LIBS) -ldl -lprotobuf +DummyPluginTester_LDADD = @LIBS@ \ + ./liboladummy.la \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/olad/libolaserver.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/dummy/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/dummy/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +liboladummy.la: $(liboladummy_la_OBJECTS) $(liboladummy_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(liboladummy_la_OBJECTS) $(liboladummy_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +DummyPluginTester$(EXEEXT): $(DummyPluginTester_OBJECTS) $(DummyPluginTester_DEPENDENCIES) + @rm -f DummyPluginTester$(EXEEXT) + $(DummyPluginTester_LINK) $(DummyPluginTester_OBJECTS) $(DummyPluginTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyPluginTester-DummyPluginTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyPluginTester-DummyPortTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DummyPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +DummyPluginTester-DummyPluginTester.o: DummyPluginTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -MT DummyPluginTester-DummyPluginTester.o -MD -MP -MF $(DEPDIR)/DummyPluginTester-DummyPluginTester.Tpo -c -o DummyPluginTester-DummyPluginTester.o `test -f 'DummyPluginTester.cpp' || echo '$(srcdir)/'`DummyPluginTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/DummyPluginTester-DummyPluginTester.Tpo $(DEPDIR)/DummyPluginTester-DummyPluginTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DummyPluginTester.cpp' object='DummyPluginTester-DummyPluginTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -c -o DummyPluginTester-DummyPluginTester.o `test -f 'DummyPluginTester.cpp' || echo '$(srcdir)/'`DummyPluginTester.cpp + +DummyPluginTester-DummyPluginTester.obj: DummyPluginTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -MT DummyPluginTester-DummyPluginTester.obj -MD -MP -MF $(DEPDIR)/DummyPluginTester-DummyPluginTester.Tpo -c -o DummyPluginTester-DummyPluginTester.obj `if test -f 'DummyPluginTester.cpp'; then $(CYGPATH_W) 'DummyPluginTester.cpp'; else $(CYGPATH_W) '$(srcdir)/DummyPluginTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/DummyPluginTester-DummyPluginTester.Tpo $(DEPDIR)/DummyPluginTester-DummyPluginTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DummyPluginTester.cpp' object='DummyPluginTester-DummyPluginTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -c -o DummyPluginTester-DummyPluginTester.obj `if test -f 'DummyPluginTester.cpp'; then $(CYGPATH_W) 'DummyPluginTester.cpp'; else $(CYGPATH_W) '$(srcdir)/DummyPluginTester.cpp'; fi` + +DummyPluginTester-DummyPortTest.o: DummyPortTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -MT DummyPluginTester-DummyPortTest.o -MD -MP -MF $(DEPDIR)/DummyPluginTester-DummyPortTest.Tpo -c -o DummyPluginTester-DummyPortTest.o `test -f 'DummyPortTest.cpp' || echo '$(srcdir)/'`DummyPortTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/DummyPluginTester-DummyPortTest.Tpo $(DEPDIR)/DummyPluginTester-DummyPortTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DummyPortTest.cpp' object='DummyPluginTester-DummyPortTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -c -o DummyPluginTester-DummyPortTest.o `test -f 'DummyPortTest.cpp' || echo '$(srcdir)/'`DummyPortTest.cpp + +DummyPluginTester-DummyPortTest.obj: DummyPortTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -MT DummyPluginTester-DummyPortTest.obj -MD -MP -MF $(DEPDIR)/DummyPluginTester-DummyPortTest.Tpo -c -o DummyPluginTester-DummyPortTest.obj `if test -f 'DummyPortTest.cpp'; then $(CYGPATH_W) 'DummyPortTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DummyPortTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/DummyPluginTester-DummyPortTest.Tpo $(DEPDIR)/DummyPluginTester-DummyPortTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DummyPortTest.cpp' object='DummyPluginTester-DummyPortTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(DummyPluginTester_CXXFLAGS) $(CXXFLAGS) -c -o DummyPluginTester-DummyPortTest.obj `if test -f 'DummyPortTest.cpp'; then $(CYGPATH_W) 'DummyPortTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DummyPortTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.cpp new file mode 100644 index 0000000..2d9cce9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.cpp @@ -0,0 +1,220 @@ +/* + * 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 Library 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. + * + * E131Device.cpp + * An E1.31 device + * Copyright (C) 2007-2009 Simon Newton + * + * Ids 0-3 : Input ports (recv dmx) + * Ids 4-7 : Output ports (send dmx) + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/e131/E131Device.h" +#include "plugins/e131/E131Port.h" +#include "plugins/e131/e131/E131Node.h" + +namespace ola { +namespace plugin { +namespace e131 { + +const char E131Device::DEVICE_NAME[] = "E1.31 (DMX over ACN)"; + +/* + * Create a new device + */ +E131Device::E131Device(Plugin *owner, + const ola::plugin::e131::CID &cid, + std::string ip_addr, + const PluginAdaptor *plugin_adaptor, + bool use_rev2, + bool prepend_hostname, + bool ignore_preview, + uint8_t dscp) + : Device(owner, DEVICE_NAME), + m_plugin_adaptor(plugin_adaptor), + m_node(NULL), + m_use_rev2(use_rev2), + m_prepend_hostname(prepend_hostname), + m_ignore_preview(ignore_preview), + m_dscp(dscp), + m_ip_addr(ip_addr), + m_cid(cid) { +} + + +/* + * Start this device + */ +bool E131Device::StartHook() { + m_node = new E131Node(m_ip_addr, m_cid, m_use_rev2, m_ignore_preview, + m_dscp); + + if (!m_node->Start()) { + delete m_node; + m_node = NULL; + DeleteAllPorts(); + return false; + } + + stringstream str; + str << DEVICE_NAME << " [" << + ola::network::AddressToString(m_node->GetInterface().ip_address) << "]"; + SetName(str.str()); + + for (unsigned int i = 0; i < NUMBER_OF_E131_PORTS; i++) { + E131InputPort *input_port = new E131InputPort( + this, + i, + m_node, + m_plugin_adaptor->WakeUpTime()); + AddPort(input_port); + E131OutputPort *output_port = new E131OutputPort(this, + i, + m_node, + m_prepend_hostname); + AddPort(output_port); + } + + m_plugin_adaptor->AddSocket(m_node->GetSocket()); + return true; +} + + +/* + * Stop this device + */ +void E131Device::PrePortStop() { + m_plugin_adaptor->RemoveSocket(m_node->GetSocket()); +} + + +/* + * Stop this device + */ +void E131Device::PostPortStop() { + m_node->Stop(); + delete m_node; + m_node = NULL; +} + + +/* + * Handle device config messages + * @param controller An RpcController + * @param request the request data + * @param response the response to return + * @param done the closure to call once the request is complete + */ +void E131Device::Configure(RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done) { + Request request_pb; + if (!request_pb.ParseFromString(request)) { + controller->SetFailed("Invalid Request"); + done->Run(); + return; + } + + switch (request_pb.type()) { + case ola::plugin::e131::Request::E131_PORT_INFO: + HandlePortStatusRequest(response); + break; + case ola::plugin::e131::Request::E131_PREVIEW_MODE: + HandlePreviewMode(&request_pb, response); + break; + default: + controller->SetFailed("Invalid Request"); + } + done->Run(); +} + + +/* + * Handle an preview mode request. + */ +void E131Device::HandlePreviewMode(Request *request, string *response) { + if (request->has_preview_mode()) { + const ola::plugin::e131::PreviewModeRequest preview_request = + request->preview_mode(); + + unsigned int port_id = preview_request.port_id(); + bool preview_mode = preview_request.preview_mode(); + + if (preview_request.input_port()) { + InputPort *port = GetInputPort(port_id); + if (port) { + E131InputPort *e131_port = reinterpret_cast(port); + // TODO(simon): figure out what to do here + (void) e131_port; + // e131_port->SetPreviewMode(preview_mode); + } + } else { + OutputPort *port = GetOutputPort(port_id); + if (port) { + E131OutputPort *e131_port = reinterpret_cast(port); + e131_port->SetPreviewMode(preview_mode); + } + } + } + HandlePortStatusRequest(response); +} + + +/* + * Handle an options request + */ +void E131Device::HandlePortStatusRequest(string *response) { + ola::plugin::e131::Reply reply; + reply.set_type(ola::plugin::e131::Reply::E131_PORT_INFO); + ola::plugin::e131::PortInfoReply *port_reply = reply.mutable_port_info(); + + vector input_ports; + vector output_ports; + InputPorts(&input_ports); + OutputPorts(&output_ports); + + for (unsigned int i = 0; i < input_ports.size(); i++) { + ola::plugin::e131::InputPortInfo *input_port = + port_reply->add_input_port(); + input_port->set_port_id(i); + input_port->set_preview_mode(m_ignore_preview); + } + + for (unsigned int i = 0; i < output_ports.size(); i++) { + ola::plugin::e131::OutputPortInfo *output_port = + port_reply->add_output_port(); + output_port->set_port_id(i); + E131OutputPort *e131_port = + reinterpret_cast(output_ports[i]); + output_port->set_preview_mode(e131_port->PreviewMode()); + } + reply.SerializeToString(response); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.h new file mode 100644 index 0000000..3590504 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Device.h @@ -0,0 +1,79 @@ +/* + * 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 Library 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. + * + * E131Device.h + * Interface for the E1.31 device + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131DEVICE_H_ +#define PLUGINS_E131_E131DEVICE_H_ + +#include +#include "olad/Device.h" +#include "olad/Plugin.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/messages/E131ConfigMessages.pb.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using google::protobuf::RpcController; +using ola::Plugin; +using ola::plugin::e131::Request; + +class E131Device: public ola::Device { + public: + E131Device(Plugin *owner, + const ola::plugin::e131::CID &cid, + std::string ip_addr, + const class PluginAdaptor *plugin_adaptor, + bool use_rev2, + bool prepend_hostname, + bool ignore_preview, + uint8_t dscp); + + string DeviceId() const { return "1"; } + + void Configure(RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done); + protected: + bool StartHook(); + void PrePortStop(); + void PostPortStop(); + + private: + const class PluginAdaptor *m_plugin_adaptor; + class E131Node *m_node; + bool m_use_rev2; + bool m_prepend_hostname; + bool m_ignore_preview; + uint8_t m_dscp; + std::string m_ip_addr; + ola::plugin::e131::CID m_cid; + + void HandlePreviewMode(Request *request, string *response); + void HandlePortStatusRequest(string *response); + + static const char DEVICE_NAME[]; + static const unsigned int NUMBER_OF_E131_PORTS = 5; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131DEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.cpp new file mode 100644 index 0000000..4ed8b84 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.cpp @@ -0,0 +1,206 @@ +/* + * 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 Library 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. + * + * E131Plugin.cpp + * The E1.31 plugin for ola + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/e131/E131Device.h" +#include "plugins/e131/E131Plugin.h" +#include "plugins/e131/e131/CID.h" + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create(const ola::PluginAdaptor *adaptor) { + return new ola::plugin::e131::E131Plugin(adaptor); +} + +namespace ola { +namespace plugin { +namespace e131 { + +const char E131Plugin::CID_KEY[] = "cid"; +const char E131Plugin::DSCP_KEY[] = "dscp"; +const char E131Plugin::IGNORE_PREVIEW_DATA_KEY[] = "ignore_preview"; +const char E131Plugin::IP_KEY[] = "ip"; +const char E131Plugin::PLUGIN_NAME[] = "E1.31 (sACN)"; +const char E131Plugin::PLUGIN_PREFIX[] = "e131"; +const char E131Plugin::PREPEND_HOSTNAME_KEY[] = "prepend_hostname"; +const char E131Plugin::REVISION_0_2[] = "0.2"; +const char E131Plugin::REVISION_0_46[] = "0.46"; +const char E131Plugin::REVISION_KEY[] = "revision"; +const char E131Plugin::DEFAULT_DSCP_VALUE[] = "0"; + + +/* + * Start the plugin + */ +bool E131Plugin::StartHook() { + CID cid = CID::FromString(m_preferences->GetValue(CID_KEY)); + string ip_addr = m_preferences->GetValue(IP_KEY); + string revision = m_preferences->GetValue(REVISION_KEY); + bool use_rev2 = revision == REVISION_0_2 ? true : false; + bool prepend_hostname = m_preferences->GetValueAsBool(PREPEND_HOSTNAME_KEY); + bool ignore_preview = m_preferences->GetValueAsBool(IGNORE_PREVIEW_DATA_KEY); + unsigned int dscp; + if (!StringToUInt(m_preferences->GetValue(DSCP_KEY), &dscp)) { + OLA_WARN << "Can't convert dscp value " << + m_preferences->GetValue(DSCP_KEY) << " to int"; + dscp = 0; + } else { + // shift 2 bits left + dscp = dscp << 2; + } + + m_device = new E131Device(this, + cid, + ip_addr, + m_plugin_adaptor, + use_rev2, + prepend_hostname, + ignore_preview, + dscp); + + if (!m_device->Start()) { + delete m_device; + return false; + } + + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool E131Plugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin + */ +string E131Plugin::Description() const { + return +"E1.31 (Streaming DMX over ACN) Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with eight input and eight output ports.\n" +"\n" +"Each port can be assigned to a diffent E1.31 Universe.\n" +"\n" +"--- Config file : ola-e131.conf ---\n" +"\n" +"cid = 00010203-0405-0607-0809-0A0B0C0D0E0F\n" +"The CID to use for this device\n" +"\n" +"dscp = [int]\n" +"The DSCP value to tag the packets with, range is 0 to 63.\n" +"\n" +"ignore_preview = [true|false]\n" +"Ignore preview data.\n" +"\n" +"ip = a.b.c.d\n" +"The local ip address to use for multicasting.\n" +"\n" +"prepend_hostname = [true|false]\n" +"Prepend the hostname to the source name when sending packets.\n" +"\n" +"revision = [0.2|0.46]\n" +"Select which revision of the standard to use when sending data. 0.2 is the\n" +" standardized revision, 0.46 (default) is the ANSI standard version.\n" +"\n"; +} + + +/* + * Load the plugin prefs and default to sensible values + * + */ +bool E131Plugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + + CID cid = CID::FromString(m_preferences->GetValue(CID_KEY)); + if (cid.IsNil()) { + cid = CID::Generate(); + m_preferences->SetValue(CID_KEY, cid.ToString()); + save = true; + } + + save |= m_preferences->SetDefaultValue( + DSCP_KEY, + IntValidator(0, 63), + DEFAULT_DSCP_VALUE); + + save |= m_preferences->SetDefaultValue( + IGNORE_PREVIEW_DATA_KEY, + BoolValidator(), + BoolValidator::TRUE); + + save |= m_preferences->SetDefaultValue(IP_KEY, IPv4Validator(), ""); + + save |= m_preferences->SetDefaultValue( + PREPEND_HOSTNAME_KEY, + BoolValidator(), + BoolValidator::TRUE); + + set revision_values; + revision_values.insert(REVISION_0_2); + revision_values.insert(REVISION_0_46); + + save |= m_preferences->SetDefaultValue( + REVISION_KEY, + SetValidator(revision_values), + REVISION_0_46); + + if (save) + m_preferences->Save(); + + // check if this saved correctly + // we don't want to use it if null + string revision = m_preferences->GetValue(REVISION_KEY); + if (m_preferences->GetValue(CID_KEY).empty() || + (revision != REVISION_0_2 && revision != REVISION_0_46)) + return false; + + return true; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.h new file mode 100644 index 0000000..7a2ab93 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Plugin.h @@ -0,0 +1,65 @@ +/* + * 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 Library 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. + * + * E131Plugin.h + * Interface for the E1.131 plugin class + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131PLUGIN_H_ +#define PLUGINS_E131_E131PLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class E131Plugin: public ola::Plugin { + public: + explicit E131Plugin(const ola::PluginAdaptor *plugin_adaptor): + ola::Plugin(plugin_adaptor), + m_device(NULL) {} + ~E131Plugin() {} + + string Name() const { return PLUGIN_NAME; } + ola_plugin_id Id() const { return OLA_PLUGIN_E131; } + string Description() const; + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + class E131Device *m_device; + static const char CID_KEY[]; + static const char DSCP_KEY[]; + static const char IGNORE_PREVIEW_DATA_KEY[]; + static const char IP_KEY[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char PREPEND_HOSTNAME_KEY[]; + static const char REVISION_0_2[]; + static const char REVISION_0_46[]; + static const char REVISION_KEY[]; + static const char DEFAULT_DSCP_VALUE[]; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131PLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.cpp new file mode 100644 index 0000000..22be3d9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.cpp @@ -0,0 +1,119 @@ +/* + * 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 Library 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. + * + * E131Port.cpp + * The E1.31 plugin for ola + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/Universe.h" +#include "plugins/e131/E131Port.h" +#include "plugins/e131/E131Device.h" + + +namespace ola { +namespace plugin { +namespace e131 { + + +bool E131PortHelper::PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (new_universe && (new_universe->UniverseId() == 0 || + new_universe->UniverseId() > MAX_E131_UNIVERSE)) { + OLA_WARN << "Universe id " << new_universe->UniverseId() << " is 0 or > " + << MAX_E131_UNIVERSE; + return false; + } + (void) old_universe; + return true; +} + + +string E131PortHelper::Description(Universe *universe) const { + std::stringstream str; + if (universe) + str << "E1.31 Universe " << universe->UniverseId(); + return str.str(); +} + + + +/* + * Set the universe for an input port. + */ +void E131InputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (old_universe) + m_node->RemoveHandler(old_universe->UniverseId()); + + if (new_universe) + m_node->SetHandler( + new_universe->UniverseId(), + &m_buffer, + &m_priority, + NewClosure(this, &E131InputPort::DmxChanged)); +} + + +/* + * Set the universe for an output port. + */ +void E131OutputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (new_universe) { + if (m_prepend_hostname) { + std::stringstream str; + str << ola::network::Hostname() << "-" << new_universe->Name(); + m_node->SetSourceName(new_universe->UniverseId(), str.str()); + } else { + m_node->SetSourceName(new_universe->UniverseId(), new_universe->Name()); + } + } else { + m_node->SetSourceName(old_universe->UniverseId(), ""); + } +} + + +/* + * Write data to this port. + */ +bool E131OutputPort::WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + Universe *universe = GetUniverse(); + if (!universe) + return false; + + if (GetPriorityMode() == PRIORITY_MODE_OVERRIDE) + priority = GetPriority(); + + return m_node->SendDMX(universe->UniverseId(), + buffer, + priority, + m_preview_on); +} + + +/* + * Update the universe name + */ +void E131OutputPort::UniverseNameChanged(const string &new_name) { + m_node->SetSourceName(GetUniverse()->UniverseId(), new_name); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.h new file mode 100644 index 0000000..6113b49 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/E131Port.h @@ -0,0 +1,101 @@ +/* + * 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 Library 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. + * + * E131Port.h + * The E1.31 port for OLA + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131PORT_H_ +#define PLUGINS_E131_E131PORT_H_ + +#include +#include "olad/Port.h" +#include "plugins/e131/E131Device.h" +#include "plugins/e131/e131/E131Node.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::DmxBuffer; + + +class E131PortHelper { + public: + bool PreSetUniverse(Universe *old_universe, Universe *new_universe); + string Description(Universe *universe) const; + private: + static const unsigned int MAX_E131_UNIVERSE = 63999; +}; + + +class E131InputPort: public BasicInputPort { + public: + E131InputPort(E131Device *parent, int id, E131Node *node, + const TimeStamp *wake_time) + : BasicInputPort(parent, id, wake_time), + m_node(node) {} + + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(old_universe, new_universe); + } + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + string Description() const { return m_helper.Description(GetUniverse()); } + const DmxBuffer &ReadDMX() const { return m_buffer; } + bool SupportsPriorities() const { return true; } + uint8_t InheritedPriority() const { return m_priority; } + + private: + DmxBuffer m_buffer; + E131Node *m_node; + E131PortHelper m_helper; + uint8_t m_priority; +}; + + +class E131OutputPort: public BasicOutputPort { + public: + E131OutputPort(E131Device *parent, int id, E131Node *node, + bool prepend_hostname) + : BasicOutputPort(parent, id), + m_prepend_hostname(prepend_hostname), + m_preview_on(false), + m_node(node) {} + + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(old_universe, new_universe); + } + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + string Description() const { return m_helper.Description(GetUniverse()); } + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + void UniverseNameChanged(const string &new_name); + + void SetPreviewMode(bool preview_mode) { m_preview_on = preview_mode; } + bool PreviewMode() const { return m_preview_on; } + bool SupportsPriorities() const { return true; } + + private: + bool m_prepend_hostname; + bool m_preview_on; + DmxBuffer m_buffer; + E131Node *m_node; + E131PortHelper m_helper; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131PORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.am new file mode 100644 index 0000000..5912954 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.am @@ -0,0 +1,12 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) +SUBDIRS = e131 messages +EXTRA_DIST = E131Plugin.h E131Device.h E131Port.h + +lib_LTLIBRARIES = libolae131.la +libolae131_la_SOURCES = E131Plugin.cpp E131Device.cpp E131Port.cpp +libolae131_la_LIBADD = @LIBS@ $(UUID_LIBS) $(OSSP_UUID_LIBS) \ + messages/libolae131conf.la \ + e131/libolae131core.la +libolae131_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.in new file mode 100644 index 0000000..4c9dc3a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/Makefile.in @@ -0,0 +1,639 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/e131 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libolae131_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) messages/libolae131conf.la \ + e131/libolae131core.la +am_libolae131_la_OBJECTS = libolae131_la-E131Plugin.lo \ + libolae131_la-E131Device.lo libolae131_la-E131Port.lo +libolae131_la_OBJECTS = $(am_libolae131_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolae131_la_SOURCES) +DIST_SOURCES = $(libolae131_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +SUBDIRS = e131 messages +EXTRA_DIST = E131Plugin.h E131Device.h E131Port.h +lib_LTLIBRARIES = libolae131.la +libolae131_la_SOURCES = E131Plugin.cpp E131Device.cpp E131Port.cpp +libolae131_la_LIBADD = @LIBS@ $(UUID_LIBS) $(OSSP_UUID_LIBS) \ + messages/libolae131conf.la \ + e131/libolae131core.la + +libolae131_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/e131/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/e131/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolae131.la: $(libolae131_la_OBJECTS) $(libolae131_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolae131_la_OBJECTS) $(libolae131_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131_la-E131Device.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131_la-E131Plugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131_la-E131Port.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libolae131_la-E131Plugin.lo: E131Plugin.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131_la-E131Plugin.lo -MD -MP -MF $(DEPDIR)/libolae131_la-E131Plugin.Tpo -c -o libolae131_la-E131Plugin.lo `test -f 'E131Plugin.cpp' || echo '$(srcdir)/'`E131Plugin.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131_la-E131Plugin.Tpo $(DEPDIR)/libolae131_la-E131Plugin.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Plugin.cpp' object='libolae131_la-E131Plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131_la-E131Plugin.lo `test -f 'E131Plugin.cpp' || echo '$(srcdir)/'`E131Plugin.cpp + +libolae131_la-E131Device.lo: E131Device.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131_la-E131Device.lo -MD -MP -MF $(DEPDIR)/libolae131_la-E131Device.Tpo -c -o libolae131_la-E131Device.lo `test -f 'E131Device.cpp' || echo '$(srcdir)/'`E131Device.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131_la-E131Device.Tpo $(DEPDIR)/libolae131_la-E131Device.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Device.cpp' object='libolae131_la-E131Device.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131_la-E131Device.lo `test -f 'E131Device.cpp' || echo '$(srcdir)/'`E131Device.cpp + +libolae131_la-E131Port.lo: E131Port.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131_la-E131Port.lo -MD -MP -MF $(DEPDIR)/libolae131_la-E131Port.Tpo -c -o libolae131_la-E131Port.lo `test -f 'E131Port.cpp' || echo '$(srcdir)/'`E131Port.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131_la-E131Port.Tpo $(DEPDIR)/libolae131_la-E131Port.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Port.cpp' object='libolae131_la-E131Port.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131_la-E131Port.lo `test -f 'E131Port.cpp' || echo '$(srcdir)/'`E131Port.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.cpp new file mode 100644 index 0000000..338519e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.cpp @@ -0,0 +1,283 @@ +/* + * 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 Library 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. + * + * BaseInflator.cpp + * The BaseInflator, other Inflators inherit from this one. + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/BaseInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +/* + * Setup the base inflator + */ +BaseInflator::BaseInflator(PDU::vector_size v_size) + : m_last_vector(0), + m_vector_set(false), + m_vector_size(v_size) { +} + + +/* + * Set the inflator for a particular protocol + * @param inflator a inflator + * @return true if added, false if an inflator with this id already exists. + */ +bool BaseInflator::AddInflator(BaseInflator *inflator) { + if (m_proto_map.find(inflator->Id()) == m_proto_map.end()) { + m_proto_map[inflator->Id()] = inflator; + return true; + } + return false; +} + + +/* + * Get the current inflator for a protocol + * @param proto the proto ID + * @return the inflator for this protocol, or NULL if there isn't one set. + */ +BaseInflator *BaseInflator::GetInflator(uint32_t proto) const { + std::map::const_iterator iter; + iter = m_proto_map.find(proto); + if (iter == m_proto_map.end()) + return NULL; + return iter->second; +} + + +/* + * Parse a block of PDUs + * @param headers the HeaderSet for this PDU + * @param data pointer to the data + * @param length length of the data + * @returns the amount of data used + */ +int BaseInflator::InflatePDUBlock(HeaderSet &headers, + const uint8_t *data, + unsigned int length) { + unsigned int offset = 0; + ResetPDUFields(); + + if (length == 0) + return 0; + + do { + unsigned int bytes_used = 0; + unsigned int pdu_length = 0; + if (!DecodeLength(data + offset, length - offset, pdu_length, bytes_used)) + return offset; + + if (offset + pdu_length <= length) { + InflatePDU(headers, data[offset], data + offset + bytes_used, + pdu_length - bytes_used); + } + offset += pdu_length; + } while (offset < length); + return std::min(offset, length); +} + + +/* + * Reset the pdu fields + */ +void BaseInflator::ResetPDUFields() { + m_vector_set = false; + ResetHeaderField(); +} + + +/* + * Fetch the length from a pdu header + * @param data pointer to the head of the PDU + * @param length length of the PDU data + * @param pdu_length set to the length of the PDU + * @param bytes_used set to the number of bytes used for the length field + * @return true if everything worked, false if invalid data was found + */ +bool BaseInflator::DecodeLength(const uint8_t *data, + unsigned int length, + unsigned int &pdu_length, + unsigned int &bytes_used) const { + uint8_t flags = data[0]; + if (!length) { + bytes_used = 0; + pdu_length = 0; + return false; + } + + if (flags & LFLAG_MASK) { + if (length < 3) { + OLA_WARN << "PDU length " << length << " < 3 and the LENGTH bit is set"; + return false; + } + bytes_used = 3; + pdu_length = (data[2] + (data[1] << 8) + ((data[0] & LENGTH_MASK) << 16)); + } else { + if (length < 2) { + OLA_WARN << "PDU length " << length << " < 2"; + return false; + } + bytes_used = 2; + pdu_length = data[1] + ((data[0] & LENGTH_MASK) << 8); + } + if (pdu_length < bytes_used) { + OLA_WARN << "PDU length was set to " << pdu_length << " but " << bytes_used + << " bytes were used in the header"; + bytes_used = 0; + return false; + } + return true; +} + + +/* + * Decode the vector field + * @param flags the PDU flags + * @param data pointer to the pdu data + * @param length length of the data + * @param vector the result of the vector + * @param bytes_used the number of bytes consumed + */ +bool BaseInflator::DecodeVector(uint8_t flags, const uint8_t *data, + unsigned int length, uint32_t &vector, + unsigned int &bytes_used) { + if (flags & PDU::VFLAG_MASK) { + if ((unsigned int) m_vector_size > length) { + vector = 0; + bytes_used = 0; + return false; + } + + switch (m_vector_size) { + case PDU::ONE_BYTE: + vector = *data; + break; + case PDU::TWO_BYTES: + vector = data[1] + (data[0] << 8); + break; + case PDU::FOUR_BYTES: + // careful: we can't cast to a uint32 because this isn't word aligned + vector = data[3] + (data[2] << 8) + (data[1] << 16) + (data[0] << 24); + break; + default: + OLA_WARN << "unknown vector size " << m_vector_size; + return false; + } + m_vector_set = true; + bytes_used = m_vector_size; + m_last_vector = vector; + } else { + bytes_used = 0; + if (m_vector_set) { + vector = m_last_vector; + } else { + vector = 0; + bytes_used = 0; + OLA_WARN << "Vector not set and no field to inherit from"; + return false; + } + } + return true; +} + + +/* + * Parse a generic PDU structure + * @param headers a reference to the header set + * @param flags the flag field + * @param data pointer to the vector field + * @param pdu_len length of the PDU + * @return true if we inflated without errors + */ +bool BaseInflator::InflatePDU(HeaderSet &headers, + uint8_t flags, + const uint8_t *data, + unsigned int pdu_len) { + uint32_t vector; + unsigned int data_offset, header_bytes_used; + bool result; + + if (!DecodeVector(flags, data, pdu_len, vector, data_offset)) + return false; + + if (flags & PDU::HFLAG_MASK) { + result = DecodeHeader(headers, data + data_offset, + pdu_len - data_offset, + header_bytes_used); + } else { + result = DecodeHeader(headers, NULL, 0, header_bytes_used); + header_bytes_used = 0; + } + if (!result) + return false; + + if (!PostHeader(vector, headers)) + return true; + + // TODO(simon): handle the crazy DFLAG here + + data_offset += header_bytes_used; + BaseInflator *inflator = GetInflator(vector); + if (inflator) { + return inflator->InflatePDUBlock(headers, data + data_offset, + pdu_len - data_offset); + } else { + return HandlePDUData(vector, headers, data + data_offset, + pdu_len - data_offset); + } +} + + +/* + * The Post header hook. This is called once the header has been decoded but + * before either the next inflator or handle_data is called. + * @return false will cease processing this PDU + */ +bool BaseInflator::PostHeader(uint32_t vector, HeaderSet &headers) { + (void) vector; + (void) headers; + return true; +} + + +/* + * The base handle data method - does nothing + */ +bool BaseInflator::HandlePDUData(uint32_t vector, + HeaderSet &headers, + const uint8_t *data, + unsigned int pdu_length) { + OLA_WARN << "In BaseInflator::HandlePDUData, someone forgot to add" << + " a handler, vector id " << vector; + (void) headers; + (void) data; + (void) pdu_length; + return false; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.h new file mode 100644 index 0000000..d17c8cc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflator.h @@ -0,0 +1,125 @@ +/* + * 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 Library 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. + * + * BaseInflator.h + * Provides the base class for inflating PDU blocks. + * Copyright (C) 2007-2009 Simon Newton + * + * The BaseInflator takes care of most of the heavy lifting when inflating PDU + * blocks. To create a specific Inflator, subclass BaseInflator and implement + * the Id() and DecodeHeader() methods. + */ + +#ifndef PLUGINS_E131_E131_BASEINFLATOR_H_ +#define PLUGINS_E131_E131_BASEINFLATOR_H_ + +#include +#include +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class BaseInflatorTest; + + +/* + * An abstract PDU inflator + */ +class BaseInflator { + friend class BaseInflatorTest; + + public: + explicit BaseInflator(PDU::vector_size v_size = PDU::FOUR_BYTES); + virtual ~BaseInflator() {} + + /* + * Add another inflator as a handler + */ + bool AddInflator(class BaseInflator *inflator); + /* + * Return the inflator used for a particular protocol + */ + class BaseInflator *GetInflator(uint32_t proto) const; + + /* + * Return the id for this inflator + */ + virtual uint32_t Id() const = 0; + + /* + * Parse a block of PDU data + */ + virtual int InflatePDUBlock(HeaderSet &headers, + const uint8_t *data, + unsigned int len); + + // masks for the flag fields + // This indicates a 20 bit length field (default is 12 bits) + static const uint8_t LFLAG_MASK = 0x80; + // This masks the first 4 bits of the length field + static const uint8_t LENGTH_MASK = 0x0F; + + protected: + uint32_t m_last_vector; + bool m_vector_set; + PDU::vector_size m_vector_size; // size of the vector field + // map protos to inflators + std::map m_proto_map; + + // Reset repeated pdu fields + virtual void ResetPDUFields(); + virtual void ResetHeaderField() = 0; + + // determine the length of a pdu + bool DecodeLength(const uint8_t *data, + unsigned int data_length, + unsigned int &pdu_length, + unsigned int &bytes_used) const; + + // determine the vector of a pdu + bool DecodeVector(uint8_t flags, + const uint8_t *data, + unsigned int length, + uint32_t &vector, + unsigned int &bytes_used); + + // Decode a header block and adds any PduHeaders to the HeaderSet object + virtual bool DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int len, + unsigned int &bytes_used) = 0; + + // parse the body of a pdu + bool InflatePDU(HeaderSet &headers, + uint8_t flags, + const uint8_t *data, + unsigned int pdu_len); + + // called after the header is parsed + virtual bool PostHeader(uint32_t vector, HeaderSet &headers); + + // called in the absence of a parse to handle the pdu data + virtual bool HandlePDUData(uint32_t vector, + HeaderSet &headers, + const uint8_t *data, + unsigned int pdu_len); +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_BASEINFLATOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflatorTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflatorTest.cpp new file mode 100644 index 0000000..10597cd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/BaseInflatorTest.cpp @@ -0,0 +1,382 @@ +/* + * 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 Library 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. + * + * BaseInflatorTest.cpp + * Test fixture for the BaseInflator class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include + +#include "plugins/e131/e131/BaseInflator.h" +#include "plugins/e131/e131/HeaderSet.h" + +namespace ola { +namespace plugin { +namespace e131 { + +uint8_t PDU_DATA[] = "this is some test data"; + +class BaseInflatorTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(BaseInflatorTest); + CPPUNIT_TEST(testChildInflators); + CPPUNIT_TEST(testDecodeLength); + CPPUNIT_TEST(testDecodeVector); + CPPUNIT_TEST(testInflatePDU); + CPPUNIT_TEST(testInflatePDUBlock); + CPPUNIT_TEST_SUITE_END(); + + public: + void testChildInflators(); + void testDecodeLength(); + void testDecodeVector(); + void testInflatePDU(); + void testInflatePDUBlock(); + private: +}; + + +class TestInflator: public ola::plugin::e131::BaseInflator { + public: + TestInflator(unsigned int id = 0, PDU::vector_size v_size = PDU::TWO_BYTES) + : BaseInflator(v_size), + m_id(id), + m_blocks_handled(0) {} + uint32_t Id() const { return m_id; } + unsigned int BlocksHandled() const { return m_blocks_handled; } + + protected: + void ResetHeaderField() {} + bool DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + bytes_used = 0; + return true; + (void) headers; + (void) data; + (void) length; + } + + bool HandlePDUData(uint32_t vector, HeaderSet &headers, + const uint8_t *data, unsigned int pdu_length) { + CPPUNIT_ASSERT_EQUAL((uint32_t) 289, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(PDU_DATA), pdu_length); + CPPUNIT_ASSERT(!memcmp(data, PDU_DATA, pdu_length)); + m_blocks_handled++; + return true; + (void) headers; + } + + private: + unsigned int m_id; + unsigned int m_blocks_handled; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(BaseInflatorTest); + + +/* + * Test that we can setup the child inflators correctly + */ +void BaseInflatorTest::testChildInflators() { + TestInflator inflator; + TestInflator inflator1(1); + TestInflator inflator2(2); + + CPPUNIT_ASSERT_EQUAL((uint32_t) 1, inflator1.Id()); + CPPUNIT_ASSERT_EQUAL((uint32_t) 2, inflator2.Id()); + CPPUNIT_ASSERT(inflator.AddInflator(&inflator1)); + CPPUNIT_ASSERT(inflator.AddInflator(&inflator2)); + + CPPUNIT_ASSERT(&inflator1 == inflator.GetInflator(inflator1.Id())); + CPPUNIT_ASSERT(&inflator2 == inflator.GetInflator(inflator2.Id())); + CPPUNIT_ASSERT(NULL == inflator.GetInflator(3)); + + // Once an inflator is set it can't be changed. + CPPUNIT_ASSERT(!inflator.AddInflator(&inflator1)); + CPPUNIT_ASSERT(!inflator.AddInflator(&inflator2)); +} + + +/* + * Test that DecodeLength works + */ +void BaseInflatorTest::testDecodeLength() { + TestInflator inflator; + uint8_t data[] = {0, 0, 0, 0}; // the test data + unsigned int pdu_length; + unsigned int bytes_used = 0; + + // with the length data set to 0, any length should fail. + for (unsigned int i = 0; i <= sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // Set the length of the pdu to 1, note that as the length includes the + // size of the length, vector & header fields, this is less than the number + // of bytes required to determine the length and so it fails + data[1] = 1; + for (unsigned int i = 0; i <= sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // now set the length to 2, a data length of 0 or 1 should fail, but anything + // more than that should return correctly. + data[1] = 2; + for (unsigned int i = 0; i <= 1; i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + for (unsigned int i = 2; i <= sizeof(data) ; i++) { + CPPUNIT_ASSERT(inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, pdu_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, bytes_used); + } + + // now check that both bytes are used + data[0] = 1; // total length of 258 + CPPUNIT_ASSERT(inflator.DecodeLength(data, sizeof(data), pdu_length, + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 258, pdu_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, bytes_used); + + // now check that the extend length format works + data[0] = BaseInflator::LFLAG_MASK; + + // with the length data set to 0, any length should fail. + data[1] = 0; + for (unsigned int i = 0; i <= sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // Set the length of the pdu to 1, note that as the length includes the + // size of the length, vector & header fields, this is less than the number + // of bytes required to determine the length and so it fails + data[2] = 1; + for (unsigned int i = 0; i <= sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // now set the length to 3, a data length of 0, 1 or 2 should fail, but + // anything more than that should return correctly. + data[2] = 3; + for (unsigned int i = 0; i <= 2; i++) { + CPPUNIT_ASSERT(!inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + for (unsigned int i = 3; i <= sizeof(data) ; i++) { + CPPUNIT_ASSERT(inflator.DecodeLength(data, i, pdu_length, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 3, pdu_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) 3, bytes_used); + } + + // now check that all 3 bytes are used + data[0] = BaseInflator::LFLAG_MASK + 1; + data[1] = 0x01; + CPPUNIT_ASSERT(inflator.DecodeLength(data, sizeof(data), pdu_length, + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 65795, pdu_length); + CPPUNIT_ASSERT_EQUAL((unsigned int) 3, bytes_used); +} + + +/* + * test that DecodeVector works + */ +void BaseInflatorTest::testDecodeVector() { + TestInflator inflator(0, PDU::ONE_BYTE); + uint8_t data[] = {1, 2, 3, 4, 5, 6}; // the test data + unsigned int vector = 1; + unsigned int bytes_used = 0; + uint8_t flags = PDU::VFLAG_MASK; + + CPPUNIT_ASSERT(!inflator.DecodeVector(flags, data, 0, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + data[0] = 42; + for (unsigned int i = 1; i < sizeof(data); i++) { + CPPUNIT_ASSERT(inflator.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, bytes_used); + } + + // now make sure we can reuse the vector + flags = 0; + for (unsigned int i = 0; i < sizeof(data); i++) { + CPPUNIT_ASSERT(inflator.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // resetting doesn't allow us to reuse the vector + inflator.ResetPDUFields(); + for (unsigned int i = 0; i < sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // now try with a vector size of 2 + flags = PDU::VFLAG_MASK; + TestInflator inflator2(0, PDU::TWO_BYTES); + for (unsigned int i = 0; i < 2; i++) { + CPPUNIT_ASSERT(!inflator2.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + data[0] = 0x80; + data[1] = 0x21; + for (unsigned int i = 2; i < sizeof(data); i++) { + CPPUNIT_ASSERT(inflator2.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 32801, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, bytes_used); + } + + // now make sure we can reuse the vector + flags = 0; + for (unsigned int i = 0; i < sizeof(data); i++) { + CPPUNIT_ASSERT(inflator2.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 32801, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // resetting doesn't allow us to reuse the vector + inflator2.ResetPDUFields(); + for (unsigned int i = 0; i < sizeof(data); i++) { + CPPUNIT_ASSERT(!inflator2.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + // now try with a vector size of 4 + flags = PDU::VFLAG_MASK; + TestInflator inflator4(0, PDU::FOUR_BYTES); + for (unsigned int i = 0; i < 4; i++) { + CPPUNIT_ASSERT(!inflator4.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + } + + data[0] = 0x01; + data[1] = 0x21; + data[2] = 0x32; + data[3] = 0x45; + for (unsigned int i = 4; i < 8; i++) { + CPPUNIT_ASSERT(inflator4.DecodeVector(flags, data, i, vector, bytes_used)); + CPPUNIT_ASSERT_EQUAL((uint32_t) 18952773, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, bytes_used); + } +} + + +/* + * Check that we can inflate a PDU + */ +void BaseInflatorTest::testInflatePDU() { + TestInflator inflator; // test with a vector size of 2 + HeaderSet header_set; + uint8_t flags = PDU::VFLAG_MASK; + unsigned int data_size = PDU::TWO_BYTES + sizeof(PDU_DATA); + uint8_t *data = new uint8_t[data_size]; + // setup the vector + data[0] = 0x01; + data[1] = 0x21; + memcpy(data + PDU::TWO_BYTES, PDU_DATA, sizeof(PDU_DATA)); + + CPPUNIT_ASSERT(inflator.InflatePDU(header_set, flags, data, data_size)); + delete[] data; +} + + +/* + * Check that we can inflate a PDU block correctly. + */ +void BaseInflatorTest::testInflatePDUBlock() { + TestInflator inflator; // test with a vector size of 2 + HeaderSet header_set; + const unsigned int length_size = 2; + + // inflate a single pdu block + unsigned int data_size = (length_size + PDU::TWO_BYTES + + sizeof(PDU_DATA)); + uint8_t *data = new uint8_t[data_size]; + // setup the vector + data[0] = PDU::VFLAG_MASK; + data[1] = static_cast(data_size); + data[2] = 0x01; + data[3] = 0x21; + memcpy(data + length_size + PDU::TWO_BYTES, PDU_DATA, + sizeof(PDU_DATA)); + CPPUNIT_ASSERT_EQUAL(static_cast(data_size), + inflator.InflatePDUBlock(header_set, data, data_size)); + CPPUNIT_ASSERT_EQUAL(static_cast(1), inflator.BlocksHandled()); + delete[] data; + + // inflate a multi-pdu block + data = new uint8_t[2 * data_size]; + data[0] = PDU::VFLAG_MASK; + data[1] = static_cast(data_size); + data[2] = 0x01; + data[3] = 0x21; + memcpy(data + length_size + PDU::TWO_BYTES, + PDU_DATA, + sizeof(PDU_DATA)); + data[data_size] = PDU::VFLAG_MASK; + data[data_size + 1] = static_cast(data_size); + data[data_size + 2] = 0x01; + data[data_size + 3] = 0x21; + memcpy(data + data_size + length_size + PDU::TWO_BYTES, PDU_DATA, + sizeof(PDU_DATA)); + CPPUNIT_ASSERT_EQUAL( + 2 * static_cast(data_size), + inflator.InflatePDUBlock(header_set, data, 2 * data_size)); + delete[] data; + CPPUNIT_ASSERT_EQUAL(static_cast(3), inflator.BlocksHandled()); + + // inflate with nested inflators + TestInflator child_inflator(289); + inflator.AddInflator(&child_inflator); + unsigned int pdu_size = data_size + length_size + PDU::TWO_BYTES; + data = new uint8_t[pdu_size]; + + data[0] = PDU::VFLAG_MASK; + data[1] = static_cast(pdu_size); + data[2] = 0x01; + data[3] = 0x21; + data[4] = PDU::VFLAG_MASK; + data[5] = static_cast(data_size); + data[6] = 0x01; + data[7] = 0x21; + memcpy(data + 2 * (length_size + PDU::TWO_BYTES), + PDU_DATA, + sizeof(PDU_DATA)); + CPPUNIT_ASSERT_EQUAL(static_cast(pdu_size), + inflator.InflatePDUBlock(header_set, data, pdu_size)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 3, inflator.BlocksHandled()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, child_inflator.BlocksHandled()); + delete[] data; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.cpp new file mode 100644 index 0000000..4b17c19 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.cpp @@ -0,0 +1,214 @@ +/* + * 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 Library 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. + * + * CID.cpp + * CID class + * Copyright (C) 2007 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include "plugins/e131/e131/CID.h" + +namespace ola { +namespace plugin { +namespace e131 { + +#ifdef USE_OSSP_UUID +CID::CID() + : m_uuid(NULL) { +} + + +CID::CID(uuid_t *uuid) + : m_uuid(uuid) { +} + + +CID::CID(const CID& other) + : m_uuid(NULL) { + if (other.m_uuid) + uuid_clone(other.m_uuid, &m_uuid); +} + +CID::~CID() { + if (m_uuid) + uuid_destroy(m_uuid); +} + + +bool CID::IsNil() const { + if (!m_uuid) + return true; + + int result; + uuid_isnil(m_uuid, &result); + return result; +} + + +void CID::Pack(uint8_t *buffer) const { + size_t data_length = CID_LENGTH; + char *ptr = reinterpret_cast(buffer); + if (m_uuid) + uuid_export(m_uuid, UUID_FMT_BIN, reinterpret_cast(&ptr), + &data_length); + else + memset(buffer, 0, CID_LENGTH); +} + + +CID& CID::operator=(const CID& other) { + if (this != &other) { + if (m_uuid) + uuid_destroy(m_uuid); + + if (other.m_uuid) + uuid_clone(other.m_uuid, &m_uuid); + else + m_uuid = NULL; + } + return *this; +} + + +bool CID::operator==(const CID& c1) const { + int result; + uuid_compare(m_uuid, c1.m_uuid, &result); + return 0 == result; +} + + +bool CID::operator!=(const CID& c1) const { + return !(*this == c1); +} + + +std::string CID::ToString() const { + char cid[UUID_LEN_STR + 1]; + char *str = cid; + size_t length = UUID_LEN_STR + 1; + uuid_export(m_uuid, UUID_FMT_STR, reinterpret_cast(&str), &length); + return std::string(str); +} + + +CID CID::Generate() { + uuid_t *uuid; + uuid_create(&uuid); + uuid_make(uuid, UUID_MAKE_V4); + return CID(uuid); +} + + +CID CID::FromData(const uint8_t *data) { + uuid_t *uuid; + uuid_create(&uuid); + uuid_import(uuid, UUID_FMT_BIN, data, CID_LENGTH); + return CID(uuid); +} + + +CID CID::FromString(const std::string &cid) { + uuid_t *uuid; + uuid_create(&uuid); + uuid_import(uuid, UUID_FMT_STR, cid.data(), cid.length()); + return CID(uuid); +} + + +#else +// We're using the e2fs utils uuid library + +CID::CID() { + uuid_clear(m_uuid); +} + + +CID::CID(uuid_t uuid) { + uuid_copy(m_uuid, uuid); +} + + +CID::CID(const CID& other) { + uuid_copy(m_uuid, other.m_uuid); +} + + +CID::~CID() { +} + + +bool CID::IsNil() const { + return uuid_is_null(m_uuid); +} + + +void CID::Pack(uint8_t *buf) const { + memcpy(buf, m_uuid, CID_LENGTH); +} + + +CID& CID::operator=(const CID& other) { + if (this != &other) { + uuid_copy(m_uuid, other.m_uuid); + } + return *this; +} + + +bool CID::operator==(const CID& c1) const { + return !uuid_compare(m_uuid, c1.m_uuid); +} + + +bool CID::operator!=(const CID& c1) const { + return uuid_compare(m_uuid, c1.m_uuid); +} + + +std::string CID::ToString() const { + char str[37]; + uuid_unparse(m_uuid, str); + return std::string(str); +} + + +CID CID::Generate() { + uuid_t uuid; + uuid_generate(uuid); + return CID(uuid); +} + + +CID CID::FromData(const uint8_t *data) { + uuid_t uuid; + uuid_copy(uuid, data); + return CID(uuid); +} + + +CID CID::FromString(const std::string &cid) { + uuid_t uuid; + int ret = uuid_parse(cid.data(), uuid); + if (ret == -1) + uuid_clear(uuid); + return CID(uuid); +} +#endif // end the e2fs progs uuid implementation +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.h new file mode 100644 index 0000000..9cc4b7f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CID.h @@ -0,0 +1,79 @@ +/* + * 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 Library 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. + * + * CID.h + * Interface for the CID class + * Copyright (C) 2007 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_CID_H_ +#define PLUGINS_E131_E131_CID_H_ + +#if HAVE_CONFIG_H +# include +#endif + +#include + +#ifdef HAVE_OSSP_UUID_H +#include +#else +#ifdef HAVE_UUID_UUID_H +#include +#else +#include +#endif +#endif + +#include +#include + +namespace ola { +namespace plugin { +namespace e131 { + +class CID { + public : + enum { CID_LENGTH = 16 }; + + CID(); + CID(const CID& other); + ~CID(); + + bool IsNil() const; + void Pack(uint8_t *buf) const; + std::string ToString() const; + + CID& operator=(const CID& c1); + bool operator==(const CID& c1) const; + bool operator!=(const CID& c1) const; + + static CID Generate(); + static CID FromData(const uint8_t *data); + static CID FromString(const std::string &cid); + + private: +#ifdef USE_OSSP_UUID + uuid_t *m_uuid; + explicit CID(uuid_t *uuid); +#else + uuid_t m_uuid; + explicit CID(uuid_t uuid); +#endif +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_CID_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CIDTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CIDTest.cpp new file mode 100644 index 0000000..4aacca8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/CIDTest.cpp @@ -0,0 +1,121 @@ +/* + * 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 Library 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. + * + * CIDTest.cpp + * Test fixture for the CID class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include +#include +#include + +#include "plugins/e131/e131/CID.h" + +using std::string; +using ola::plugin::e131::CID; + +class CIDTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(CIDTest); + CPPUNIT_TEST(testCID); + CPPUNIT_TEST(testSetPack); + CPPUNIT_TEST(testGenerate); + CPPUNIT_TEST(testToString); + CPPUNIT_TEST(testFromString); + CPPUNIT_TEST_SUITE_END(); + + public: + void testCID(); + void testSetPack(); + void testGenerate(); + void testToString(); + void testFromString(); + private: + static const uint8_t TEST_DATA[]; +}; + + +const uint8_t CIDTest::TEST_DATA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15}; +CPPUNIT_TEST_SUITE_REGISTRATION(CIDTest); + +/* + * Check that basic assignment & equality works + */ +void CIDTest::testCID() { + CID cid; + CPPUNIT_ASSERT(cid.IsNil()); + + CID cid1 = CID::Generate(); + CPPUNIT_ASSERT(!cid1.IsNil()); + + CID cid2 = cid1; + CPPUNIT_ASSERT(cid2 == cid1); + CPPUNIT_ASSERT(!cid2.IsNil()); + + CID cid3; + cid3 = cid1; + CPPUNIT_ASSERT(cid3 == cid1); + CPPUNIT_ASSERT(!cid3.IsNil()); +} + + +void CIDTest::testSetPack() { + uint8_t buffer[CID::CID_LENGTH]; + CID cid = CID::FromData(TEST_DATA); + cid.Pack(buffer); + CPPUNIT_ASSERT(!memcmp(TEST_DATA, buffer, CID::CID_LENGTH)); +} + + +/* + * Check that generate works + */ +void CIDTest::testGenerate() { + CID cid1 = CID::Generate(); + CID cid2 = CID::Generate(); + + CPPUNIT_ASSERT(cid1 != cid2); +} + +/* + * Check that ToString works. + */ +void CIDTest::testToString() { + CID cid = CID::FromData(TEST_DATA); + string cid_str = cid.ToString(); + transform(cid_str.begin(), cid_str.end(), cid_str.begin(), toupper); + CPPUNIT_ASSERT_EQUAL(string("00010203-0405-0607-0809-0A0B0C0D0E0F"), + cid_str); +} + +/* + * Check that from string works. + */ +void CIDTest::testFromString() { + const string uuid = "00010203-0405-0607-0809-0A0B0C0D0E0F"; + CID cid = CID::FromString(uuid); + string cid_str = cid.ToString(); + transform(cid_str.begin(), cid_str.end(), cid_str.begin(), toupper); + CPPUNIT_ASSERT_EQUAL(uuid, cid_str); + + const string bad_uuid = "foo"; + cid = CID::FromString(bad_uuid); + CPPUNIT_ASSERT(cid.IsNil()); +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.cpp new file mode 100644 index 0000000..8831f02 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.cpp @@ -0,0 +1,130 @@ +/* + * 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 Library 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. + * + * DMPAddress.cpp + * Defines the DMP property address types + * Copyright (C) 2007 Simon Newton + */ + +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/DMPAddress.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +/* + * Return the number of bytes that correspond to a DMPType + */ +unsigned int DMPSizeToByteSize(dmp_address_size size) { + switch (size) { + case ONE_BYTES: + return 1; + case TWO_BYTES: + return 2; + case FOUR_BYTES: + return 4; + default: + return 0; + } +} + +/* + * Create a new single address + */ +const BaseDMPAddress *NewSingleAddress(unsigned int value) { + if (value > MAX_TWO_BYTE) + return new FourByteDMPAddress(value); + else if (value > MAX_ONE_BYTE) + return new TwoByteDMPAddress((uint16_t) value); + return new OneByteDMPAddress((uint8_t) value); +} + + +/* + * Create a new range address. + */ +const BaseDMPAddress *NewRangeAddress(unsigned int value, + unsigned int increment, + unsigned int number) { + if (value > MAX_TWO_BYTE || increment > MAX_TWO_BYTE || + number > MAX_TWO_BYTE) + return new FourByteRangeDMPAddress(value, increment, number); + else if (value > MAX_ONE_BYTE || increment > MAX_ONE_BYTE || + number > MAX_ONE_BYTE) + return new TwoByteRangeDMPAddress((uint16_t) value, + (uint16_t) increment, + (uint16_t) number); + return new OneByteRangeDMPAddress((uint8_t) value, + (uint8_t) increment, + (uint8_t) number); +} + + +/* + * Decode a block of data into a DMPAddress + */ +const BaseDMPAddress *DecodeAddress(dmp_address_size size, + dmp_address_type type, + const uint8_t *data, + unsigned int &length) { + unsigned int byte_count = (type == NON_RANGE ? 1 : 3) * + DMPSizeToByteSize(size); + + if (size == RES_BYTES || length < byte_count) { + length = 0; + return NULL; + } + + length = byte_count; + // We have to do a memcpy to avoid the word alignment issues on ARM + uint16_t addr2[3]; + uint32_t addr4[3]; + memcpy(addr2, data, sizeof(addr2)); + memcpy(addr4, data, sizeof(addr4)); + + if (type == NON_RANGE) { + switch (size) { + case ONE_BYTES: + return new OneByteDMPAddress(*data); + case TWO_BYTES: + return new TwoByteDMPAddress(NetworkToHost(addr2[0])); + case FOUR_BYTES: + return new FourByteDMPAddress(NetworkToHost(addr4[0])); + default: + return NULL; // should never make it here because we checked above + } + } + + switch (size) { + case ONE_BYTES: + return new OneByteRangeDMPAddress(*data++, *data++, *data); + case TWO_BYTES: + return new TwoByteRangeDMPAddress(NetworkToHost(addr2[0]), + NetworkToHost(addr2[1]), + NetworkToHost(addr2[2])); + case FOUR_BYTES: + return new FourByteRangeDMPAddress(NetworkToHost(addr4[0]), + NetworkToHost(addr4[1]), + NetworkToHost(addr4[2])); + default: + return NULL; // should never make it here because we checked above + } +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.h new file mode 100644 index 0000000..dcf81e3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddress.h @@ -0,0 +1,265 @@ +/* + * 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 Library 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. + * + * DMPAddress.h + * Defines the DMP property address types + * Copyright (C) 2007 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_DMPADDRESS_H_ +#define PLUGINS_E131_E131_DMPADDRESS_H_ + +#include +#include +#include "ola/network/NetworkUtils.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +typedef enum { + ONE_BYTES = 0x00, + TWO_BYTES = 0x01, + FOUR_BYTES = 0x02, + RES_BYTES = 0x03 +} dmp_address_size; + + +typedef enum { + NON_RANGE = 0x00, + RANGE_SINGLE = 0x01, + RANGE_EQUAL = 0x02, + RANGE_MIXED = 0x03, +} dmp_address_type; + + +static const unsigned int MAX_TWO_BYTE = 0xffff; +static const unsigned int MAX_ONE_BYTE = 0xff; + + +/* + * Return the dmp_address_size that corresponds to a type + */ +template +dmp_address_size TypeToDMPSize() { + switch (sizeof(type)) { + case 1: + return ONE_BYTES; + case 2: + return TWO_BYTES; + case 4: + return FOUR_BYTES; + default: + return RES_BYTES; + } +} + + +/* + * Return the number of bytes that correspond to a DMPType + */ +unsigned int DMPSizeToByteSize(dmp_address_size size); + + +/* + * The Base DMPAddress class. + * The addresses represented by this class may be actual or virtual & relative + * or absolute, ranged or non-ranged. + */ +class BaseDMPAddress { + public: + BaseDMPAddress() {} + virtual ~BaseDMPAddress() {} + + // The start address + virtual unsigned int Start() const = 0; + // The increment + virtual unsigned int Increment() const = 0; + // The number of properties referenced + virtual unsigned int Number() const = 0; + + // Size of this address structure + virtual unsigned int Size() const { + return (IsRange() ? 3 : 1) * BaseSize(); + } + + virtual dmp_address_size AddressSize() const = 0; + + // Pack this address into memory + virtual bool Pack(uint8_t *data, unsigned int &length) const = 0; + + // True if this is a range address. + virtual bool IsRange() const = 0; + + protected: + virtual unsigned int BaseSize() const = 0; +}; + + +/* + * These type of addresses only reference one property. + */ +template +class DMPAddress: public BaseDMPAddress { + public: + explicit DMPAddress(type start): + BaseDMPAddress(), + m_start(start) {} + + unsigned int Start() const { return m_start; } + unsigned int Increment() const { return 0; } + unsigned int Number() const { return 1; } + dmp_address_size AddressSize() const { return TypeToDMPSize(); } + + bool Pack(uint8_t *data, unsigned int &length) const { + if (length < Size()) { + length = 0; + return false; + } + type field = HostToNetwork(m_start); + memcpy(data, &field, BaseSize()); + length = Size(); + return true; + } + bool IsRange() const { return false; } + + protected: + unsigned int BaseSize() const { return sizeof(type); } + + private: + type m_start; +}; + + +typedef DMPAddress OneByteDMPAddress; +typedef DMPAddress TwoByteDMPAddress; +typedef DMPAddress FourByteDMPAddress; + +/* + * Create a new single address + */ +const BaseDMPAddress *NewSingleAddress(unsigned int value); + + +/* + * These type of addresses reference multiple properties. + */ +template +class RangeDMPAddress: public BaseDMPAddress { + public: + RangeDMPAddress(type start, + type increment, + type number): + BaseDMPAddress(), + m_start(start), + m_increment(increment), + m_number(number) {} + unsigned int Start() const { return m_start; } + unsigned int Increment() const { return m_increment; } + unsigned int Number() const { return m_number; } + dmp_address_size AddressSize() const { return TypeToDMPSize(); } + + bool Pack(uint8_t *data, unsigned int &length) const { + if (length < Size()) { + length = 0; + return false; + } + type field[3]; + field[0] = HostToNetwork(m_start); + field[1] = HostToNetwork(m_increment); + field[2] = HostToNetwork(m_number); + memcpy(data, &field, Size()); + length = Size(); + return true; + } + bool IsRange() const { return true; } + + protected: + unsigned int BaseSize() const { return sizeof(type); } + + private: + type m_start, m_increment, m_number; +}; + + +typedef RangeDMPAddress OneByteRangeDMPAddress; +typedef RangeDMPAddress TwoByteRangeDMPAddress; +typedef RangeDMPAddress FourByteRangeDMPAddress; + + +/* + * Create a new range address. + */ +const BaseDMPAddress *NewRangeAddress(unsigned int value, + unsigned int increment, + unsigned int number); + +/* + * Decode an Address + */ +const BaseDMPAddress *DecodeAddress(dmp_address_size size, + dmp_address_type type, + const uint8_t *data, + unsigned int &length); + + +/* + * A DMPAddressData object, this hold an address/data pair + * @param type either DMPAddress<> or RangeDMPAddress<> + */ +template +class DMPAddressData { + public: + DMPAddressData(const type *address, + const uint8_t *data, + unsigned int length): + m_address(address), + m_data(data), + m_length(length) {} + + const type *Address() const { return m_address; } + const uint8_t *Data() const { return m_data; } + unsigned int Size() const { return m_address->Size() + m_length; } + + // Pack the data into a buffer + bool Pack(uint8_t *data, unsigned int &length) const { + if (!m_data) + return false; + + unsigned int total = length; + if (!m_address->Pack(data, length)) { + length = 0; + return false; + } + if (total - length < m_length) { + length = 0; + return false; + } + memcpy(data + length, m_data, m_length); + length += m_length; + return true; + } + + private: + const type *m_address; + const uint8_t *m_data; + unsigned int m_length; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_DMPADDRESS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddressTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddressTest.cpp new file mode 100644 index 0000000..00d7c8e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPAddressTest.cpp @@ -0,0 +1,227 @@ +/* + * 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 Library 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. + * + * DMPAddressTest.cpp + * Test fixture for the DMPAddress class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include + +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/DMPAddress.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +class DMPAddressTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DMPAddressTest); + CPPUNIT_TEST(testAddress); + CPPUNIT_TEST(testRangeAddress); + CPPUNIT_TEST(testAddressData); + CPPUNIT_TEST_SUITE_END(); + + public: + void testAddress(); + void testRangeAddress(); + void testAddressData(); + private: + void checkAddress( + const BaseDMPAddress *address, + unsigned int start, + unsigned int increment, + unsigned int number, + unsigned int size, + dmp_address_size address_size, + bool is_range); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(DMPAddressTest); + + +/* + * Check the properties match, pack the address, decode it, and check the + * decoded address matches the first one. + */ +void DMPAddressTest::checkAddress( + const BaseDMPAddress *address, + unsigned int start, + unsigned int increment, + unsigned int number, + unsigned int size, + dmp_address_size address_size, + bool is_range) { + + CPPUNIT_ASSERT_EQUAL(size, address->Size()); + CPPUNIT_ASSERT_EQUAL(address_size, address->AddressSize()); + CPPUNIT_ASSERT_EQUAL(is_range, address->IsRange()); + CPPUNIT_ASSERT_EQUAL(start, address->Start()); + CPPUNIT_ASSERT_EQUAL(increment, address->Increment()); + CPPUNIT_ASSERT_EQUAL(number, address->Number()); + + unsigned int length = address->Size(); + uint8_t *buffer = new uint8_t[length]; + CPPUNIT_ASSERT(address->Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(size, length); + + const BaseDMPAddress *addr = DecodeAddress( + address_size, + is_range ? RANGE_SINGLE: NON_RANGE, + buffer, length); + CPPUNIT_ASSERT_EQUAL(size, length); + CPPUNIT_ASSERT_EQUAL(start, address->Start()); + CPPUNIT_ASSERT_EQUAL(increment, address->Increment()); + CPPUNIT_ASSERT_EQUAL(number, address->Number()); + + length--; + CPPUNIT_ASSERT(!DecodeAddress(address_size, + is_range ? RANGE_SINGLE: NON_RANGE, + buffer, length)); + length = 0; + CPPUNIT_ASSERT(!DecodeAddress(address_size, + is_range ? RANGE_SINGLE: NON_RANGE, + buffer, length)); + delete[] buffer; + delete addr; +} + + +/* + * Test that addresses work. + */ +void DMPAddressTest::testAddress() { + OneByteDMPAddress addr1(10); + checkAddress(&addr1, 10, 0, 1, 1, ONE_BYTES, false); + TwoByteDMPAddress addr2(1024); + checkAddress(&addr2, 1024, 0, 1, 2, TWO_BYTES, false); + FourByteDMPAddress addr3(66000); + checkAddress(&addr3, 66000, 0, 1, 4, FOUR_BYTES, false); + + const BaseDMPAddress *addr4 = NewSingleAddress(10); + checkAddress(addr4, 10, 0, 1, 1, ONE_BYTES, false); + delete addr4; + + const BaseDMPAddress *addr5 = NewSingleAddress(1024); + checkAddress(addr5, 1024, 0, 1, 2, TWO_BYTES, false); + delete addr5; + + const BaseDMPAddress *addr6 = NewSingleAddress(66000); + checkAddress(addr6, 66000, 0, 1, 4, FOUR_BYTES, false); + delete addr6; +} + + +/* + * Test that Ranged Addresses work + */ +void DMPAddressTest::testRangeAddress() { + uint8_t buffer[12]; + uint16_t *p = reinterpret_cast(buffer); + uint32_t *pp = reinterpret_cast(buffer); + unsigned int length = sizeof(buffer); + + OneByteRangeDMPAddress addr1(10, 2, 4); + checkAddress(&addr1, 10, 2, 4, 3, ONE_BYTES, true); + CPPUNIT_ASSERT(addr1.Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr1.Size(), length); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, buffer[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, buffer[1]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 4, buffer[2]); + + length = sizeof(buffer); + TwoByteRangeDMPAddress addr2(1024, 2, 99); + checkAddress(&addr2, 1024, 2, 99, 6, TWO_BYTES, true); + CPPUNIT_ASSERT(addr2.Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr2.Size(), length); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1024, NetworkToHost(*p++)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 2, NetworkToHost(*p++)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 99, NetworkToHost(*p)); + + length = sizeof(buffer); + FourByteRangeDMPAddress addr3(66000, 2, 100); + checkAddress(&addr3, 66000, 2, 100, 12, FOUR_BYTES, true); + CPPUNIT_ASSERT(addr3.Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr3.Size(), length); + CPPUNIT_ASSERT_EQUAL((uint32_t) 66000, NetworkToHost(*pp++)); + CPPUNIT_ASSERT_EQUAL((uint32_t) 2, NetworkToHost(*pp++)); + CPPUNIT_ASSERT_EQUAL((uint32_t) 100, NetworkToHost(*pp)); + + const BaseDMPAddress *addr4 = NewRangeAddress(10, 1, 10); + length = sizeof(buffer); + checkAddress(addr4, 10, 1, 10, 3, ONE_BYTES, true); + CPPUNIT_ASSERT(addr4->Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr4->Size(), length); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, buffer[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, buffer[1]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, buffer[2]); + delete addr4; + + p = reinterpret_cast(buffer); + const BaseDMPAddress *addr5 = NewRangeAddress(10, 1, 1024); + length = sizeof(buffer); + checkAddress(addr5, 10, 1, 1024, 6, TWO_BYTES, true); + CPPUNIT_ASSERT(addr5->Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr5->Size(), length); + CPPUNIT_ASSERT_EQUAL((uint16_t) 10, NetworkToHost(*p++)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1, NetworkToHost(*p++)); + CPPUNIT_ASSERT_EQUAL((uint16_t) 1024, NetworkToHost(*p)); + delete addr5; + + pp = reinterpret_cast(buffer); + const BaseDMPAddress *addr6 = NewRangeAddress(66000, 1, 1024); + length = sizeof(buffer); + checkAddress(addr6, 66000, 1, 1024, 12, FOUR_BYTES, true); + CPPUNIT_ASSERT(addr6->Pack(buffer, length)); + CPPUNIT_ASSERT_EQUAL(addr6->Size(), length); + CPPUNIT_ASSERT_EQUAL((uint32_t) 66000, NetworkToHost(*pp++)); + CPPUNIT_ASSERT_EQUAL((uint32_t) 1, NetworkToHost(*pp++)); + CPPUNIT_ASSERT_EQUAL((uint32_t) 1024, NetworkToHost(*pp)); + delete addr6; +} + + +/* + * test that AddressData objects work + */ +void DMPAddressTest::testAddressData() { + uint8_t buffer[12]; + unsigned int length = sizeof(buffer); + OneByteDMPAddress addr1(10); + DMPAddressData chunk(&addr1, NULL, 0); + + CPPUNIT_ASSERT_EQUAL((const OneByteDMPAddress*) &addr1, chunk.Address()); + CPPUNIT_ASSERT_EQUAL((const uint8_t*) NULL, chunk.Data()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, chunk.Size()); + CPPUNIT_ASSERT(!chunk.Pack(buffer, length)); + + length = sizeof(buffer); + TwoByteRangeDMPAddress addr2(10, 2, 10); + DMPAddressData chunk2(&addr2, NULL, 0); + + CPPUNIT_ASSERT_EQUAL((const TwoByteRangeDMPAddress*) &addr2, + chunk2.Address()); + CPPUNIT_ASSERT_EQUAL((const uint8_t*) NULL, chunk2.Data()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 6, chunk2.Size()); + CPPUNIT_ASSERT(!chunk2.Pack(buffer, length)); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.cpp new file mode 100644 index 0000000..4790579 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.cpp @@ -0,0 +1,348 @@ +/* + * 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 Library 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. + * + * DMPE131Inflator.cpp + * The Inflator for the DMP PDUs + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include +#include "ola/Logging.h" +#include "plugins/e131/e131/DMPE131Inflator.h" +#include "plugins/e131/e131/DMPHeader.h" +#include "plugins/e131/e131/DMPPDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using std::map; +using std::pair; +using std::vector; +using ola::Closure; + +const TimeInterval DMPE131Inflator::EXPIRY_INTERVAL(2500); + + +DMPE131Inflator::~DMPE131Inflator() { + map::iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) { + delete iter->second.closure; + m_e131_layer->LeaveUniverse(iter->first); + } + m_handlers.clear(); +} + + +/* + * Handle a DMP PDU for E1.31. + */ +bool DMPE131Inflator::HandlePDUData(uint32_t vector, + HeaderSet &headers, + const uint8_t *data, + unsigned int pdu_len) { + if (vector != DMP_SET_PROPERTY_VECTOR) { + OLA_INFO << "not a set property msg: " << vector; + return true; + } + + E131Header e131_header = headers.GetE131Header(); + map::iterator universe_iter = + m_handlers.find(e131_header.Universe()); + + if (e131_header.PreviewData() && m_ignore_preview) { + OLA_DEBUG << "Ignoring preview data"; + return true; + } + + if (universe_iter == m_handlers.end()) + return true; + + DMPHeader dmp_header = headers.GetDMPHeader(); + + if (!dmp_header.IsVirtual() || dmp_header.IsRelative() || + dmp_header.Size() != TWO_BYTES || + dmp_header.Type() != RANGE_EQUAL) { + OLA_INFO << "malformed E1.31 dmp header " << dmp_header.Header(); + return true; + } + + if (e131_header.Priority() > MAX_PRIORITY) { + OLA_INFO << "Priority " << static_cast(e131_header.Priority()) << + " is greater than the max priority (" << static_cast(MAX_PRIORITY) << + "), ignoring data"; + return true; + } + + unsigned int available_length = pdu_len; + const BaseDMPAddress *address = DecodeAddress(dmp_header.Size(), + dmp_header.Type(), + data, + available_length); + + if (!address) { + OLA_INFO << "DMP address parsing failed, the length is probably too small"; + return true; + } + + if (address->Increment() != 1) { + OLA_INFO << "E1.31 DMP packet with increment " << address->Increment() + << ", disarding"; + delete address; + return true; + } + + unsigned int length_remaining = pdu_len - available_length; + int start_code = -1; + if (e131_header.UsingRev2()) + start_code = address->Start(); + else if (length_remaining && address->Number()) + start_code = *(data + available_length); + + // The only time we want to continue processing a non-0 start code is if it + // contains a Terminate message. + if (start_code && !e131_header.StreamTerminated()) { + OLA_INFO << "Skipping packet with non-0 start code: " << start_code; + delete address; + return true; + } + + DmxBuffer *target_buffer; + if (!TrackSourceIfRequired(&universe_iter->second, headers, &target_buffer)) { + // no need to continue processing + delete address; + return true; + } + + // Reaching here means that we actually have new data and we should merge. + if (target_buffer && start_code == 0) { + unsigned int channels = std::min(length_remaining, address->Number()); + if (e131_header.UsingRev2()) + target_buffer->Set(data + available_length, channels); + else + target_buffer->Set(data + available_length + 1, channels - 1); + } + + if (universe_iter->second.priority) + *universe_iter->second.priority = universe_iter->second.active_priority; + + // merge the sources + switch (universe_iter->second.sources.size()) { + case 0: + universe_iter->second.buffer->Reset(); + break; + case 1: + universe_iter->second.buffer->Set( + universe_iter->second.sources[0].buffer); + universe_iter->second.closure->Run(); + break; + default: + // HTP Merge + universe_iter->second.buffer->Reset(); + std::vector::const_iterator source_iter = + universe_iter->second.sources.begin(); + for (; source_iter != universe_iter->second.sources.end(); ++source_iter) + universe_iter->second.buffer->HTPMerge(source_iter->buffer); + universe_iter->second.closure->Run(); + } + delete address; + return true; +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param buffer the DmxBuffer to update with the data + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool DMPE131Inflator::SetHandler(unsigned int universe, + ola::DmxBuffer *buffer, + uint8_t *priority, + ola::Closure *closure) { + if (!closure || !buffer) + return false; + + map::iterator iter = + m_handlers.find(universe); + + if (iter == m_handlers.end()) { + universe_handler handler; + handler.buffer = buffer; + handler.closure = closure; + handler.active_priority = 0; + handler.priority = priority; + m_handlers[universe] = handler; + m_e131_layer->JoinUniverse(universe); + } else { + Closure *old_closure = iter->second.closure; + iter->second.closure = closure; + iter->second.buffer = buffer; + iter->second.priority = priority; + delete old_closure; + } + return true; +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool DMPE131Inflator::RemoveHandler(unsigned int universe) { + map::iterator iter = + m_handlers.find(universe); + + if (iter != m_handlers.end()) { + Closure *old_closure = iter->second.closure; + m_handlers.erase(iter); + m_e131_layer->LeaveUniverse(universe); + delete old_closure; + return true; + } + return false; +} + + +/* + * Check if this source is operating at the highest priority for this universe. + * This takes care of tracking all sources for a universe at the active + * priority. + * @param universe_data the universe_handler struct for this universe, + * @param HeaderSet the set of headers in this packet + * @param buffer, if set to a non-NULL pointer, the caller should copy the data + * in the buffer. + * @returns true if we should remerge the data, false otherwise. + */ +bool DMPE131Inflator::TrackSourceIfRequired( + universe_handler *universe_data, + const HeaderSet &headers, + DmxBuffer **buffer) { + + *buffer = NULL; // default the buffer to NULL + ola::TimeStamp now; + Clock::CurrentTime(&now); + const E131Header &e131_header = headers.GetE131Header(); + uint8_t priority = e131_header.Priority(); + vector &sources = universe_data->sources; + vector::iterator iter = sources.begin(); + + while (iter != sources.end()) { + if (iter->cid != headers.GetRootHeader().GetCid()) { + TimeStamp expiry_time = iter->last_heard_from + EXPIRY_INTERVAL; + if (now > expiry_time) { + OLA_INFO << "source " << iter->cid.ToString() << " has expired"; + iter = sources.erase(iter); + continue; + } + } + iter++; + } + + if (!sources.size()) + universe_data->active_priority = 0; + + for (iter = sources.begin(); iter != sources.end(); ++iter) { + if (iter->cid == headers.GetRootHeader().GetCid()) + break; + } + + if (iter == sources.end()) { + // This is an untracked source + if (e131_header.StreamTerminated() || + priority < universe_data->active_priority) + return false; + + if (priority > universe_data->active_priority) { + OLA_INFO << "Raising priority for universe " << + e131_header.Universe() << " from " << + static_cast(universe_data->active_priority) << " to " << + static_cast(priority); + sources.clear(); + universe_data->active_priority = priority; + } + + if (sources.size() == MAX_MERGE_SOURCES) { + // TODO(simon): flag this in the export map + OLA_WARN << "Max merge sources reached for universe " << + e131_header.Universe() << ", " << + headers.GetRootHeader().GetCid().ToString() << " won't be tracked"; + return false; + } else { + OLA_INFO << "Added new E1.31 source: " << + headers.GetRootHeader().GetCid().ToString(); + dmx_source new_source; + new_source.cid = headers.GetRootHeader().GetCid(); + new_source.sequence = e131_header.Sequence(); + new_source.last_heard_from = now; + iter = sources.insert(sources.end(), new_source); + *buffer = &iter->buffer; + return true; + } + + } else { + // We already know about this one, check the seq # + int8_t seq_diff = static_cast(e131_header.Sequence() - + iter->sequence); + if (seq_diff <= 0 && seq_diff > SEQUENCE_DIFF_THRESHOLD) { + OLA_INFO << "Old packet received, ignoring, this # " << + static_cast(e131_header.Sequence()) << ", last " << + static_cast(iter->sequence); + return false; + } + iter->sequence = e131_header.Sequence(); + + if (e131_header.StreamTerminated()) { + OLA_INFO << "CID " << headers.GetRootHeader().GetCid().ToString() << + " sent a termination for universe " << e131_header.Universe(); + sources.erase(iter); + if (!sources.size()) + universe_data->active_priority = 0; + // We need to trigger a merge here else the buffer will be stale, we keep + // the buffer as NULL though so we don't use the data. + return true; + } + + iter->last_heard_from = now; + if (priority < universe_data->active_priority) { + if (sources.size() == 1) { + universe_data->active_priority = priority; + } else { + sources.erase(iter); + return true; + } + } else if (priority > universe_data->active_priority) { + // new active priority + universe_data->active_priority = priority; + if (sources.size() != 1) { + // clear all sources other than this one + dmx_source this_source = *iter; + sources.clear(); + iter = sources.insert(sources.end(), this_source); + } + } + *buffer = &iter->buffer; + return true; + } +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.h new file mode 100644 index 0000000..bd6fc19 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPE131Inflator.h @@ -0,0 +1,94 @@ +/* + * 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 Library 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. + * + * DMPE131Inflator.h + * This is a subclass of the DMPInflator which knows how to handle DMP over + * E1.31 messages. + * Copyright (C) 2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_DMPE131INFLATOR_H_ +#define PLUGINS_E131_E131_DMPE131INFLATOR_H_ + +#include +#include +#include "ola/Clock.h" +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "plugins/e131/e131/DMPInflator.h" +#include "plugins/e131/e131/E131Layer.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class DMPE131Inflator: public DMPInflator { + friend class DMPE131InflatorTest; + + public: + DMPE131Inflator(E131Layer *e131_layer, bool ignore_preview): + DMPInflator(), + m_e131_layer(e131_layer), + m_ignore_preview(ignore_preview) { + } + ~DMPE131Inflator(); + + bool SetHandler(unsigned int universe, ola::DmxBuffer *buffer, + uint8_t *priority, ola::Closure *handler); + bool RemoveHandler(unsigned int universe); + + protected: + virtual bool HandlePDUData(uint32_t vector, + HeaderSet &headers, + const uint8_t *data, + unsigned int pdu_len); + + private: + + typedef struct { + CID cid; + uint8_t sequence; + TimeStamp last_heard_from; + DmxBuffer buffer; + } dmx_source; + + typedef struct { + DmxBuffer *buffer; + Closure *closure; + uint8_t active_priority; + uint8_t *priority; + std::vector sources; + } universe_handler; + + std::map m_handlers; + E131Layer *m_e131_layer; + bool m_ignore_preview; + + bool TrackSourceIfRequired(universe_handler *universe_data, + const HeaderSet &headers, + DmxBuffer **buffer); + + // The max number of sources we'll track per universe. + static const uint8_t MAX_MERGE_SOURCES = 6; + static const uint8_t MAX_PRIORITY = 200; + // ignore packets that differ by less than this amount from the last one + static const int8_t SEQUENCE_DIFF_THRESHOLD = -20; + // expire sources after 2.5s + static const TimeInterval EXPIRY_INTERVAL; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_DMPE131INFLATOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPHeader.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPHeader.h new file mode 100644 index 0000000..534b2c8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPHeader.h @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * DMPHeader.h + * The DMP Header + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_DMPHEADER_H_ +#define PLUGINS_E131_E131_DMPHEADER_H_ + +#include +#include +#include "plugins/e131/e131/DMPAddress.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using std::string; + +/* + * Header for the DMP layer + */ +class DMPHeader { + public: + static const unsigned int DMP_HEADER_SIZE = 1; + + explicit DMPHeader(uint8_t header = 0): m_header(header) {} + + DMPHeader(bool is_virtual, + bool is_relative, + dmp_address_type type, + dmp_address_size size) { + m_header = (uint8_t) (is_virtual << 7 | + is_relative << 6 | + type << 4 | + size); + } + ~DMPHeader() {} + + bool IsVirtual() const { return m_header & VIRTUAL_MASK; } + bool IsRelative() const { return m_header & RELATIVE_MASK; } + + dmp_address_type Type() const { + return (dmp_address_type) ((m_header & TYPE_MASK) >> 4); + } + + dmp_address_size Size() const { + return (dmp_address_size) (m_header & SIZE_MASK); + } + + unsigned int Bytes() const { return DMPSizeToByteSize(Size()); } + + bool operator==(const DMPHeader &other) const { + return m_header == other.m_header; + } + + bool operator!=(const DMPHeader &other) const { + return m_header != other.m_header; + } + + uint8_t Header() const { return m_header; } + + private: + static const uint8_t VIRTUAL_MASK = 0x80; + static const uint8_t RELATIVE_MASK = 0x40; + static const uint8_t TYPE_MASK = 0x30; + static const uint8_t SIZE_MASK = 0x03; + uint8_t m_header; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_DMPHEADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.cpp new file mode 100644 index 0000000..c42cfe7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.cpp @@ -0,0 +1,75 @@ +/* + * 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 Library 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. + * + * DMPInflator.cpp + * The Inflator for the DMP PDUs + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include "ola/Logging.h" +#include "plugins/e131/e131/DMPInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +/* + * Decode the DMP header. If data is null we're expected to use the last + * header we got. + * @param headers the HeaderSet to add to + * @param data a pointer to the data + * @param length length of the data + * @returns true if successful, false otherwise + */ +bool DMPInflator::DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + if (data) { + // the header bit was set, decode it + if (length >= DMPHeader::DMP_HEADER_SIZE) { + DMPHeader header(*data); + m_last_header = header; + m_last_header_valid = true; + headers.SetDMPHeader(header); + bytes_used = DMPHeader::DMP_HEADER_SIZE; + return true; + } + bytes_used = 0; + return false; + } + + // use the last header if it exists + bytes_used = 0; + if (!m_last_header_valid) { + OLA_WARN << "Missing DMP Header data"; + return false; + } + headers.SetDMPHeader(m_last_header); + return true; +} + + +/* + * Reset the header field + */ +void DMPInflator::ResetHeaderField() { + m_last_header_valid = false; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.h new file mode 100644 index 0000000..58968fb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflator.h @@ -0,0 +1,58 @@ +/* + * 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 Library 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. + * + * DMPInflator.h + * Interface for the DMPInflator class. + * Copyright (C) 2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_DMPINFLATOR_H_ +#define PLUGINS_E131_E131_DMPINFLATOR_H_ + +#include "plugins/e131/e131/BaseInflator.h" +#include "plugins/e131/e131/DMPHeader.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class DMPInflator: public BaseInflator { + friend class DMPInflatorTest; + + public: + static const unsigned int DMP_VECTOR = 2; + + DMPInflator(): BaseInflator(PDU::ONE_BYTE), + m_last_header_valid(false) { + } + virtual ~DMPInflator() {} + + uint32_t Id() const { return DMP_VECTOR; } + + protected: + bool DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int len, + unsigned int &bytes_used); + + void ResetHeaderField(); + private: + DMPHeader m_last_header; + bool m_last_header_valid; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_DMPINFLATOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflatorTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflatorTest.cpp new file mode 100644 index 0000000..18d48dc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPInflatorTest.cpp @@ -0,0 +1,115 @@ +/* + * 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 Library 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. + * + * DMPInflatorTest.cpp + * Test fixture for the DMPInflator class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include + +#include "plugins/e131/e131/DMPAddress.h" +#include "plugins/e131/e131/DMPInflator.h" +#include "plugins/e131/e131/DMPPDU.h" +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/PDUTestCommon.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +class DMPInflatorTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DMPInflatorTest); + CPPUNIT_TEST(testDecodeHeader); + CPPUNIT_TEST(testInflatePDU); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDecodeHeader(); + void testInflatePDU(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(DMPInflatorTest); + + +/* + * Check that we can decode headers properly + */ +void DMPInflatorTest::testDecodeHeader() { + DMPHeader header(true, true, NON_RANGE, TWO_BYTES); + DMPInflator inflator; + HeaderSet header_set, header_set2; + unsigned int bytes_used; + uint8_t header_data = header.Header(); + + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set, + &header_data, + sizeof(header_data), + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(header_data), bytes_used); + DMPHeader decoded_header = header_set.GetDMPHeader(); + CPPUNIT_ASSERT(decoded_header.IsVirtual()); + CPPUNIT_ASSERT(decoded_header.IsRelative()); + CPPUNIT_ASSERT(NON_RANGE == decoded_header.Type()); + CPPUNIT_ASSERT(TWO_BYTES == decoded_header.Size()); + + // try an undersized header + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set, + &header_data, + 0, + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test inherting the header from the prev call + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + decoded_header = header_set2.GetDMPHeader(); + CPPUNIT_ASSERT(decoded_header.IsVirtual()); + CPPUNIT_ASSERT(decoded_header.IsRelative()); + CPPUNIT_ASSERT(NON_RANGE == decoded_header.Type()); + CPPUNIT_ASSERT(TWO_BYTES == decoded_header.Size()); + + inflator.ResetHeaderField(); + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); +} + + +/* + * Check that we can inflate a DMP PDU that contains other PDUs + */ +void DMPInflatorTest::testInflatePDU() { + DMPHeader header(true, true, NON_RANGE, ONE_BYTES); + const DMPPDU *pdu = NewDMPGetProperty(true, true, 1); + CPPUNIT_ASSERT_EQUAL((unsigned int) 5, pdu->Size()); + + unsigned int size = pdu->Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu->Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + DMPInflator inflator; + HeaderSet header_set; + CPPUNIT_ASSERT(inflator.InflatePDUBlock(header_set, data, size)); + CPPUNIT_ASSERT(header == header_set.GetDMPHeader()); + delete[] data; + delete pdu; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.cpp new file mode 100644 index 0000000..52c41a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.cpp @@ -0,0 +1,101 @@ +/* + * 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 Library 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. + * + * DMPPDU.cpp + * The DMPPDU + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "ola/Logging.h" +#include "plugins/e131/e131/DMPPDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +/* + * Pack the header portion. + */ +bool DMPPDU::PackHeader(uint8_t *data, unsigned int &length) const { + if (length < DMPHeader::DMP_HEADER_SIZE) { + OLA_WARN << "DMPPDU::PackHeader: buffer too small, got " << length << + " required " << DMPHeader::DMP_HEADER_SIZE; + length = 0; + return false; + } + *data = m_header.Header(); + length = DMPHeader::DMP_HEADER_SIZE; + return true; +} + + +/* + * Create a new Single Address GetProperty PDU. + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param start the start offset + * @return A pointer to a DMPGetProperty. + */ +const DMPPDU *NewDMPGetProperty(bool is_virtual, + bool is_relative, + unsigned int start) { + if (start > MAX_TWO_BYTE) + return _CreateDMPGetProperty(is_virtual, is_relative, start); + else if (start > MAX_ONE_BYTE) + return _CreateDMPGetProperty(is_virtual, is_relative, start); + return _CreateDMPGetProperty(is_virtual, is_relative, start); +} + + +/* + * Create a new range address GetProperty PDU. + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param start the start offset + * @param increment the increments between addresses + * @param number the number of addresses defined + * @return A pointer to a DMPGetProperty. + */ +const DMPPDU *NewRangeDMPGetProperty( + bool is_virtual, + bool is_relative, + unsigned int start, + unsigned int increment, + unsigned int number) { + + if (start > MAX_TWO_BYTE || increment > MAX_TWO_BYTE || + number > MAX_TWO_BYTE) + return _CreateRangeDMPGetProperty(is_virtual, + is_relative, + start, + increment, + number); + else if (start > MAX_ONE_BYTE || increment > MAX_ONE_BYTE || + number > MAX_ONE_BYTE) + return _CreateRangeDMPGetProperty(is_virtual, + is_relative, + start, + increment, + number); + return _CreateRangeDMPGetProperty(is_virtual, + is_relative, + start, + increment, + number); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.h new file mode 100644 index 0000000..037a0c3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDU.h @@ -0,0 +1,286 @@ +/* + * 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 Library 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. + * + * DMPPDU.h + * Interface for the DMP PDU + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_DMPPDU_H_ +#define PLUGINS_E131_E131_DMPPDU_H_ + +#include +#include + +#include "plugins/e131/e131/DMPAddress.h" +#include "plugins/e131/e131/DMPHeader.h" +#include "plugins/e131/e131/PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using std::vector; + +static const unsigned int DMP_GET_PROPERTY_VECTOR = 1; +static const unsigned int DMP_SET_PROPERTY_VECTOR = 2; + +/* + * The base DMPPDU class. + * More specific dmp pdus like the SetPropery inherit from this. + */ +class DMPPDU: public PDU { + public: + DMPPDU(unsigned int vector, const DMPHeader &dmp_header): + PDU(vector, ONE_BYTE), + m_header(dmp_header) { + } + ~DMPPDU() {} + + unsigned int HeaderSize() const { return DMPHeader::DMP_HEADER_SIZE; } + bool PackHeader(uint8_t *data, unsigned int &length) const; + + protected: + DMPHeader m_header; +}; + + +/* + * A DMPGetPropertyPDU, templatized by the address type. + * Don't create these directly, instead use the helper function below which + * enforces compile time consistency. + */ +template +class DMPGetProperty: public DMPPDU { + public: + DMPGetProperty(const DMPHeader &header, + const vector
&addresses): + DMPPDU(DMP_GET_PROPERTY_VECTOR, header), + m_addresses(addresses) {} + + unsigned int DataSize() const { + return static_cast(m_addresses.size() * m_header.Bytes() * + (m_header.Type() == NON_RANGE ? 1 : 3)); + } + + bool PackData(uint8_t *data, unsigned int &length) const { + typename vector
::const_iterator iter; + unsigned int offset = 0; + for (iter = m_addresses.begin(); iter != m_addresses.end(); ++iter) { + unsigned int remaining = length - offset; + if (!iter->Pack(data + offset, remaining)) + return false; + offset += remaining; + } + length = offset; + return true; + } + + private: + vector
m_addresses; +}; + + +/* + * Create a non-ranged GetProperty PDU + * @param type uint8_t, uint16_t or uint32_t + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param addresses a vector of DMPAddress objects + */ +template +const DMPPDU *NewDMPGetProperty( + bool is_virtual, + bool is_relative, + const vector > &addresses) { + DMPHeader header(is_virtual, + is_relative, + NON_RANGE, + TypeToDMPSize()); + return new DMPGetProperty >(header, addresses); +} + + +/* + * Create a non-ranged DMP GetProperty PDU + * @param type uint8_t, uint16_t, uint32_t + */ +template +const DMPPDU *_CreateDMPGetProperty(bool is_virtual, + bool is_relative, + unsigned int start) { + DMPAddress address((type) start); + vector > addresses; + addresses.push_back(address); + return NewDMPGetProperty(is_virtual, is_relative, addresses); +} + + +/* + * A helper to create a new single, non-ranged GetProperty PDU. + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param start the start offset + * @return A pointer to a DMPPDU. + */ +const DMPPDU *NewDMPGetProperty(bool is_virtual, + bool is_relative, + unsigned int start); + + +/* + * Create a Ranged DMP GetProperty Message. + * @param type uint8_t, uint16_t or uint32_t + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param addresses a vector of addresses that match the type + * @return A pointer to a DMPPDU. + */ +template +const DMPPDU *NewRangeDMPGetProperty( + bool is_virtual, + bool is_relative, + const vector > &addresses) { + DMPHeader header(is_virtual, + is_relative, + RANGE_SINGLE, + TypeToDMPSize()); + return new DMPGetProperty >(header, addresses); +} + + +template +const DMPPDU *_CreateRangeDMPGetProperty(bool is_virtual, + bool is_relative, + unsigned int start, + unsigned int increment, + unsigned int number) { + vector > addresses; + RangeDMPAddress address((type) start, (type) increment, (type) number); + addresses.push_back(address); + return NewRangeDMPGetProperty(is_virtual, is_relative, addresses); +} + + +/* + * A helper to create a new ranged address GetProperty PDU. + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param start the start offset + * @param increment the increments between addresses + * @param number the number of addresses defined + * @return A pointer to a DMPGetProperty. + */ +const DMPPDU *NewRangeDMPGetProperty( + bool is_virtual, + bool is_relative, + unsigned int start, + unsigned int increment, + unsigned int number); + + +/* + * A DMPSetPropertyPDU, templatized by the address type. + * Don't create these directly, instead use the helper functions below which + * enforce compile time consistency. + * @param type either DMPAddress<> or RangeDMPAddress<> + */ +template +class DMPSetProperty: public DMPPDU { + public: + typedef vector > AddressDataChunks; + + DMPSetProperty(const DMPHeader &header, const AddressDataChunks &chunks): + DMPPDU(DMP_SET_PROPERTY_VECTOR, header), + m_chunks(chunks) {} + + unsigned int DataSize() const { + typename AddressDataChunks::const_iterator iter; + unsigned int length = 0; + for (iter = m_chunks.begin(); iter != m_chunks.end(); ++iter) + length += iter->Size(); + return length; + } + + bool PackData(uint8_t *data, unsigned int &length) const { + typename AddressDataChunks::const_iterator iter; + unsigned int offset = 0; + for (iter = m_chunks.begin(); iter != m_chunks.end(); ++iter) { + unsigned int remaining = length - offset; + if (!iter->Pack(data + offset, remaining)) + return false; + offset += remaining; + } + length = offset; + return true; + } + + private: + AddressDataChunks m_chunks; +}; + + +/* + * Create a new DMP SetProperty Message + */ +template +const DMPPDU *NewDMPSetProperty( + bool is_virtual, + bool is_relative, + const vector > > &chunks) { + + DMPHeader header(is_virtual, + is_relative, + NON_RANGE, + TypeToDMPSize()); + return new DMPSetProperty >(header, chunks); +} + + +/* + * Create a new DMP SetProperty PDU + * @param type either DMPAddress or RangeDMPAddress + * @param is_virtual set to true if this is a virtual address + * @param is_relative set to true if this is a relative address + * @param chunks a vector of DMPAddressData objects + */ +template +const DMPPDU *NewRangeDMPSetProperty( + bool is_virtual, + bool is_relative, + const vector > > &chunks, + bool multiple_elements = true, + bool equal_size_elements = true) { + + dmp_address_type address_type; + if (multiple_elements) { + if (equal_size_elements) + address_type = RANGE_EQUAL; + else + address_type = RANGE_MIXED; + } else { + address_type = RANGE_SINGLE; + } + + DMPHeader header(is_virtual, + is_relative, + address_type, + TypeToDMPSize()); + return new DMPSetProperty >(header, chunks); +} +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_DMPPDU_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDUTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDUTest.cpp new file mode 100644 index 0000000..fc0e4a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/DMPPDUTest.cpp @@ -0,0 +1,236 @@ +/* + * 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 Library 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. + * + * DMPPDUTest.cpp + * Test fixture for the DMPPDU class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include + +#include "ola/Logging.h" +#include "plugins/e131/e131/DMPAddress.h" +#include "plugins/e131/e131/DMPInflator.h" +#include "plugins/e131/e131/DMPPDU.h" +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/PDUTestCommon.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class MockDMPInflator: public DMPInflator { + public: + MockDMPInflator(): DMPInflator(), + expected_vector(0), + expected_virtual(false), + expected_relative(false), + expected_type(NON_RANGE), + expected_size(RES_BYTES) , + expected_start(0), + expected_increment(0), + expected_number(0) {} + ~MockDMPInflator() {} + + unsigned int expected_length; + unsigned int expected_data_length; + unsigned int expected_vector; + bool expected_virtual; + bool expected_relative; + dmp_address_type expected_type; + dmp_address_size expected_size; + + unsigned int expected_start; + unsigned int expected_increment; + unsigned int expected_number; + + protected: + bool HandlePDUData(uint32_t vector, HeaderSet &headers, + const uint8_t *data, unsigned int pdu_len); +}; + +class DMPPDUTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(DMPPDUTest); + CPPUNIT_TEST(testGetProperty); + CPPUNIT_TEST(testSetProperty); + CPPUNIT_TEST_SUITE_END(); + + public: + void testGetProperty(); + void testSetProperty(); + + private: + void PackPduAndInflate(const DMPPDU *pdu); + MockDMPInflator m_inflator; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(DMPPDUTest); + + +/* + * Verify a PDU is what we expected + */ +bool MockDMPInflator::HandlePDUData(uint32_t vector, + HeaderSet &headers, + const uint8_t *data, + unsigned int pdu_len) { + DMPHeader header = headers.GetDMPHeader(); + CPPUNIT_ASSERT_EQUAL(expected_vector, vector); + CPPUNIT_ASSERT_EQUAL(expected_virtual, header.IsVirtual()); + CPPUNIT_ASSERT_EQUAL(expected_relative, header.IsRelative()); + CPPUNIT_ASSERT(expected_type == header.Type()); + CPPUNIT_ASSERT(expected_size == header.Size()); + + if (vector == DMP_GET_PROPERTY_VECTOR || + vector == DMP_SET_PROPERTY_VECTOR) { + unsigned int length = pdu_len; + const BaseDMPAddress *addr = DecodeAddress(header.Size(), header.Type(), + data, length); + CPPUNIT_ASSERT(addr); + CPPUNIT_ASSERT_EQUAL(expected_start, addr->Start()); + CPPUNIT_ASSERT_EQUAL(expected_increment, addr->Increment()); + CPPUNIT_ASSERT_EQUAL(expected_number, addr->Number()); + delete addr; + } + return true; +} + + +/* + * Pack a PDU and check it inflates correctly. + */ +void DMPPDUTest::PackPduAndInflate(const DMPPDU *pdu) { + unsigned int size = pdu->Size() + 10; // overallocate to catch overflows + uint8_t *data = new uint8_t[size]; + CPPUNIT_ASSERT(pdu->Pack(data, size)); + CPPUNIT_ASSERT_EQUAL(pdu->Size(), size); + + HeaderSet headers; + m_inflator.InflatePDUBlock(headers, data, size); + delete[] data; +} + + +/* + * Test that GetProperty PDUs can be constructed + */ +void DMPPDUTest::testGetProperty() { + m_inflator.expected_vector = DMP_GET_PROPERTY_VECTOR; + m_inflator.expected_type = NON_RANGE; + m_inflator.expected_size = ONE_BYTES; + m_inflator.expected_virtual = false; + m_inflator.expected_relative = true; + m_inflator.expected_start = 10; + m_inflator.expected_increment = 0; + m_inflator.expected_number = 1; + + // Non-ranged GetProperty PDUs + const DMPPDU *pdu = NewDMPGetProperty(false, true, 10); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 5, pdu->Size()); + PackPduAndInflate(pdu); + delete pdu; + + m_inflator.expected_start = 1024; + pdu = NewDMPGetProperty(true, true, 1024); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 6, pdu->Size()); + m_inflator.expected_size = TWO_BYTES; + m_inflator.expected_virtual = true; + PackPduAndInflate(pdu); + delete pdu; + + // Ranged GetProperty PDUs + m_inflator.expected_start = 10; + m_inflator.expected_increment = 1; + m_inflator.expected_number = 20; + m_inflator.expected_type = RANGE_SINGLE; + pdu = NewRangeDMPGetProperty(true, false, 10, 1, 20); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 7, pdu->Size()); + m_inflator.expected_size = ONE_BYTES; + m_inflator.expected_relative = false; + PackPduAndInflate(pdu); + delete pdu; + + m_inflator.expected_start = 10; + m_inflator.expected_increment = 1; + m_inflator.expected_number = 1024; + pdu = NewRangeDMPGetProperty(false, false, 10, 1, 1024); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 10, pdu->Size()); + m_inflator.expected_size = TWO_BYTES; + m_inflator.expected_virtual = false; + PackPduAndInflate(pdu); + delete pdu; +} + + +/* + * Test that packing a DMPPDU without data works. + */ +void DMPPDUTest::testSetProperty() { + m_inflator.expected_vector = DMP_SET_PROPERTY_VECTOR; + m_inflator.expected_type = NON_RANGE; + m_inflator.expected_size = ONE_BYTES; + m_inflator.expected_virtual = false; + m_inflator.expected_relative = false; + m_inflator.expected_start = 10; + m_inflator.expected_increment = 0; + m_inflator.expected_number = 1; + + // non-range first + uint8_t data = 0xab; + OneByteDMPAddress addr(10); + DMPAddressData chunk(&addr, &data, sizeof(data)); + vector > chunks; + chunks.push_back(chunk); + const DMPPDU *pdu = NewDMPSetProperty(false, false, chunks); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 6, pdu->Size()); + PackPduAndInflate(pdu); + delete pdu; + + // ranged address + m_inflator.expected_type = RANGE_SINGLE; + m_inflator.expected_increment = 1; + m_inflator.expected_number = 20; + OneByteRangeDMPAddress range_addr(10, 1, 20); + DMPAddressData range_chunk(&range_addr, &data, + sizeof(data)); + vector > ranged_chunks; + ranged_chunks.push_back(range_chunk); + + // range single first + pdu = NewRangeDMPSetProperty(false, false, ranged_chunks, false); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 8, pdu->Size()); + PackPduAndInflate(pdu); + delete pdu; + + // range equal + m_inflator.expected_type = RANGE_EQUAL; + pdu = NewRangeDMPSetProperty(false, false, ranged_chunks); + CPPUNIT_ASSERT(pdu); + CPPUNIT_ASSERT_EQUAL((unsigned int) 8, pdu->Size()); + PackPduAndInflate(pdu); + delete pdu; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Header.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Header.h new file mode 100644 index 0000000..bcc8546 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Header.h @@ -0,0 +1,125 @@ +/* + * 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 Library 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. + * + * E131Header.h + * The E1.31 Header + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_E131HEADER_H_ +#define PLUGINS_E131_E131_E131HEADER_H_ + +#include +#include + +namespace ola { +namespace plugin { +namespace e131 { + +using std::string; + +/* + * Header for the E131 layer + */ +class E131Header { + public: + E131Header() {} + E131Header(const string &source, + uint8_t priority, + uint8_t sequence, + uint16_t universe, + bool is_preview = false, + bool has_terminated = false, + bool is_rev2 = false) + : m_source(source), + m_priority(priority), + m_sequence(sequence), + m_universe(universe), + m_is_preview(is_preview), + m_has_terminated(has_terminated), + m_is_rev2(is_rev2) { + } + ~E131Header() {} + + const string Source() const { return m_source; } + uint8_t Priority() const { return m_priority; } + uint8_t Sequence() const { return m_sequence; } + uint16_t Universe() const { return m_universe; } + bool PreviewData() const { return m_is_preview; } + bool StreamTerminated() const { return m_has_terminated; } + + bool UsingRev2() const { return m_is_rev2; } + + bool operator==(const E131Header &other) const { + return m_source == other.m_source && + m_priority == other.m_priority && + m_sequence == other.m_sequence && + m_universe == other.m_universe && + m_is_preview == other.m_is_preview && + m_has_terminated == other.m_has_terminated && + m_is_rev2 == other.m_is_rev2; + } + + enum { SOURCE_NAME_LEN = 64 }; + + struct e131_pdu_header_s { + char source[SOURCE_NAME_LEN]; + uint8_t priority; + uint16_t reserved; + uint8_t sequence; + uint8_t options; + uint16_t universe; + } __attribute__((packed)); + typedef struct e131_pdu_header_s e131_pdu_header; + + static const uint8_t PREVIEW_DATA_MASK = 0x80; + static const uint8_t STREAM_TERMINATED_MASK = 0x40; + + private: + string m_source; + uint8_t m_priority; + uint8_t m_sequence; + uint16_t m_universe; + bool m_is_preview; + bool m_has_terminated; + bool m_is_rev2; +}; + + +class E131Rev2Header: public E131Header { + public: + E131Rev2Header(const string &source, + uint8_t priority, + uint8_t sequence, + uint16_t universe, + bool is_preview = false, + bool has_terminated = false) + : E131Header(source, priority, sequence, universe, is_preview, + has_terminated, true) { + } + + enum { REV2_SOURCE_NAME_LEN = 32 }; + + typedef struct { + char source[REV2_SOURCE_NAME_LEN]; + uint8_t priority; + uint8_t sequence; + uint16_t universe; + } e131_rev2_pdu_header; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_E131HEADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Includes.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Includes.h new file mode 100644 index 0000000..97e4d52 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Includes.h @@ -0,0 +1,40 @@ +/* + * 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 Library 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. + * + * E131Include.h + * On OS X systems with ossp/uuid.h installed we need to #include + * before pulling in otherwise we get an error like: + * /opt/local/include/ossp/uuid.h:94: error: conflicting declaration 'typedef + * struct uuid_st uuid_t' + * /usr/include/unistd.h:133: error: 'uuid_t' has a previous declaration as + * 'typedef unsigned char uuid_t [16]' + * + * To work around this, we include once here, and include this + * file first in all the E1.31 code. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_E131INCLUDES_H_ +#define PLUGINS_E131_E131_E131INCLUDES_H_ + +#if HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_OSSP_UUID_H +#include +#endif + +#endif // PLUGINS_E131_E131_E131INCLUDES_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.cpp new file mode 100644 index 0000000..5d41db3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.cpp @@ -0,0 +1,122 @@ +/* + * 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 Library 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. + * + * E131Inflator.cpp + * The Inflator for the E1.31 PDUs + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/E131Inflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +/* + * Decode the E1.31 headers. If data is null we're expected to use the last + * header we got. + * @param headers the HeaderSet to add to + * @param data a pointer to the data + * @param length length of the data + * @returns true if successful, false otherwise + */ +bool E131Inflator::DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + if (data) { + // the header bit was set, decode it + if (length >= sizeof(E131Header::e131_pdu_header)) { + E131Header::e131_pdu_header raw_header; + memcpy(&raw_header, data, sizeof(E131Header::e131_pdu_header)); + raw_header.source[E131Header::SOURCE_NAME_LEN - 1] = 0x00; + E131Header header( + raw_header.source, + raw_header.priority, + raw_header.sequence, + NetworkToHost(raw_header.universe), + raw_header.options & E131Header::PREVIEW_DATA_MASK, + raw_header.options & E131Header::STREAM_TERMINATED_MASK); + m_last_header = header; + m_last_header_valid = true; + headers.SetE131Header(header); + bytes_used = sizeof(E131Header::e131_pdu_header); + return true; + } + bytes_used = 0; + return false; + } + + // use the last header if it exists + bytes_used = 0; + if (!m_last_header_valid) { + OLA_WARN << "Missing E131 Header data"; + return false; + } + headers.SetE131Header(m_last_header); + return true; +} + + +/* + * Decode the E1.31 headers. If data is null we're expected to use the last + * header we got. + * @param headers the HeaderSet to add to + * @param data a pointer to the data + * @param length length of the data + * @returns true if successful, false otherwise + */ +bool E131InflatorRev2::DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + if (data) { + // the header bit was set, decode it + if (length >= sizeof(E131Rev2Header::e131_rev2_pdu_header)) { + E131Rev2Header::e131_rev2_pdu_header raw_header; + memcpy(&raw_header, data, sizeof(E131Rev2Header::e131_rev2_pdu_header)); + raw_header.source[E131Rev2Header::REV2_SOURCE_NAME_LEN - 1] = 0x00; + E131Rev2Header header(raw_header.source, + raw_header.priority, + raw_header.sequence, + NetworkToHost(raw_header.universe)); + m_last_header = header; + m_last_header_valid = true; + headers.SetE131Header(header); + bytes_used = sizeof(E131Rev2Header::e131_rev2_pdu_header); + return true; + } + bytes_used = 0; + return false; + } + + // use the last header if it exists + bytes_used = 0; + if (!m_last_header_valid) { + OLA_WARN << "Missing E131 Header data"; + return false; + } + headers.SetE131Header(m_last_header); + return true; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.h new file mode 100644 index 0000000..23085ae --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Inflator.h @@ -0,0 +1,92 @@ +/* + * 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 Library 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. + * + * E131Inflator.h + * Interface for the E131Inflator class. + * Copyright (C) 2009 Simon Newton + * + * This contains two inflators a E131Inflator as per the standard and an + * E131InflatorRev2 which implements the revision 2 draft specification. + */ + +#ifndef PLUGINS_E131_E131_E131INFLATOR_H_ +#define PLUGINS_E131_E131_E131INFLATOR_H_ + +#include "plugins/e131/e131/BaseInflator.h" +#include "plugins/e131/e131/E131Header.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class E131Inflator: public BaseInflator { + friend class E131InflatorTest; + + public: + static const unsigned int E131_VECTOR = 4; + + E131Inflator(): BaseInflator(), + m_last_header_valid(false) { + } + ~E131Inflator() {} + + uint32_t Id() const { return E131_VECTOR; } + + protected: + bool DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int len, + unsigned int &bytes_used); + + void ResetHeaderField() { + m_last_header_valid = false; + } + private: + E131Header m_last_header; + bool m_last_header_valid; +}; + + +/* + * A Revision 2 version of the inflator. + */ +class E131InflatorRev2: public BaseInflator { + friend class E131InflatorTest; + + public: + static const unsigned int E131_REV2_VECTOR = 3; + + E131InflatorRev2(): BaseInflator(), + m_last_header_valid(false) { + } + ~E131InflatorRev2() {} + + uint32_t Id() const { return E131_REV2_VECTOR; } + + protected: + bool DecodeHeader(HeaderSet &headers, const uint8_t *data, + unsigned int len, unsigned int &bytes_used); + + void ResetHeaderField() { + m_last_header_valid = false; + } + private: + E131Header m_last_header; + bool m_last_header_valid; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_E131INFLATOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131InflatorTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131InflatorTest.cpp new file mode 100644 index 0000000..8df2863 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131InflatorTest.cpp @@ -0,0 +1,201 @@ +/* + * 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 Library 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. + * + * E131InflatorTest.cpp + * Test fixture for the E131Inflator class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/E131Inflator.h" +#include "plugins/e131/e131/E131PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +class E131InflatorTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(E131InflatorTest); + CPPUNIT_TEST(testDecodeRev2Header); + CPPUNIT_TEST(testDecodeHeader); + CPPUNIT_TEST(testInflateRev2PDU); + CPPUNIT_TEST(testInflatePDU); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDecodeRev2Header(); + void testDecodeHeader(); + void testInflatePDU(); + void testInflateRev2PDU(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(E131InflatorTest); + + +/* + * Check that we can decode headers properly + */ +void E131InflatorTest::testDecodeRev2Header() { + E131Rev2Header::e131_rev2_pdu_header header; + E131InflatorRev2 inflator; + HeaderSet header_set, header_set2; + unsigned int bytes_used; + const string source_name = "foobar"; + + strncpy(header.source, source_name.data(), source_name.size() + 1); + header.priority = 99; + header.sequence = 10; + header.universe = HostToNetwork(static_cast(42)); + + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set, + reinterpret_cast(&header), + sizeof(header), + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(header), bytes_used); + E131Header decoded_header = header_set.GetE131Header(); + CPPUNIT_ASSERT(source_name == decoded_header.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 99, decoded_header.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, decoded_header.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 42, decoded_header.Universe()); + + // try an undersized header + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set, + reinterpret_cast(&header), + sizeof(header) - 1, + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test inherting the header from the prev call + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + decoded_header = header_set2.GetE131Header(); + CPPUNIT_ASSERT(source_name == decoded_header.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 99, decoded_header.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, decoded_header.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 42, decoded_header.Universe()); + + inflator.ResetHeaderField(); + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); +} + +/* + * Check that we can decode headers properly + */ +void E131InflatorTest::testDecodeHeader() { + E131Header::e131_pdu_header header; + E131Inflator inflator; + HeaderSet header_set, header_set2; + unsigned int bytes_used; + const string source_name = "foobar"; + + strncpy(header.source, source_name.data(), source_name.size() + 1); + header.priority = 99; + header.sequence = 10; + header.universe = HostToNetwork(static_cast(42)); + + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set, + reinterpret_cast(&header), + sizeof(header), + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) sizeof(header), bytes_used); + E131Header decoded_header = header_set.GetE131Header(); + CPPUNIT_ASSERT(source_name == decoded_header.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 99, decoded_header.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, decoded_header.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 42, decoded_header.Universe()); + + // try an undersized header + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set, + reinterpret_cast(&header), + sizeof(header) - 1, + bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test inherting the header from the prev call + CPPUNIT_ASSERT(inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + decoded_header = header_set2.GetE131Header(); + CPPUNIT_ASSERT(source_name == decoded_header.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 99, decoded_header.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 10, decoded_header.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 42, decoded_header.Universe()); + + inflator.ResetHeaderField(); + CPPUNIT_ASSERT(!inflator.DecodeHeader(header_set2, NULL, 0, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); +} + + +/* + * Check that we can inflate a E131 PDU that contains other PDUs + */ +void E131InflatorTest::testInflateRev2PDU() { + const string source = "foo source"; + E131Rev2Header header(source, 1, 2, 6000); + // TODO(simon): pass a DMP msg here as well + E131PDU pdu(3, header, NULL); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + E131InflatorRev2 inflator; + HeaderSet header_set; + CPPUNIT_ASSERT_EQUAL( + size, + (unsigned int) inflator.InflatePDUBlock(header_set, data, size)); + CPPUNIT_ASSERT(header == header_set.GetE131Header()); + delete[] data; +} + +/* + * Check that we can inflate a E131 PDU that contains other PDUs + */ +void E131InflatorTest::testInflatePDU() { + const string source = "foobar source"; + E131Header header(source, 1, 2, 6000); + // TODO(simon): pass a DMP msg here as well + E131PDU pdu(3, header, NULL); + CPPUNIT_ASSERT_EQUAL((unsigned int) 77, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + E131Inflator inflator; + HeaderSet header_set; + CPPUNIT_ASSERT(inflator.InflatePDUBlock(header_set, data, size)); + CPPUNIT_ASSERT(header == header_set.GetE131Header()); + delete[] data; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.cpp new file mode 100644 index 0000000..a58f885 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.cpp @@ -0,0 +1,127 @@ +/* + * 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 Library 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. + * + * E131Layer.cpp + * The E131Layer + * Copyright (C) 2007 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/DMPE131Inflator.h" +#include "plugins/e131/e131/E131Layer.h" +#include "plugins/e131/e131/E131Inflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +/* + * Create a new E131Layer + * @param root_layer the root layer to use + */ +E131Layer::E131Layer(RootLayer *root_layer) + : m_root_layer(root_layer) { + m_root_layer->AddInflator(&m_e131_inflator); + m_root_layer->AddInflator(&m_e131_rev2_inflator); + if (!m_root_layer) + OLA_WARN << "root_layer is null, this won't work"; +} + + +/* + * Send a DMPPDU + * @param header the E131Header + * @param dmp_pdu the DMPPDU to send + */ +bool E131Layer::SendDMP(const E131Header &header, const DMPPDU *dmp_pdu) { + if (!m_root_layer) + return false; + + struct in_addr addr; + if (!UniverseIP(header.Universe(), addr)) { + OLA_INFO << "could not convert universe to ip."; + return false; + } + + E131PDU pdu(DMPInflator::DMP_VECTOR, header, dmp_pdu); + unsigned int vector = E131Inflator::E131_VECTOR; + if (header.UsingRev2()) + vector = E131InflatorRev2::E131_REV2_VECTOR; + return m_root_layer->SendPDU(addr, vector, pdu); +} + + +/* + * Set the DMPInflator to use + */ +bool E131Layer::SetInflator(DMPE131Inflator *inflator) { + bool ret = !m_e131_inflator.AddInflator(inflator); + ret &= m_e131_rev2_inflator.AddInflator(inflator); + return ret; +} + + +/* + * Join a universe. + */ +bool E131Layer::JoinUniverse(unsigned int universe) { + struct in_addr addr; + + if (!m_root_layer) + return false; + + if (UniverseIP(universe, addr)) + return m_root_layer->JoinMulticast(addr); + return false; +} + + +/* + * Leave a universe + */ +bool E131Layer::LeaveUniverse(unsigned int universe) { + struct in_addr addr; + + if (!m_root_layer) + return false; + + if (UniverseIP(universe, addr)) + return m_root_layer->LeaveMulticast(addr); + return false; +} + + +/* + * Calculate the IP that corresponds to a universe. + * @param universe the universe id + * @param addr where to store the address + * @return true if this is a valid E1.31 universe, false otherwise + */ +bool E131Layer::UniverseIP(unsigned int universe, struct in_addr &addr) { + addr.s_addr = HostToNetwork(239 << 24 | 255 << 16 | (universe & 0xFF00) | + (universe & 0xFF)); + if (universe && (universe & 0xFFFF) != 0xFFFF) + return true; + + OLA_WARN << "universe " << universe << " isn't a valid E1.31 universe"; + return false; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.h new file mode 100644 index 0000000..1a97107 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Layer.h @@ -0,0 +1,60 @@ +/* + * 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 Library 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. + * + * E131Layer.h + * Interface for the E131Layer class, this abstracts the encapsulation and + * sending of DMP PDUs contained within E131PDUs as well as the setting of + * the DMP inflator inflator. + * Copyright (C) 2007 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_E131LAYER_H_ +#define PLUGINS_E131_E131_E131LAYER_H_ + +#include "plugins/e131/e131/DMPPDU.h" +#include "plugins/e131/e131/E131Header.h" +#include "plugins/e131/e131/E131Inflator.h" +#include "plugins/e131/e131/E131PDU.h" +#include "plugins/e131/e131/RootLayer.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class DMPInflator; + +class E131Layer { + public: + explicit E131Layer(RootLayer *root_layer); + ~E131Layer() {} + + bool SendDMP(const E131Header &header, const DMPPDU *pdu); + bool SetInflator(class DMPE131Inflator *inflator); + bool JoinUniverse(unsigned int universe); + bool LeaveUniverse(unsigned int universe); + + private: + RootLayer *m_root_layer; + E131Inflator m_e131_inflator; + E131InflatorRev2 m_e131_rev2_inflator; + + E131Layer(const E131Layer&); + E131Layer& operator=(const E131Layer&); + bool UniverseIP(unsigned int universe, struct in_addr &addr); +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_E131LAYER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.cpp new file mode 100644 index 0000000..52694fa --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.cpp @@ -0,0 +1,302 @@ +/* + * 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 Library 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. + * + * E131Node.cpp + * A E131 node + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "plugins/e131/e131/E131Node.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using std::string; +using ola::Closure; +using ola::DmxBuffer; + + +/* + * Create a new node + * @param ip_address the IP address to prefer to listen on + * @param cid, the CID to use, if not provided we generate one + * one. + */ +E131Node::E131Node(const string &ip_address, + const CID &cid, + bool use_rev2, + bool ignore_preview, + uint8_t dscp_value, + uint16_t port) + : m_preferred_ip(ip_address), + m_cid(cid), + m_use_rev2(use_rev2), + m_dscp(dscp_value), + m_transport(port), + m_root_layer(&m_transport, m_cid), + m_e131_layer(&m_root_layer), + m_dmp_inflator(&m_e131_layer, ignore_preview), + m_send_buffer(NULL) { + + if (!m_use_rev2) { + // Allocate a buffer for the dmx data + start code + m_send_buffer = new uint8_t[DMX_UNIVERSE_SIZE + 1]; + m_send_buffer[0] = 0; // start code is 0 + } +} + + +/* + * Cleanup + */ +E131Node::~E131Node() { + Stop(); + if (m_send_buffer) + delete[] m_send_buffer; +} + + +/* + * Start this node + */ +bool E131Node::Start() { + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&m_interface, m_preferred_ip)) { + OLA_INFO << "Failed to find an interface"; + delete picker; + return false; + } + delete picker; + + if (!m_transport.Init(m_interface)) { + return false; + } + + ola::network::UdpSocket *socket = m_transport.GetSocket(); + socket->SetTos(m_dscp); + + m_e131_layer.SetInflator(&m_dmp_inflator); + return true; +} + + +/* + * Stop this node + */ +bool E131Node::Stop() { + return true; +} + + +/* + * Set the name for a universe + */ +bool E131Node::SetSourceName(unsigned int universe, const string &source) { + map::iterator iter = + m_tx_universes.find(universe); + + if (iter == m_tx_universes.end()) { + tx_universe *settings = SetupOutgoingSettings(universe); + settings->source = source; + } else { + iter->second.source = source; + } + return true; +} + + +/* + * Send some DMX data + * @param universe the id of the universe to send + * @param buffer the DMX data + * @param priority the priority to use + * @param preview set to true to turn on the preview bit + * @return true if it was sent successfully, false otherwise + */ +bool E131Node::SendDMX(uint16_t universe, + const ola::DmxBuffer &buffer, + uint8_t priority, + bool preview) { + return SendDMXWithSequenceOffset(universe, buffer, 0, priority, preview); +} + + +/* + * Send some DMX data, allowing finer grained control of parameters. + * @param universe the id of the universe to send + * @param buffer the DMX data + * @param cid the cid to send from + * @param sequence_offset used to twiddle the sequence numbers, this doesn't + * increment the sequence counter. + * @param priority the priority to use + * @param preview set to true to turn on the preview bit + * @return true if it was sent successfully, false otherwise + */ +bool E131Node::SendDMXWithSequenceOffset(uint16_t universe, + const ola::DmxBuffer &buffer, + int8_t sequence_offset, + uint8_t priority, + bool preview) { + map::iterator iter = + m_tx_universes.find(universe); + tx_universe *settings; + + if (iter == m_tx_universes.end()) + settings = SetupOutgoingSettings(universe); + else + settings = &iter->second; + + const uint8_t *dmp_data; + unsigned int dmp_data_length; + + if (m_use_rev2) { + dmp_data = buffer.GetRaw(); + dmp_data_length = buffer.Size(); + } else { + unsigned int data_size = DMX_UNIVERSE_SIZE; + buffer.Get(m_send_buffer + 1, &data_size); + dmp_data = m_send_buffer; + dmp_data_length = data_size + 1; + } + + TwoByteRangeDMPAddress range_addr(0, 1, (uint16_t) dmp_data_length); + DMPAddressData range_chunk(&range_addr, + dmp_data, + dmp_data_length); + vector > ranged_chunks; + ranged_chunks.push_back(range_chunk); + const DMPPDU *pdu = NewRangeDMPSetProperty(true, + false, + ranged_chunks); + + E131Header header(settings->source, + priority, + static_cast(settings->sequence + sequence_offset), + universe, + preview, // preview + false, // terminated + m_use_rev2); + + bool result = m_e131_layer.SendDMP(header, pdu); + if (result && !sequence_offset) + settings->sequence++; + delete pdu; + return result; +} + + +/* + * Signal termination of this stream for a universe. + * @param universe the id of the universe to send + * @param priority the priority to use, this doesn't actually make a + * difference. + */ +bool E131Node::StreamTerminated(uint16_t universe, + const ola::DmxBuffer &buffer, + uint8_t priority) { + map::iterator iter = + m_tx_universes.find(universe); + + string source_name; + uint8_t sequence_number; + + if (iter == m_tx_universes.end()) { + source_name = ""; + sequence_number = 0; + } else { + source_name = iter->second.source; + sequence_number = iter->second.sequence; + } + + unsigned int data_size = DMX_UNIVERSE_SIZE; + buffer.Get(m_send_buffer + 1, &data_size); + + TwoByteRangeDMPAddress range_addr(0, 1, (uint16_t) data_size); + DMPAddressData range_chunk(&range_addr, + m_send_buffer, + data_size + 1); + vector > ranged_chunks; + ranged_chunks.push_back(range_chunk); + const DMPPDU *pdu = NewRangeDMPSetProperty(true, + false, + ranged_chunks); + + E131Header header(source_name, + priority, + sequence_number, + universe, + false, // preview + true, // terminated + false); + + bool result = m_e131_layer.SendDMP(header, pdu); + // only update if we were previously tracking this universe + if (result && iter != m_tx_universes.end()) + iter->second.sequence++; + delete pdu; + return result; +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool E131Node::SetHandler(unsigned int universe, + DmxBuffer *buffer, + uint8_t *priority, + Closure *closure) { + return m_dmp_inflator.SetHandler(universe, buffer, priority, closure); +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool E131Node::RemoveHandler(unsigned int universe) { + return m_dmp_inflator.RemoveHandler(universe); +} + + +/* + * Create a settings entry for an outgoing universe + */ +E131Node::tx_universe *E131Node::SetupOutgoingSettings(unsigned int universe) { + tx_universe settings; + std::stringstream str; + str << "Universe " << universe; + settings.source = str.str(); + settings.sequence = 0; + map::iterator iter = + m_tx_universes.insert( + std::pair(universe, settings)).first; + return &iter->second; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.h new file mode 100644 index 0000000..d45b620 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Node.h @@ -0,0 +1,107 @@ +/* + * 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 Library 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. + * + * E131Node.h + * Header file for the E131Node class, this is the interface between OLA and + * the E1.31 library. + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_E131NODE_H_ +#define PLUGINS_E131_E131_E131NODE_H_ + +#include +#include +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/network/Interface.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/E131Layer.h" +#include "plugins/e131/e131/RootLayer.h" +#include "plugins/e131/e131/UDPTransport.h" +#include "plugins/e131/e131/DMPE131Inflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class E131Node { + public: + E131Node(const std::string &ip_address, + const CID &cid = CID::Generate(), + bool use_rev2 = false, + bool ignore_preview = true, + uint8_t dscp_value = 0, // default off + uint16_t port = UDPTransport::ACN_PORT); + ~E131Node(); + + bool Start(); + bool Stop(); + + bool SetSourceName(unsigned int universe, const string &source); + bool SendDMX(uint16_t universe, + const ola::DmxBuffer &buffer, + uint8_t priority = DEFAULT_PRIORITY, + bool preview = false); + + // The following method is provided for the testing framework. Don't use + // it in production code! + bool SendDMXWithSequenceOffset(uint16_t universe, + const ola::DmxBuffer &buffer, + int8_t sequence_offset, + uint8_t priority = DEFAULT_PRIORITY, + bool preview = false); + + bool StreamTerminated(uint16_t universe, + const ola::DmxBuffer &buffer = DmxBuffer(), + uint8_t priority = DEFAULT_PRIORITY); + + bool SetHandler(unsigned int universe, ola::DmxBuffer *buffer, + uint8_t *priority, ola::Closure *handler); + bool RemoveHandler(unsigned int universe); + + const ola::network::Interface &GetInterface() const { return m_interface; } + + ola::network::UdpSocket* GetSocket() { return m_transport.GetSocket(); } + + private: + typedef struct { + string source; + uint8_t sequence; + } tx_universe; + + string m_preferred_ip; + ola::network::Interface m_interface; + CID m_cid; + bool m_use_rev2; + uint8_t m_dscp; + UDPTransport m_transport; + RootLayer m_root_layer; + E131Layer m_e131_layer; + DMPE131Inflator m_dmp_inflator; + map m_tx_universes; + uint8_t *m_send_buffer; + + tx_universe *SetupOutgoingSettings(unsigned int universe); + + E131Node(const E131Node&); + E131Node& operator=(const E131Node&); + + static const uint16_t DEFAULT_PRIORITY = 100; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_E131NODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.cpp new file mode 100644 index 0000000..c7fdd6a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.cpp @@ -0,0 +1,108 @@ +/* + * 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 Library 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. + * + * E131PDU.cpp + * The E131PDU + * Copyright (C) 2007-2009 Simon Newton + */ + + +#include +#include +#include +#include "plugins/e131/e131/E131PDU.h" +#include "plugins/e131/e131/DMPPDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +/* + * Size of the header portion. + */ +unsigned int E131PDU::HeaderSize() const { + if (m_header.UsingRev2()) + return sizeof(E131Rev2Header::e131_rev2_pdu_header); + else + return sizeof(E131Header::e131_pdu_header); +} + + +/* + * Size of the data portion + */ +unsigned int E131PDU::DataSize() const { + if (m_dmp_pdu) + return m_dmp_pdu->Size(); + return 0; +} + + +/* + * Pack the header portion. + */ +bool E131PDU::PackHeader(uint8_t *data, unsigned int &length) const { + unsigned int header_size = static_cast(m_header.UsingRev2() ? + sizeof(E131Rev2Header::e131_rev2_pdu_header) : + sizeof(E131Header::e131_pdu_header)); + + if (length < header_size) { + OLA_WARN << "E131PDU::PackHeader: buffer too small, got " << length << + " required " << sizeof(E131Rev2Header::e131_pdu_header); + length = 0; + return false; + } + + if (m_header.UsingRev2()) { + E131Rev2Header::e131_rev2_pdu_header header; + strncpy(header.source, m_header.Source().data(), + E131Rev2Header::REV2_SOURCE_NAME_LEN); + header.priority = m_header.Priority(); + header.sequence = m_header.Sequence(); + header.universe = HostToNetwork(m_header.Universe()); + length = sizeof(E131Rev2Header::e131_rev2_pdu_header); + memcpy(data, &header, length); + } else { + E131Header::e131_pdu_header header; + strncpy(header.source, m_header.Source().data(), + E131Header::SOURCE_NAME_LEN); + header.priority = m_header.Priority(); + header.reserved = 0; + header.sequence = m_header.Sequence(); + header.options = static_cast( + (m_header.PreviewData() ? E131Header::PREVIEW_DATA_MASK : 0) | + (m_header.StreamTerminated() ? E131Header::STREAM_TERMINATED_MASK : 0)); + header.universe = HostToNetwork(m_header.Universe()); + length = sizeof(E131Header::e131_pdu_header); + memcpy(data, &header, length); + } + return true; +} + + +/* + * Pack the data portion. + */ +bool E131PDU::PackData(uint8_t *data, unsigned int &length) const { + if (m_dmp_pdu) + return m_dmp_pdu->Pack(data, length); + length = 0; + return true; +} +} // ola +} // e131 +} // plugin diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.h new file mode 100644 index 0000000..3356ee0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDU.h @@ -0,0 +1,55 @@ +/* + * 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 Library 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. + * + * E131PDU.h + * Interface for the E131PDU class + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_E131PDU_H_ +#define PLUGINS_E131_E131_E131PDU_H_ + +#include "plugins/e131/e131/PDU.h" +#include "plugins/e131/e131/E131Header.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class DMPPDU; + +class E131PDU: public PDU { + public: + E131PDU(unsigned int vector, + const E131Header &header, + const DMPPDU *dmp_pdu): + PDU(vector), + m_header(header), + m_dmp_pdu(dmp_pdu) {} + ~E131PDU() {} + + unsigned int HeaderSize() const; + unsigned int DataSize() const; + bool PackHeader(uint8_t *data, unsigned int &length) const; + bool PackData(uint8_t *data, unsigned int &length) const; + + private: + E131Header m_header; + const DMPPDU *m_dmp_pdu; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_E131PDU_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDUTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDUTest.cpp new file mode 100644 index 0000000..0a35eb0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131PDUTest.cpp @@ -0,0 +1,162 @@ +/* + * 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 Library 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. + * + * E131PDUTest.cpp + * Test fixture for the E131PDU class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include + +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/E131PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +class E131PDUTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(E131PDUTest); + CPPUNIT_TEST(testSimpleRev2E131PDU); + CPPUNIT_TEST(testSimpleE131PDU); + CPPUNIT_TEST(testNestedE131PDU); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSimpleRev2E131PDU(); + void testSimpleE131PDU(); + void testNestedE131PDU(); + private: + static const unsigned int TEST_VECTOR; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(E131PDUTest); + +const unsigned int E131PDUTest::TEST_VECTOR = 39; + + +/* + * Test that packing a E131PDU without data works. + */ +void E131PDUTest::testSimpleRev2E131PDU() { + const string source = "foo source"; + E131Rev2Header header(source, 1, 2, 6000); + E131PDU pdu(TEST_VECTOR, header, NULL); + + CPPUNIT_ASSERT_EQUAL((unsigned int) 36, pdu.HeaderSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, pdu.DataSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + // spot check the data + CPPUNIT_ASSERT_EQUAL((uint8_t) 0x70, data[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) bytes_used, data[1]); + + unsigned int actual_value; + memcpy(&actual_value, data + 2, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) HostToNetwork(TEST_VECTOR), + actual_value); + + CPPUNIT_ASSERT(!memcmp(&data[6], source.data(), source.length())); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, + data[6 + E131Rev2Header::REV2_SOURCE_NAME_LEN]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, + data[7 + E131Rev2Header::REV2_SOURCE_NAME_LEN]); + CPPUNIT_ASSERT_EQUAL( + HostToNetwork((uint16_t) 6000), + *(reinterpret_cast( + data + 8 + E131Rev2Header::REV2_SOURCE_NAME_LEN))); + + // test undersized buffer + bytes_used = size - 1; + CPPUNIT_ASSERT(!pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test oversized buffer + bytes_used = size + 1; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + delete[] data; +} + + +/* + * Test that packing a E131PDU without data works. + */ +void E131PDUTest::testSimpleE131PDU() { + const string source = "foo source"; + E131Header header(source, 1, 2, 6000, true, true); + E131PDU pdu(TEST_VECTOR, header, NULL); + + CPPUNIT_ASSERT_EQUAL((unsigned int) 71, pdu.HeaderSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, pdu.DataSize()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 77, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + // spot check the data + CPPUNIT_ASSERT_EQUAL((uint8_t) 0x70, data[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) bytes_used, data[1]); + unsigned int actual_value; + memcpy(&actual_value, data + 2, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) HostToNetwork(TEST_VECTOR), + actual_value); + + CPPUNIT_ASSERT(!memcmp(&data[6], source.data(), source.length())); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, data[6 + E131Header::SOURCE_NAME_LEN]); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, data[9 + E131Header::SOURCE_NAME_LEN]); + uint16_t actual_universe; + memcpy(&actual_universe, data + 11 + E131Header::SOURCE_NAME_LEN, + sizeof(actual_universe)); + CPPUNIT_ASSERT_EQUAL(HostToNetwork((uint16_t) 6000), actual_universe); + + // test undersized buffer + bytes_used = size - 1; + CPPUNIT_ASSERT(!pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test oversized buffer + bytes_used = size + 1; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + delete[] data; +} + + +/* + * Test that packing a E131PDU with nested data works + */ +void E131PDUTest::testNestedE131PDU() { + // TODO(simon): add this test +} +} // ola +} // e131 +} // plugin diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.cpp new file mode 100644 index 0000000..5279421 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.cpp @@ -0,0 +1,212 @@ +/* + * 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 Library 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. + * + * E131TestFramework.cpp + * Allows testing of a remote E1.31 implementation. + * Copyright (C) 2010 Simon Newton + * + * The remote node needs to be listening for Universe 1. + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/Logging.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/E131Node.h" +#include "plugins/e131/e131/E131TestFramework.h" + + +using ola::DmxBuffer; +using ola::network::SelectServer; +using ola::plugin::e131::CID; +using ola::plugin::e131::E131Node; +using std::cout; +using std::endl; +using std::string; + + +bool StateManager::Init() { + m_cid1 = CID::Generate(); + m_cid2 = CID::Generate(); + m_ss = new SelectServer(); + + if (!m_interactive) { + // local node test + CID local_cid = CID::Generate(); + m_local_node = new E131Node("", local_cid); + assert(m_local_node->Start()); + assert(m_ss->AddSocket(m_local_node->GetSocket())); + + assert(m_local_node->SetHandler( + UNIVERSE_ID, + &m_recv_buffer, + NULL, // don't track the priority + ola::NewClosure(this, &StateManager::NewDMX))); + } + + m_node1 = new E131Node("", m_cid1, false, true, 0, 5567); + m_node2 = new E131Node("", m_cid2, false, true, 0, 5569); + assert(m_node1->Start()); + assert(m_node2->Start()); + assert(m_ss->AddSocket(m_node1->GetSocket())); + assert(m_ss->AddSocket(m_node2->GetSocket())); + m_node1->SetSourceName(UNIVERSE_ID, "E1.31 Merge Test Node 1"); + m_node2->SetSourceName(UNIVERSE_ID, "E1.31 Merge Test Node 2"); + + // setup notifications for stdin & turn off buffering + m_stdin_socket.SetOnData(ola::NewClosure(this, &StateManager::Input)); + m_ss->AddSocket(&m_stdin_socket); + tcgetattr(STDIN_FILENO, &m_old_tc); + termios new_tc = m_old_tc; + new_tc.c_lflag &= (~ICANON & ~ECHO); + tcsetattr(STDIN_FILENO, TCSANOW, &new_tc); + + // tick every 200ms + m_ss->RegisterRepeatingTimeout( + TICK_INTERVAL_MS, + ola::NewClosure(this, &StateManager::Tick)); + + cout << endl; + cout << "========= E1.31 Tester ==========" << endl; + if (m_interactive) { + cout << "Space for the next state, 'e' for expected results, 'q' to quit" + << endl; + } + + EnterState(m_states[0]); + return true; +} + + +StateManager::~StateManager() { + tcsetattr(STDIN_FILENO, TCSANOW, &m_old_tc); + assert(m_ss->RemoveSocket(m_node1->GetSocket())); + assert(m_ss->RemoveSocket(m_node2->GetSocket())); + + if (m_local_node) { + assert(m_ss->RemoveSocket(m_local_node->GetSocket())); + delete m_local_node; + } + + delete m_ss; + delete m_node1; + delete m_node2; +} + + +bool StateManager::Tick() { + if (m_ticker > (TIME_PER_STATE_MS / TICK_INTERVAL_MS)) { + NextState(); + if (m_count == m_states.size()) + return false; + } else { + m_ticker++; + } + m_states[m_count]->Tick(); + switch (m_ticker % 4) { + case 0: + cout << "|"; + break; + case 1: + cout << "/"; + break; + case 2: + cout << "-"; + break; + case 3: + cout << "\\"; + break; + } + cout << static_cast(0x8) << std::flush; + return true; +} + + +void StateManager::Input() { + switch (getchar()) { + case 'e': + cout << m_states[m_count]->ExpectedResults() << endl; + break; + case 'q': + m_ss->Terminate(); + ShowStatus(); + break; + case ' ': + NextState(); + break; + default: + break; + } +} + + +/* + * Called when new DMX is recieved by the local node + */ +void StateManager::NewDMX() { + if (!m_states[m_count]->Verify(m_recv_buffer)) + cout << "FAILED TEST" << endl; +} + + +/* + * Switch states + */ +void StateManager::EnterState(TestState *state) { + cout << "------------------------------------" << endl; + cout << "Test Case: " << static_cast(m_count + 1) << "/" << + m_states.size() << endl; + cout << "Test Name: " << state->StateName() << endl; + state->SetNodes(m_node1, m_node2); + m_ticker = 0; +} + + +void StateManager::NextState() { + if (!m_states[m_count]->Passed()) + m_failed_tests.push_back(m_states[m_count]); + + m_count++; + if (m_count == m_states.size()) { + cout << "------------------------------------" << endl; + cout << "Tests complete!" << endl; + ShowStatus(); + m_ss->Terminate(); + } else { + EnterState(m_states[m_count]); + } +} + +void StateManager::ShowStatus() { + if (m_failed_tests.size()) { + cout << "Some tests failed:" << endl; + std::vector::iterator iter; + for (iter = m_failed_tests.begin(); iter != m_failed_tests.end(); ++iter) { + cout << " " << (*iter)->StateName() << endl; + } + } else { + cout << "All tests passed." << endl; + } +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.h new file mode 100644 index 0000000..c03dd68 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131TestFramework.h @@ -0,0 +1,350 @@ +/* + * 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 Library 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. + * + * E131TestFramework.h + * Allows testing of a remote E1.31 implementation. + * Copyright (C) 2010 Simon Newton + * + * The remote node needs to be listening for Universe 1. + */ + +#ifndef PLUGINS_E131_E131_E131TESTFRAMEWORK_H_ +#define PLUGINS_E131_E131_E131TESTFRAMEWORK_H_ + +#include +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/DmxBuffer.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/E131Node.h" + +using ola::DmxBuffer; +using ola::network::SelectServer; +using ola::plugin::e131::CID; +using ola::plugin::e131::E131Node; +using std::cout; +using std::endl; +using std::string; + +static const unsigned int UNIVERSE_ID = 1; + + +/* + * NodeAction, this reflects an action to be performed on a node. + */ +class NodeAction { + public: + virtual ~NodeAction() {} + void SetNode(E131Node *node) { m_node = node; } + virtual void Tick() {} + protected: + E131Node *m_node; +}; + + +/* + * A TestState, this represents a particular state of the testing engine. This + * one specifies the behaviour of two nodes. + */ +class TestState { + public: + TestState(const string &name, + NodeAction *action1, + NodeAction *action2, + const string &expected, + const DmxBuffer &expected_result): + m_passed(true), + m_expected_result(expected_result), + m_name(name), + m_expected(expected), + m_action1(action1), + m_action2(action2) { + } + virtual ~TestState() { + delete m_action1; + delete m_action2; + } + + void SetNodes(E131Node *node1, E131Node *node2) { + m_action1->SetNode(node1); + m_action2->SetNode(node2); + } + + void Tick() { + m_action1->Tick(); + m_action2->Tick(); + } + + virtual bool Verify(const DmxBuffer &data) { + if (!(data == m_expected_result)) + return m_passed = false; + return true; + } + + string StateName() const { return m_name; } + string ExpectedResults() const { return m_expected; } + + bool Passed() const { + return m_passed; + } + + protected: + bool m_passed; + DmxBuffer m_expected_result; + private: + string m_name, m_expected; + NodeAction *m_action1, *m_action2; +}; + + +/* + * This is similar to a TestStart but it checks for a particular first packet. + * It's useful for state transitions. + */ +class RelaxedTestState: public TestState { + public: + RelaxedTestState(const string &name, + NodeAction *action1, + NodeAction *action2, + const string &expected, + const DmxBuffer &expected_first_result, + const DmxBuffer &expected_result): + TestState(name, action1, action2, expected, expected_result), + m_first(true), + m_expected_first_result(expected_first_result) { + } + + bool Verify(const DmxBuffer &buffer) { + if (m_first) { + m_first = false; + if (!(m_expected_first_result == buffer)) + return m_passed = false; + return true; + } else { + if (!(m_expected_result == buffer)) + return m_passed = false; + return true; + } + } + + private: + bool m_first; + DmxBuffer m_expected_first_result; +}; + + +/* + * This is similar to a TestStart but it checks for one style of packet, + * followed by another. It's useful for state transitions. + */ +class OrderedTestState: public TestState { + public: + OrderedTestState(const string &name, + NodeAction *action1, + NodeAction *action2, + const string &expected, + const DmxBuffer &expected_first_result, + const DmxBuffer &expected_result): + TestState(name, action1, action2, expected, expected_result), + m_found_second(false), + m_expected_first_result(expected_first_result) { + } + + bool Verify(const DmxBuffer &buffer) { + if (m_found_second) { + if (!(m_expected_result == buffer)) + return m_passed = false; + return true; + } else { + if (m_expected_result == buffer) { + m_found_second = true; + return true; + } + if (!(m_expected_first_result == buffer)) + return m_passed = false; + return true; + } + } + + private: + bool m_found_second; + DmxBuffer m_expected_first_result; +}; + + +/* + * This action does nothing. + */ +class NodeInactive: public NodeAction { + public: + NodeInactive() {} + void Tick() {} +}; + + +/* + * This action just sends some data wil the selected priority. + */ +class NodeSimpleSend: public NodeAction { + public: + NodeSimpleSend(uint8_t priority, const string &data = ""): + m_priority(priority) { + if (data.empty()) + m_buffer.SetRangeToValue(0, m_priority, DMX_UNIVERSE_SIZE); + else + m_buffer.SetFromString(data); + } + void Tick() { + m_node->SendDMX(UNIVERSE_ID, m_buffer, m_priority); + } + + private: + DmxBuffer m_buffer; + uint8_t m_priority; +}; + + +/* + * This action sends a terminated msg the does nothing. + */ +class NodeTerminate: public NodeAction { + public: + NodeTerminate(): + m_sent(false) { + } + void Tick() { + if (!m_sent) + m_node->StreamTerminated(UNIVERSE_ID); + m_sent = true; + } + private: + bool m_sent; +}; + + +/* + * This state sends a terminated msg with data then does nothing + */ +class NodeTerminateWithData: public NodeAction { + public: + explicit NodeTerminateWithData(uint8_t data): + m_data(data), + m_sent(false) { + } + void Tick() { + if (!m_sent) { + DmxBuffer output; + output.SetRangeToValue(0, m_data, DMX_UNIVERSE_SIZE); + m_node->StreamTerminated(UNIVERSE_ID, output); + } + m_sent = true; + } + private: + uint8_t m_data; + bool m_sent; +}; + + +/* + * This state sends data and occasionally sends old packets to test sequence # + * handling. + */ +class NodeVarySequenceNumber: public NodeAction { + public: + NodeVarySequenceNumber(uint8_t good_value, uint8_t bad_value, + unsigned int chance): + m_counter(0), + m_chance(chance), + m_good(good_value), + m_bad(bad_value) { + srand((unsigned)time(0) * getpid()); + } + + void Tick() { + int random = (rand() / (RAND_MAX / m_chance)); + if (!m_counter || random % m_chance) { + // start off with good data + DmxBuffer output; + output.SetRangeToValue(0, m_good, DMX_UNIVERSE_SIZE); + m_node->SendDMX(UNIVERSE_ID, output); + } else { + // fake an old packet + DmxBuffer output; + output.SetRangeToValue(0, m_bad, DMX_UNIVERSE_SIZE); + int offset = 1 + (rand() / (RAND_MAX / 18)); + m_node->SendDMXWithSequenceOffset(UNIVERSE_ID, output, + static_cast(-offset)); + } + m_counter++; + } + private: + unsigned int m_counter, m_chance; + uint8_t m_good, m_bad; +}; + + +/* + * The state manager can run in one of three modes: + * - local, non-interactive. This starts a local E131Node and sends it data, + * verifying against the expected output. + * - interactive mode. This sends data to the multicast addresses and a human + * gets to verify it. + */ +class StateManager { + public: + StateManager(const std::vector &states, + bool interactive_mode = false): + m_interactive(interactive_mode), + m_count(0), + m_ticker(0), + m_local_node(NULL), + m_node1(NULL), + m_node2(NULL), + m_ss(NULL), + m_states(states), + m_stdin_socket(STDIN_FILENO) { + } + ~StateManager(); + bool Init(); + void Run() { m_ss->Run(); } + bool Tick(); + void Input(); + void NewDMX(); + bool Passed() const { return m_failed_tests.size() == 0; } + + private: + bool m_interactive; + unsigned int m_count, m_ticker; + termios m_old_tc; + CID m_cid1, m_cid2; + E131Node *m_local_node, *m_node1, *m_node2; + SelectServer *m_ss; + std::vector m_states; + ola::network::UnmanagedSocket m_stdin_socket; + DmxBuffer m_recv_buffer; + std::vector m_failed_tests; + + void EnterState(TestState *state); + void NextState(); + void ShowStatus(); + + static const unsigned int TICK_INTERVAL_MS = 100; + static const unsigned int TIME_PER_STATE_MS = 3000; +}; +#endif // PLUGINS_E131_E131_E131TESTFRAMEWORK_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Tester.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Tester.cpp new file mode 100644 index 0000000..163cf13 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/E131Tester.cpp @@ -0,0 +1,36 @@ +/* + * 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 Library 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. + * + * E131Tester.cpp + * Runs all the E131 tests + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSet.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSet.h new file mode 100644 index 0000000..17771eb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSet.h @@ -0,0 +1,62 @@ +/* + * 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 Library 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. + * + * HeaderSet.h + * Interface for the HeaderSet class + * HeaderSet is passed down the parsing stack and contains a collection of PDU + * headers + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_HEADERSET_H_ +#define PLUGINS_E131_E131_HEADERSET_H_ + +#include "plugins/e131/e131/RootHeader.h" +#include "plugins/e131/e131/E131Header.h" +#include "plugins/e131/e131/DMPHeader.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class HeaderSet { + public: + HeaderSet() {} + ~HeaderSet() {} + + const RootHeader &GetRootHeader() const { return m_root_header; } + void SetRootHeader(RootHeader &header) { m_root_header = header; } + + const E131Header &GetE131Header() const { return m_e131_header; } + void SetE131Header(E131Header &header) { m_e131_header = header; } + + const DMPHeader &GetDMPHeader() const { return m_dmp_header; } + void SetDMPHeader(DMPHeader &header) { m_dmp_header = header; } + + bool operator==(const HeaderSet &other) const { + return m_root_header == other.m_root_header && + m_e131_header == other.m_e131_header && + m_dmp_header == other.m_dmp_header; + } + + private: + RootHeader m_root_header; + E131Header m_e131_header; + DMPHeader m_dmp_header; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_HEADERSET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSetTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSetTest.cpp new file mode 100644 index 0000000..cb3c08f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/HeaderSetTest.cpp @@ -0,0 +1,186 @@ +/* + * 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 Library 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. + * + * HeaderSetTest.cpp + * Test fixture for the HeaderSet class + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include + +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/CID.h" + +using ola::plugin::e131::CID; +using ola::plugin::e131::DMPHeader; +using ola::plugin::e131::E131Header; +using ola::plugin::e131::E131Rev2Header; +using ola::plugin::e131::FOUR_BYTES; +using ola::plugin::e131::HeaderSet; +using ola::plugin::e131::NON_RANGE; +using ola::plugin::e131::ONE_BYTES; +using ola::plugin::e131::RANGE_EQUAL; +using ola::plugin::e131::RootHeader; + +class HeaderSetTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(HeaderSetTest); + CPPUNIT_TEST(testRootHeader); + CPPUNIT_TEST(testE131Header); + CPPUNIT_TEST(testDMPHeader); + CPPUNIT_TEST(testHeaderSet); + CPPUNIT_TEST_SUITE_END(); + + public: + void testRootHeader(); + void testE131Header(); + void testDMPHeader(); + void testHeaderSet(); +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(HeaderSetTest); + +/* + * Check that the root header works. + */ +void HeaderSetTest::testRootHeader() { + CID cid = CID::Generate(); + RootHeader header; + header.SetCid(cid); + CPPUNIT_ASSERT(cid == header.GetCid()); + + // test copy and assign + RootHeader header2 = header; + CPPUNIT_ASSERT(cid == header2.GetCid()); + CPPUNIT_ASSERT(header2 == header); + RootHeader header3(header); + CPPUNIT_ASSERT(cid == header3.GetCid()); + CPPUNIT_ASSERT(header3 == header); +} + + +/* + * test the E1.31 Header + */ +void HeaderSetTest::testE131Header() { + E131Header header("foo", 1, 2, 2050); + CPPUNIT_ASSERT("foo" == header.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, header.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, header.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 2050, header.Universe()); + CPPUNIT_ASSERT(!header.UsingRev2()); + + // test copy and assign + E131Header header2 = header; + CPPUNIT_ASSERT(header.Source() == header2.Source()); + CPPUNIT_ASSERT_EQUAL(header.Priority(), header2.Priority()); + CPPUNIT_ASSERT_EQUAL(header.Sequence(), header2.Sequence()); + CPPUNIT_ASSERT_EQUAL(header.Universe(), header2.Universe()); + CPPUNIT_ASSERT(!header2.UsingRev2()); + + E131Header header3(header); + CPPUNIT_ASSERT(header.Source() == header3.Source()); + CPPUNIT_ASSERT_EQUAL(header.Priority(), header3.Priority()); + CPPUNIT_ASSERT_EQUAL(header.Sequence(), header3.Sequence()); + CPPUNIT_ASSERT_EQUAL(header.Universe(), header3.Universe()); + CPPUNIT_ASSERT(header == header3); + + // test a rev 2 header + E131Rev2Header header_rev2("foo", 1, 2, 2050); + CPPUNIT_ASSERT("foo" == header_rev2.Source()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 1, header_rev2.Priority()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 2, header_rev2.Sequence()); + CPPUNIT_ASSERT_EQUAL((uint16_t) 2050, header_rev2.Universe()); + CPPUNIT_ASSERT(header_rev2.UsingRev2()); + CPPUNIT_ASSERT(!(header == header_rev2)); + + E131Rev2Header header2_rev2 = header_rev2; + CPPUNIT_ASSERT(header2_rev2 == header_rev2); +} + + +/* + * test the DMP Header + */ +void HeaderSetTest::testDMPHeader() { + DMPHeader header(false, false, NON_RANGE, ONE_BYTES); + CPPUNIT_ASSERT_EQUAL(false, header.IsVirtual()); + CPPUNIT_ASSERT_EQUAL(false, header.IsRelative()); + CPPUNIT_ASSERT_EQUAL(NON_RANGE, header.Type()); + CPPUNIT_ASSERT_EQUAL(ONE_BYTES, header.Size()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0, header.Header()); + DMPHeader test_header(0); + CPPUNIT_ASSERT(test_header == header); + + DMPHeader header2(false, true, RANGE_EQUAL, FOUR_BYTES); + CPPUNIT_ASSERT_EQUAL(false, header2.IsVirtual()); + CPPUNIT_ASSERT_EQUAL(true, header2.IsRelative()); + CPPUNIT_ASSERT_EQUAL(RANGE_EQUAL, header2.Type()); + CPPUNIT_ASSERT_EQUAL(FOUR_BYTES, header2.Size()); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0x62, header2.Header()); + DMPHeader test_header2(0x62); + CPPUNIT_ASSERT(test_header2 == header2); + + // test copy and assign + DMPHeader header3 = header; + CPPUNIT_ASSERT(header3 == header); + CPPUNIT_ASSERT(header3 != header2); + + DMPHeader header4(header); + CPPUNIT_ASSERT(header4 == header); + CPPUNIT_ASSERT(header4 != header2); +} + + +/* + * Check that the header set works + */ +void HeaderSetTest::testHeaderSet() { + HeaderSet headers; + RootHeader root_header; + E131Header e131_header("e131", 1, 2, 6001); + DMPHeader dmp_header(false, false, NON_RANGE, ONE_BYTES); + + // test the root header component + CID cid = CID::Generate(); + root_header.SetCid(cid); + headers.SetRootHeader(root_header); + CPPUNIT_ASSERT(root_header == headers.GetRootHeader()); + + // test the E1.31 header component + headers.SetE131Header(e131_header); + CPPUNIT_ASSERT(e131_header == headers.GetE131Header()); + + // test the DMP headers component + headers.SetDMPHeader(dmp_header); + CPPUNIT_ASSERT(dmp_header == headers.GetDMPHeader()); + + // test assign + HeaderSet headers2 = headers; + CPPUNIT_ASSERT(root_header == headers2.GetRootHeader()); + CPPUNIT_ASSERT(e131_header == headers2.GetE131Header()); + CPPUNIT_ASSERT(dmp_header == headers2.GetDMPHeader()); + CPPUNIT_ASSERT(headers2 == headers); + + // test copy + HeaderSet headers3(headers); + CPPUNIT_ASSERT(root_header == headers3.GetRootHeader()); + CPPUNIT_ASSERT(e131_header == headers3.GetE131Header()); + CPPUNIT_ASSERT(dmp_header == headers3.GetDMPHeader()); + CPPUNIT_ASSERT(headers3 == headers); +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.am new file mode 100644 index 0000000..0ad2281 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.am @@ -0,0 +1,60 @@ +include $(top_srcdir)/common.mk + +EXTRA_DIST = BaseInflator.h CID.h \ + DMPE131Inflator.h DMPAddress.h DMPHeader.h DMPInflator.h DMPPDU.h \ + E131Header.h E131Includes.h E131Inflator.h E131Layer.h E131Node.h \ + E131PDU.h E131TestFramework.h HeaderSet.h PDU.h PDUTestCommon.h \ + RootHeader.h RootInflator.h RootLayer.h RootPDU.h \ + UDPTransport.h + +AM_CPPFLAGS += -Wconversion -W + +noinst_LTLIBRARIES = libolae131core.la libolae131tester.la +libolae131core_la_SOURCES = BaseInflator.cpp CID.cpp \ + DMPAddress.cpp DMPE131Inflator.cpp DMPInflator.cpp \ + DMPPDU.cpp \ + E131Inflator.cpp E131Layer.cpp E131Node.cpp \ + E131PDU.cpp PDU.cpp \ + RootInflator.cpp RootLayer.cpp RootPDU.cpp \ + UDPTransport.cpp +libolae131core_la_LIBADD = @LIBS@ +libolae131core_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) +libolae131tester_la_SOURCES = E131TestFramework.cpp +libolae131tester_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) \ + $(AM_CPPFLAGS) + +# test program +noinst_PROGRAMS = e131_transmit_test +e131_transmit_test_SOURCES = e131_transmit_test.cpp +e131_transmit_test_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) +e131_transmit_test_LDADD = @LIBS@ -lprotobuf \ + ./libolae131core.la \ + ./libolae131tester.la \ + ../../../common/libolacommon.la +e131_transmit_test_LDFLAGS = $(UUID_LIBS) $(OSSP_UUID_LIBS) + +# Test programs +TESTS = E131Tester +check_PROGRAMS = $(TESTS) +E131Tester_SOURCES = BaseInflatorTest.cpp \ + CIDTest.cpp \ + DMPInflatorTest.cpp \ + DMPAddressTest.cpp \ + DMPPDUTest.cpp \ + E131InflatorTest.cpp \ + E131PDUTest.cpp \ + E131Tester.cpp \ + HeaderSetTest.cpp \ + PDUTest.cpp \ + RootInflatorTest.cpp \ + RootLayerTest.cpp \ + RootPDUTest.cpp \ + UDPTransportTest.cpp +E131Tester_CPPFLAGS = $(CPPUNIT_CFLAGS) $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) \ + $(AM_CPPFLAGS) +# For some completely messed up reason on mac CPPUNIT_LIBS has to come after +# UUID_LIBS. CPPUNIT_LIBS contains -ldl which causes the unittests to fail +E131Tester_LDFLAGS = $(UUID_LIBS) $(OSSP_UUID_LIBS) $(CPPUNIT_LIBS) +E131Tester_LDADD = @LIBS@ -lprotobuf \ + ./libolae131core.la \ + ../../../common/libolacommon.la diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.in new file mode 100644 index 0000000..404d05d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/Makefile.in @@ -0,0 +1,1015 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +noinst_PROGRAMS = e131_transmit_test$(EXEEXT) +TESTS = E131Tester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = plugins/e131/e131 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolae131core_la_DEPENDENCIES = +am_libolae131core_la_OBJECTS = libolae131core_la-BaseInflator.lo \ + libolae131core_la-CID.lo libolae131core_la-DMPAddress.lo \ + libolae131core_la-DMPE131Inflator.lo \ + libolae131core_la-DMPInflator.lo libolae131core_la-DMPPDU.lo \ + libolae131core_la-E131Inflator.lo \ + libolae131core_la-E131Layer.lo libolae131core_la-E131Node.lo \ + libolae131core_la-E131PDU.lo libolae131core_la-PDU.lo \ + libolae131core_la-RootInflator.lo \ + libolae131core_la-RootLayer.lo libolae131core_la-RootPDU.lo \ + libolae131core_la-UDPTransport.lo +libolae131core_la_OBJECTS = $(am_libolae131core_la_OBJECTS) +libolae131tester_la_LIBADD = +am_libolae131tester_la_OBJECTS = \ + libolae131tester_la-E131TestFramework.lo +libolae131tester_la_OBJECTS = $(am_libolae131tester_la_OBJECTS) +am__EXEEXT_1 = E131Tester$(EXEEXT) +PROGRAMS = $(noinst_PROGRAMS) +am_E131Tester_OBJECTS = E131Tester-BaseInflatorTest.$(OBJEXT) \ + E131Tester-CIDTest.$(OBJEXT) \ + E131Tester-DMPInflatorTest.$(OBJEXT) \ + E131Tester-DMPAddressTest.$(OBJEXT) \ + E131Tester-DMPPDUTest.$(OBJEXT) \ + E131Tester-E131InflatorTest.$(OBJEXT) \ + E131Tester-E131PDUTest.$(OBJEXT) \ + E131Tester-E131Tester.$(OBJEXT) \ + E131Tester-HeaderSetTest.$(OBJEXT) \ + E131Tester-PDUTest.$(OBJEXT) \ + E131Tester-RootInflatorTest.$(OBJEXT) \ + E131Tester-RootLayerTest.$(OBJEXT) \ + E131Tester-RootPDUTest.$(OBJEXT) \ + E131Tester-UDPTransportTest.$(OBJEXT) +E131Tester_OBJECTS = $(am_E131Tester_OBJECTS) +E131Tester_DEPENDENCIES = ./libolae131core.la \ + ../../../common/libolacommon.la +E131Tester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(E131Tester_LDFLAGS) $(LDFLAGS) -o $@ +am_e131_transmit_test_OBJECTS = \ + e131_transmit_test-e131_transmit_test.$(OBJEXT) +e131_transmit_test_OBJECTS = $(am_e131_transmit_test_OBJECTS) +e131_transmit_test_DEPENDENCIES = ./libolae131core.la \ + ./libolae131tester.la ../../../common/libolacommon.la +e131_transmit_test_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(e131_transmit_test_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolae131core_la_SOURCES) $(libolae131tester_la_SOURCES) \ + $(E131Tester_SOURCES) $(e131_transmit_test_SOURCES) +DIST_SOURCES = $(libolae131core_la_SOURCES) \ + $(libolae131tester_la_SOURCES) $(E131Tester_SOURCES) \ + $(e131_transmit_test_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror \ + -Wno-deprecated -Wconversion -W +EXTRA_DIST = BaseInflator.h CID.h \ + DMPE131Inflator.h DMPAddress.h DMPHeader.h DMPInflator.h DMPPDU.h \ + E131Header.h E131Includes.h E131Inflator.h E131Layer.h E131Node.h \ + E131PDU.h E131TestFramework.h HeaderSet.h PDU.h PDUTestCommon.h \ + RootHeader.h RootInflator.h RootLayer.h RootPDU.h \ + UDPTransport.h + +noinst_LTLIBRARIES = libolae131core.la libolae131tester.la +libolae131core_la_SOURCES = BaseInflator.cpp CID.cpp \ + DMPAddress.cpp DMPE131Inflator.cpp DMPInflator.cpp \ + DMPPDU.cpp \ + E131Inflator.cpp E131Layer.cpp E131Node.cpp \ + E131PDU.cpp PDU.cpp \ + RootInflator.cpp RootLayer.cpp RootPDU.cpp \ + UDPTransport.cpp + +libolae131core_la_LIBADD = @LIBS@ +libolae131core_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) +libolae131tester_la_SOURCES = E131TestFramework.cpp +libolae131tester_la_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) \ + $(AM_CPPFLAGS) + +e131_transmit_test_SOURCES = e131_transmit_test.cpp +e131_transmit_test_CPPFLAGS = $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) $(AM_CPPFLAGS) +e131_transmit_test_LDADD = @LIBS@ -lprotobuf \ + ./libolae131core.la \ + ./libolae131tester.la \ + ../../../common/libolacommon.la + +e131_transmit_test_LDFLAGS = $(UUID_LIBS) $(OSSP_UUID_LIBS) +E131Tester_SOURCES = BaseInflatorTest.cpp \ + CIDTest.cpp \ + DMPInflatorTest.cpp \ + DMPAddressTest.cpp \ + DMPPDUTest.cpp \ + E131InflatorTest.cpp \ + E131PDUTest.cpp \ + E131Tester.cpp \ + HeaderSetTest.cpp \ + PDUTest.cpp \ + RootInflatorTest.cpp \ + RootLayerTest.cpp \ + RootPDUTest.cpp \ + UDPTransportTest.cpp + +E131Tester_CPPFLAGS = $(CPPUNIT_CFLAGS) $(UUID_CFLAGS) $(OSSP_UUID_CFLAGS) \ + $(AM_CPPFLAGS) + +# For some completely messed up reason on mac CPPUNIT_LIBS has to come after +# UUID_LIBS. CPPUNIT_LIBS contains -ldl which causes the unittests to fail +E131Tester_LDFLAGS = $(UUID_LIBS) $(OSSP_UUID_LIBS) $(CPPUNIT_LIBS) +E131Tester_LDADD = @LIBS@ -lprotobuf \ + ./libolae131core.la \ + ../../../common/libolacommon.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/e131/e131/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/e131/e131/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolae131core.la: $(libolae131core_la_OBJECTS) $(libolae131core_la_DEPENDENCIES) + $(CXXLINK) $(libolae131core_la_OBJECTS) $(libolae131core_la_LIBADD) $(LIBS) +libolae131tester.la: $(libolae131tester_la_OBJECTS) $(libolae131tester_la_DEPENDENCIES) + $(CXXLINK) $(libolae131tester_la_OBJECTS) $(libolae131tester_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +E131Tester$(EXEEXT): $(E131Tester_OBJECTS) $(E131Tester_DEPENDENCIES) + @rm -f E131Tester$(EXEEXT) + $(E131Tester_LINK) $(E131Tester_OBJECTS) $(E131Tester_LDADD) $(LIBS) +e131_transmit_test$(EXEEXT): $(e131_transmit_test_OBJECTS) $(e131_transmit_test_DEPENDENCIES) + @rm -f e131_transmit_test$(EXEEXT) + $(e131_transmit_test_LINK) $(e131_transmit_test_OBJECTS) $(e131_transmit_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-BaseInflatorTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-CIDTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-DMPAddressTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-DMPInflatorTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-DMPPDUTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-E131InflatorTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-E131PDUTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-E131Tester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-HeaderSetTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-PDUTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-RootInflatorTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-RootLayerTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-RootPDUTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131Tester-UDPTransportTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/e131_transmit_test-e131_transmit_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-BaseInflator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-CID.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-DMPAddress.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-DMPE131Inflator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-DMPInflator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-DMPPDU.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-E131Inflator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-E131Layer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-E131Node.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-E131PDU.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-PDU.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-RootInflator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-RootLayer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-RootPDU.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131core_la-UDPTransport.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolae131tester_la-E131TestFramework.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libolae131core_la-BaseInflator.lo: BaseInflator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-BaseInflator.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-BaseInflator.Tpo -c -o libolae131core_la-BaseInflator.lo `test -f 'BaseInflator.cpp' || echo '$(srcdir)/'`BaseInflator.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-BaseInflator.Tpo $(DEPDIR)/libolae131core_la-BaseInflator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BaseInflator.cpp' object='libolae131core_la-BaseInflator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-BaseInflator.lo `test -f 'BaseInflator.cpp' || echo '$(srcdir)/'`BaseInflator.cpp + +libolae131core_la-CID.lo: CID.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-CID.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-CID.Tpo -c -o libolae131core_la-CID.lo `test -f 'CID.cpp' || echo '$(srcdir)/'`CID.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-CID.Tpo $(DEPDIR)/libolae131core_la-CID.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CID.cpp' object='libolae131core_la-CID.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-CID.lo `test -f 'CID.cpp' || echo '$(srcdir)/'`CID.cpp + +libolae131core_la-DMPAddress.lo: DMPAddress.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-DMPAddress.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-DMPAddress.Tpo -c -o libolae131core_la-DMPAddress.lo `test -f 'DMPAddress.cpp' || echo '$(srcdir)/'`DMPAddress.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-DMPAddress.Tpo $(DEPDIR)/libolae131core_la-DMPAddress.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPAddress.cpp' object='libolae131core_la-DMPAddress.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-DMPAddress.lo `test -f 'DMPAddress.cpp' || echo '$(srcdir)/'`DMPAddress.cpp + +libolae131core_la-DMPE131Inflator.lo: DMPE131Inflator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-DMPE131Inflator.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-DMPE131Inflator.Tpo -c -o libolae131core_la-DMPE131Inflator.lo `test -f 'DMPE131Inflator.cpp' || echo '$(srcdir)/'`DMPE131Inflator.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-DMPE131Inflator.Tpo $(DEPDIR)/libolae131core_la-DMPE131Inflator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPE131Inflator.cpp' object='libolae131core_la-DMPE131Inflator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-DMPE131Inflator.lo `test -f 'DMPE131Inflator.cpp' || echo '$(srcdir)/'`DMPE131Inflator.cpp + +libolae131core_la-DMPInflator.lo: DMPInflator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-DMPInflator.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-DMPInflator.Tpo -c -o libolae131core_la-DMPInflator.lo `test -f 'DMPInflator.cpp' || echo '$(srcdir)/'`DMPInflator.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-DMPInflator.Tpo $(DEPDIR)/libolae131core_la-DMPInflator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPInflator.cpp' object='libolae131core_la-DMPInflator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-DMPInflator.lo `test -f 'DMPInflator.cpp' || echo '$(srcdir)/'`DMPInflator.cpp + +libolae131core_la-DMPPDU.lo: DMPPDU.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-DMPPDU.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-DMPPDU.Tpo -c -o libolae131core_la-DMPPDU.lo `test -f 'DMPPDU.cpp' || echo '$(srcdir)/'`DMPPDU.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-DMPPDU.Tpo $(DEPDIR)/libolae131core_la-DMPPDU.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPPDU.cpp' object='libolae131core_la-DMPPDU.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-DMPPDU.lo `test -f 'DMPPDU.cpp' || echo '$(srcdir)/'`DMPPDU.cpp + +libolae131core_la-E131Inflator.lo: E131Inflator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-E131Inflator.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-E131Inflator.Tpo -c -o libolae131core_la-E131Inflator.lo `test -f 'E131Inflator.cpp' || echo '$(srcdir)/'`E131Inflator.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-E131Inflator.Tpo $(DEPDIR)/libolae131core_la-E131Inflator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Inflator.cpp' object='libolae131core_la-E131Inflator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-E131Inflator.lo `test -f 'E131Inflator.cpp' || echo '$(srcdir)/'`E131Inflator.cpp + +libolae131core_la-E131Layer.lo: E131Layer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-E131Layer.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-E131Layer.Tpo -c -o libolae131core_la-E131Layer.lo `test -f 'E131Layer.cpp' || echo '$(srcdir)/'`E131Layer.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-E131Layer.Tpo $(DEPDIR)/libolae131core_la-E131Layer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Layer.cpp' object='libolae131core_la-E131Layer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-E131Layer.lo `test -f 'E131Layer.cpp' || echo '$(srcdir)/'`E131Layer.cpp + +libolae131core_la-E131Node.lo: E131Node.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-E131Node.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-E131Node.Tpo -c -o libolae131core_la-E131Node.lo `test -f 'E131Node.cpp' || echo '$(srcdir)/'`E131Node.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-E131Node.Tpo $(DEPDIR)/libolae131core_la-E131Node.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Node.cpp' object='libolae131core_la-E131Node.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-E131Node.lo `test -f 'E131Node.cpp' || echo '$(srcdir)/'`E131Node.cpp + +libolae131core_la-E131PDU.lo: E131PDU.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-E131PDU.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-E131PDU.Tpo -c -o libolae131core_la-E131PDU.lo `test -f 'E131PDU.cpp' || echo '$(srcdir)/'`E131PDU.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-E131PDU.Tpo $(DEPDIR)/libolae131core_la-E131PDU.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131PDU.cpp' object='libolae131core_la-E131PDU.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-E131PDU.lo `test -f 'E131PDU.cpp' || echo '$(srcdir)/'`E131PDU.cpp + +libolae131core_la-PDU.lo: PDU.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-PDU.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-PDU.Tpo -c -o libolae131core_la-PDU.lo `test -f 'PDU.cpp' || echo '$(srcdir)/'`PDU.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-PDU.Tpo $(DEPDIR)/libolae131core_la-PDU.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PDU.cpp' object='libolae131core_la-PDU.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-PDU.lo `test -f 'PDU.cpp' || echo '$(srcdir)/'`PDU.cpp + +libolae131core_la-RootInflator.lo: RootInflator.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-RootInflator.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-RootInflator.Tpo -c -o libolae131core_la-RootInflator.lo `test -f 'RootInflator.cpp' || echo '$(srcdir)/'`RootInflator.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-RootInflator.Tpo $(DEPDIR)/libolae131core_la-RootInflator.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootInflator.cpp' object='libolae131core_la-RootInflator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-RootInflator.lo `test -f 'RootInflator.cpp' || echo '$(srcdir)/'`RootInflator.cpp + +libolae131core_la-RootLayer.lo: RootLayer.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-RootLayer.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-RootLayer.Tpo -c -o libolae131core_la-RootLayer.lo `test -f 'RootLayer.cpp' || echo '$(srcdir)/'`RootLayer.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-RootLayer.Tpo $(DEPDIR)/libolae131core_la-RootLayer.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootLayer.cpp' object='libolae131core_la-RootLayer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-RootLayer.lo `test -f 'RootLayer.cpp' || echo '$(srcdir)/'`RootLayer.cpp + +libolae131core_la-RootPDU.lo: RootPDU.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-RootPDU.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-RootPDU.Tpo -c -o libolae131core_la-RootPDU.lo `test -f 'RootPDU.cpp' || echo '$(srcdir)/'`RootPDU.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-RootPDU.Tpo $(DEPDIR)/libolae131core_la-RootPDU.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootPDU.cpp' object='libolae131core_la-RootPDU.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-RootPDU.lo `test -f 'RootPDU.cpp' || echo '$(srcdir)/'`RootPDU.cpp + +libolae131core_la-UDPTransport.lo: UDPTransport.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131core_la-UDPTransport.lo -MD -MP -MF $(DEPDIR)/libolae131core_la-UDPTransport.Tpo -c -o libolae131core_la-UDPTransport.lo `test -f 'UDPTransport.cpp' || echo '$(srcdir)/'`UDPTransport.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131core_la-UDPTransport.Tpo $(DEPDIR)/libolae131core_la-UDPTransport.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UDPTransport.cpp' object='libolae131core_la-UDPTransport.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131core_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131core_la-UDPTransport.lo `test -f 'UDPTransport.cpp' || echo '$(srcdir)/'`UDPTransport.cpp + +libolae131tester_la-E131TestFramework.lo: E131TestFramework.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131tester_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libolae131tester_la-E131TestFramework.lo -MD -MP -MF $(DEPDIR)/libolae131tester_la-E131TestFramework.Tpo -c -o libolae131tester_la-E131TestFramework.lo `test -f 'E131TestFramework.cpp' || echo '$(srcdir)/'`E131TestFramework.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolae131tester_la-E131TestFramework.Tpo $(DEPDIR)/libolae131tester_la-E131TestFramework.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131TestFramework.cpp' object='libolae131tester_la-E131TestFramework.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libolae131tester_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libolae131tester_la-E131TestFramework.lo `test -f 'E131TestFramework.cpp' || echo '$(srcdir)/'`E131TestFramework.cpp + +E131Tester-BaseInflatorTest.o: BaseInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-BaseInflatorTest.o -MD -MP -MF $(DEPDIR)/E131Tester-BaseInflatorTest.Tpo -c -o E131Tester-BaseInflatorTest.o `test -f 'BaseInflatorTest.cpp' || echo '$(srcdir)/'`BaseInflatorTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-BaseInflatorTest.Tpo $(DEPDIR)/E131Tester-BaseInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BaseInflatorTest.cpp' object='E131Tester-BaseInflatorTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-BaseInflatorTest.o `test -f 'BaseInflatorTest.cpp' || echo '$(srcdir)/'`BaseInflatorTest.cpp + +E131Tester-BaseInflatorTest.obj: BaseInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-BaseInflatorTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-BaseInflatorTest.Tpo -c -o E131Tester-BaseInflatorTest.obj `if test -f 'BaseInflatorTest.cpp'; then $(CYGPATH_W) 'BaseInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/BaseInflatorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-BaseInflatorTest.Tpo $(DEPDIR)/E131Tester-BaseInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BaseInflatorTest.cpp' object='E131Tester-BaseInflatorTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-BaseInflatorTest.obj `if test -f 'BaseInflatorTest.cpp'; then $(CYGPATH_W) 'BaseInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/BaseInflatorTest.cpp'; fi` + +E131Tester-CIDTest.o: CIDTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-CIDTest.o -MD -MP -MF $(DEPDIR)/E131Tester-CIDTest.Tpo -c -o E131Tester-CIDTest.o `test -f 'CIDTest.cpp' || echo '$(srcdir)/'`CIDTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-CIDTest.Tpo $(DEPDIR)/E131Tester-CIDTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CIDTest.cpp' object='E131Tester-CIDTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-CIDTest.o `test -f 'CIDTest.cpp' || echo '$(srcdir)/'`CIDTest.cpp + +E131Tester-CIDTest.obj: CIDTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-CIDTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-CIDTest.Tpo -c -o E131Tester-CIDTest.obj `if test -f 'CIDTest.cpp'; then $(CYGPATH_W) 'CIDTest.cpp'; else $(CYGPATH_W) '$(srcdir)/CIDTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-CIDTest.Tpo $(DEPDIR)/E131Tester-CIDTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CIDTest.cpp' object='E131Tester-CIDTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-CIDTest.obj `if test -f 'CIDTest.cpp'; then $(CYGPATH_W) 'CIDTest.cpp'; else $(CYGPATH_W) '$(srcdir)/CIDTest.cpp'; fi` + +E131Tester-DMPInflatorTest.o: DMPInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPInflatorTest.o -MD -MP -MF $(DEPDIR)/E131Tester-DMPInflatorTest.Tpo -c -o E131Tester-DMPInflatorTest.o `test -f 'DMPInflatorTest.cpp' || echo '$(srcdir)/'`DMPInflatorTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPInflatorTest.Tpo $(DEPDIR)/E131Tester-DMPInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPInflatorTest.cpp' object='E131Tester-DMPInflatorTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPInflatorTest.o `test -f 'DMPInflatorTest.cpp' || echo '$(srcdir)/'`DMPInflatorTest.cpp + +E131Tester-DMPInflatorTest.obj: DMPInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPInflatorTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-DMPInflatorTest.Tpo -c -o E131Tester-DMPInflatorTest.obj `if test -f 'DMPInflatorTest.cpp'; then $(CYGPATH_W) 'DMPInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPInflatorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPInflatorTest.Tpo $(DEPDIR)/E131Tester-DMPInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPInflatorTest.cpp' object='E131Tester-DMPInflatorTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPInflatorTest.obj `if test -f 'DMPInflatorTest.cpp'; then $(CYGPATH_W) 'DMPInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPInflatorTest.cpp'; fi` + +E131Tester-DMPAddressTest.o: DMPAddressTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPAddressTest.o -MD -MP -MF $(DEPDIR)/E131Tester-DMPAddressTest.Tpo -c -o E131Tester-DMPAddressTest.o `test -f 'DMPAddressTest.cpp' || echo '$(srcdir)/'`DMPAddressTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPAddressTest.Tpo $(DEPDIR)/E131Tester-DMPAddressTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPAddressTest.cpp' object='E131Tester-DMPAddressTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPAddressTest.o `test -f 'DMPAddressTest.cpp' || echo '$(srcdir)/'`DMPAddressTest.cpp + +E131Tester-DMPAddressTest.obj: DMPAddressTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPAddressTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-DMPAddressTest.Tpo -c -o E131Tester-DMPAddressTest.obj `if test -f 'DMPAddressTest.cpp'; then $(CYGPATH_W) 'DMPAddressTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPAddressTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPAddressTest.Tpo $(DEPDIR)/E131Tester-DMPAddressTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPAddressTest.cpp' object='E131Tester-DMPAddressTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPAddressTest.obj `if test -f 'DMPAddressTest.cpp'; then $(CYGPATH_W) 'DMPAddressTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPAddressTest.cpp'; fi` + +E131Tester-DMPPDUTest.o: DMPPDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPPDUTest.o -MD -MP -MF $(DEPDIR)/E131Tester-DMPPDUTest.Tpo -c -o E131Tester-DMPPDUTest.o `test -f 'DMPPDUTest.cpp' || echo '$(srcdir)/'`DMPPDUTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPPDUTest.Tpo $(DEPDIR)/E131Tester-DMPPDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPPDUTest.cpp' object='E131Tester-DMPPDUTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPPDUTest.o `test -f 'DMPPDUTest.cpp' || echo '$(srcdir)/'`DMPPDUTest.cpp + +E131Tester-DMPPDUTest.obj: DMPPDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-DMPPDUTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-DMPPDUTest.Tpo -c -o E131Tester-DMPPDUTest.obj `if test -f 'DMPPDUTest.cpp'; then $(CYGPATH_W) 'DMPPDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPPDUTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-DMPPDUTest.Tpo $(DEPDIR)/E131Tester-DMPPDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DMPPDUTest.cpp' object='E131Tester-DMPPDUTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-DMPPDUTest.obj `if test -f 'DMPPDUTest.cpp'; then $(CYGPATH_W) 'DMPPDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/DMPPDUTest.cpp'; fi` + +E131Tester-E131InflatorTest.o: E131InflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131InflatorTest.o -MD -MP -MF $(DEPDIR)/E131Tester-E131InflatorTest.Tpo -c -o E131Tester-E131InflatorTest.o `test -f 'E131InflatorTest.cpp' || echo '$(srcdir)/'`E131InflatorTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131InflatorTest.Tpo $(DEPDIR)/E131Tester-E131InflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131InflatorTest.cpp' object='E131Tester-E131InflatorTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131InflatorTest.o `test -f 'E131InflatorTest.cpp' || echo '$(srcdir)/'`E131InflatorTest.cpp + +E131Tester-E131InflatorTest.obj: E131InflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131InflatorTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-E131InflatorTest.Tpo -c -o E131Tester-E131InflatorTest.obj `if test -f 'E131InflatorTest.cpp'; then $(CYGPATH_W) 'E131InflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/E131InflatorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131InflatorTest.Tpo $(DEPDIR)/E131Tester-E131InflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131InflatorTest.cpp' object='E131Tester-E131InflatorTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131InflatorTest.obj `if test -f 'E131InflatorTest.cpp'; then $(CYGPATH_W) 'E131InflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/E131InflatorTest.cpp'; fi` + +E131Tester-E131PDUTest.o: E131PDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131PDUTest.o -MD -MP -MF $(DEPDIR)/E131Tester-E131PDUTest.Tpo -c -o E131Tester-E131PDUTest.o `test -f 'E131PDUTest.cpp' || echo '$(srcdir)/'`E131PDUTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131PDUTest.Tpo $(DEPDIR)/E131Tester-E131PDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131PDUTest.cpp' object='E131Tester-E131PDUTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131PDUTest.o `test -f 'E131PDUTest.cpp' || echo '$(srcdir)/'`E131PDUTest.cpp + +E131Tester-E131PDUTest.obj: E131PDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131PDUTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-E131PDUTest.Tpo -c -o E131Tester-E131PDUTest.obj `if test -f 'E131PDUTest.cpp'; then $(CYGPATH_W) 'E131PDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/E131PDUTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131PDUTest.Tpo $(DEPDIR)/E131Tester-E131PDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131PDUTest.cpp' object='E131Tester-E131PDUTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131PDUTest.obj `if test -f 'E131PDUTest.cpp'; then $(CYGPATH_W) 'E131PDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/E131PDUTest.cpp'; fi` + +E131Tester-E131Tester.o: E131Tester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131Tester.o -MD -MP -MF $(DEPDIR)/E131Tester-E131Tester.Tpo -c -o E131Tester-E131Tester.o `test -f 'E131Tester.cpp' || echo '$(srcdir)/'`E131Tester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131Tester.Tpo $(DEPDIR)/E131Tester-E131Tester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Tester.cpp' object='E131Tester-E131Tester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131Tester.o `test -f 'E131Tester.cpp' || echo '$(srcdir)/'`E131Tester.cpp + +E131Tester-E131Tester.obj: E131Tester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-E131Tester.obj -MD -MP -MF $(DEPDIR)/E131Tester-E131Tester.Tpo -c -o E131Tester-E131Tester.obj `if test -f 'E131Tester.cpp'; then $(CYGPATH_W) 'E131Tester.cpp'; else $(CYGPATH_W) '$(srcdir)/E131Tester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-E131Tester.Tpo $(DEPDIR)/E131Tester-E131Tester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='E131Tester.cpp' object='E131Tester-E131Tester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-E131Tester.obj `if test -f 'E131Tester.cpp'; then $(CYGPATH_W) 'E131Tester.cpp'; else $(CYGPATH_W) '$(srcdir)/E131Tester.cpp'; fi` + +E131Tester-HeaderSetTest.o: HeaderSetTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-HeaderSetTest.o -MD -MP -MF $(DEPDIR)/E131Tester-HeaderSetTest.Tpo -c -o E131Tester-HeaderSetTest.o `test -f 'HeaderSetTest.cpp' || echo '$(srcdir)/'`HeaderSetTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-HeaderSetTest.Tpo $(DEPDIR)/E131Tester-HeaderSetTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HeaderSetTest.cpp' object='E131Tester-HeaderSetTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-HeaderSetTest.o `test -f 'HeaderSetTest.cpp' || echo '$(srcdir)/'`HeaderSetTest.cpp + +E131Tester-HeaderSetTest.obj: HeaderSetTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-HeaderSetTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-HeaderSetTest.Tpo -c -o E131Tester-HeaderSetTest.obj `if test -f 'HeaderSetTest.cpp'; then $(CYGPATH_W) 'HeaderSetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/HeaderSetTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-HeaderSetTest.Tpo $(DEPDIR)/E131Tester-HeaderSetTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='HeaderSetTest.cpp' object='E131Tester-HeaderSetTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-HeaderSetTest.obj `if test -f 'HeaderSetTest.cpp'; then $(CYGPATH_W) 'HeaderSetTest.cpp'; else $(CYGPATH_W) '$(srcdir)/HeaderSetTest.cpp'; fi` + +E131Tester-PDUTest.o: PDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-PDUTest.o -MD -MP -MF $(DEPDIR)/E131Tester-PDUTest.Tpo -c -o E131Tester-PDUTest.o `test -f 'PDUTest.cpp' || echo '$(srcdir)/'`PDUTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-PDUTest.Tpo $(DEPDIR)/E131Tester-PDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PDUTest.cpp' object='E131Tester-PDUTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-PDUTest.o `test -f 'PDUTest.cpp' || echo '$(srcdir)/'`PDUTest.cpp + +E131Tester-PDUTest.obj: PDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-PDUTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-PDUTest.Tpo -c -o E131Tester-PDUTest.obj `if test -f 'PDUTest.cpp'; then $(CYGPATH_W) 'PDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PDUTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-PDUTest.Tpo $(DEPDIR)/E131Tester-PDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PDUTest.cpp' object='E131Tester-PDUTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-PDUTest.obj `if test -f 'PDUTest.cpp'; then $(CYGPATH_W) 'PDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/PDUTest.cpp'; fi` + +E131Tester-RootInflatorTest.o: RootInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootInflatorTest.o -MD -MP -MF $(DEPDIR)/E131Tester-RootInflatorTest.Tpo -c -o E131Tester-RootInflatorTest.o `test -f 'RootInflatorTest.cpp' || echo '$(srcdir)/'`RootInflatorTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootInflatorTest.Tpo $(DEPDIR)/E131Tester-RootInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootInflatorTest.cpp' object='E131Tester-RootInflatorTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootInflatorTest.o `test -f 'RootInflatorTest.cpp' || echo '$(srcdir)/'`RootInflatorTest.cpp + +E131Tester-RootInflatorTest.obj: RootInflatorTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootInflatorTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-RootInflatorTest.Tpo -c -o E131Tester-RootInflatorTest.obj `if test -f 'RootInflatorTest.cpp'; then $(CYGPATH_W) 'RootInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootInflatorTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootInflatorTest.Tpo $(DEPDIR)/E131Tester-RootInflatorTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootInflatorTest.cpp' object='E131Tester-RootInflatorTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootInflatorTest.obj `if test -f 'RootInflatorTest.cpp'; then $(CYGPATH_W) 'RootInflatorTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootInflatorTest.cpp'; fi` + +E131Tester-RootLayerTest.o: RootLayerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootLayerTest.o -MD -MP -MF $(DEPDIR)/E131Tester-RootLayerTest.Tpo -c -o E131Tester-RootLayerTest.o `test -f 'RootLayerTest.cpp' || echo '$(srcdir)/'`RootLayerTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootLayerTest.Tpo $(DEPDIR)/E131Tester-RootLayerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootLayerTest.cpp' object='E131Tester-RootLayerTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootLayerTest.o `test -f 'RootLayerTest.cpp' || echo '$(srcdir)/'`RootLayerTest.cpp + +E131Tester-RootLayerTest.obj: RootLayerTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootLayerTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-RootLayerTest.Tpo -c -o E131Tester-RootLayerTest.obj `if test -f 'RootLayerTest.cpp'; then $(CYGPATH_W) 'RootLayerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootLayerTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootLayerTest.Tpo $(DEPDIR)/E131Tester-RootLayerTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootLayerTest.cpp' object='E131Tester-RootLayerTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootLayerTest.obj `if test -f 'RootLayerTest.cpp'; then $(CYGPATH_W) 'RootLayerTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootLayerTest.cpp'; fi` + +E131Tester-RootPDUTest.o: RootPDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootPDUTest.o -MD -MP -MF $(DEPDIR)/E131Tester-RootPDUTest.Tpo -c -o E131Tester-RootPDUTest.o `test -f 'RootPDUTest.cpp' || echo '$(srcdir)/'`RootPDUTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootPDUTest.Tpo $(DEPDIR)/E131Tester-RootPDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootPDUTest.cpp' object='E131Tester-RootPDUTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootPDUTest.o `test -f 'RootPDUTest.cpp' || echo '$(srcdir)/'`RootPDUTest.cpp + +E131Tester-RootPDUTest.obj: RootPDUTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-RootPDUTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-RootPDUTest.Tpo -c -o E131Tester-RootPDUTest.obj `if test -f 'RootPDUTest.cpp'; then $(CYGPATH_W) 'RootPDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootPDUTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-RootPDUTest.Tpo $(DEPDIR)/E131Tester-RootPDUTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RootPDUTest.cpp' object='E131Tester-RootPDUTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-RootPDUTest.obj `if test -f 'RootPDUTest.cpp'; then $(CYGPATH_W) 'RootPDUTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RootPDUTest.cpp'; fi` + +E131Tester-UDPTransportTest.o: UDPTransportTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-UDPTransportTest.o -MD -MP -MF $(DEPDIR)/E131Tester-UDPTransportTest.Tpo -c -o E131Tester-UDPTransportTest.o `test -f 'UDPTransportTest.cpp' || echo '$(srcdir)/'`UDPTransportTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-UDPTransportTest.Tpo $(DEPDIR)/E131Tester-UDPTransportTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UDPTransportTest.cpp' object='E131Tester-UDPTransportTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-UDPTransportTest.o `test -f 'UDPTransportTest.cpp' || echo '$(srcdir)/'`UDPTransportTest.cpp + +E131Tester-UDPTransportTest.obj: UDPTransportTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT E131Tester-UDPTransportTest.obj -MD -MP -MF $(DEPDIR)/E131Tester-UDPTransportTest.Tpo -c -o E131Tester-UDPTransportTest.obj `if test -f 'UDPTransportTest.cpp'; then $(CYGPATH_W) 'UDPTransportTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UDPTransportTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/E131Tester-UDPTransportTest.Tpo $(DEPDIR)/E131Tester-UDPTransportTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UDPTransportTest.cpp' object='E131Tester-UDPTransportTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(E131Tester_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o E131Tester-UDPTransportTest.obj `if test -f 'UDPTransportTest.cpp'; then $(CYGPATH_W) 'UDPTransportTest.cpp'; else $(CYGPATH_W) '$(srcdir)/UDPTransportTest.cpp'; fi` + +e131_transmit_test-e131_transmit_test.o: e131_transmit_test.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(e131_transmit_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT e131_transmit_test-e131_transmit_test.o -MD -MP -MF $(DEPDIR)/e131_transmit_test-e131_transmit_test.Tpo -c -o e131_transmit_test-e131_transmit_test.o `test -f 'e131_transmit_test.cpp' || echo '$(srcdir)/'`e131_transmit_test.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/e131_transmit_test-e131_transmit_test.Tpo $(DEPDIR)/e131_transmit_test-e131_transmit_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='e131_transmit_test.cpp' object='e131_transmit_test-e131_transmit_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(e131_transmit_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o e131_transmit_test-e131_transmit_test.o `test -f 'e131_transmit_test.cpp' || echo '$(srcdir)/'`e131_transmit_test.cpp + +e131_transmit_test-e131_transmit_test.obj: e131_transmit_test.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(e131_transmit_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT e131_transmit_test-e131_transmit_test.obj -MD -MP -MF $(DEPDIR)/e131_transmit_test-e131_transmit_test.Tpo -c -o e131_transmit_test-e131_transmit_test.obj `if test -f 'e131_transmit_test.cpp'; then $(CYGPATH_W) 'e131_transmit_test.cpp'; else $(CYGPATH_W) '$(srcdir)/e131_transmit_test.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/e131_transmit_test-e131_transmit_test.Tpo $(DEPDIR)/e131_transmit_test-e131_transmit_test.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='e131_transmit_test.cpp' object='e131_transmit_test-e131_transmit_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(e131_transmit_test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o e131_transmit_test-e131_transmit_test.obj `if test -f 'e131_transmit_test.cpp'; then $(CYGPATH_W) 'e131_transmit_test.cpp'; else $(CYGPATH_W) '$(srcdir)/e131_transmit_test.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.cpp new file mode 100644 index 0000000..972fbe2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.cpp @@ -0,0 +1,114 @@ +/* + * 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 Library 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. + * + * PDU.cpp + * The base PDU class + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +/* + * Return the length of this PDU + * @return length of the pdu + */ +unsigned int PDU::Size() const { + unsigned int length = m_vector_size + HeaderSize() + DataSize(); + + if (length > TWOB_LENGTH_LIMIT - 2) + length += 1; + length += 2; + return length; +} + + +/* + * Pack this PDU into a buffer + * @param buffer pointer to the buffer + * @param length length of the buffer + * @return false on error, true otherwise + */ +bool PDU::Pack(uint8_t *buffer, unsigned int &length) const { + unsigned int size = Size(); + int offset = 0; + + if (length < size) { + OLA_WARN << "PDU Pack: buffer too small, required " << size << ", got " + << length; + length = 0; + return false; + } + + if (size <= TWOB_LENGTH_LIMIT) { + buffer[0] = (uint8_t) ((size & 0x0f00) >> 8); + buffer[1] = (uint8_t) (size & 0xff); + } else { + buffer[0] = (uint8_t) ((size & 0x0f0000) >> 16); + buffer[1] = (uint8_t) ((size & 0xff00) >> 8); + buffer[2] = (uint8_t) (size & 0xff); + offset += 1; + } + + buffer[0] |= VFLAG_MASK; + buffer[0] |= HFLAG_MASK; + buffer[0] |= DFLAG_MASK; + offset += 2; + + switch (m_vector_size) { + case PDU::ONE_BYTE: + buffer[offset++] = (uint8_t) m_vector; + break; + case PDU::TWO_BYTES: + buffer[offset++] = static_cast(0xff & (m_vector >> 8)); + buffer[offset++] = static_cast(0xff & m_vector); + break; + case PDU::FOUR_BYTES: + buffer[offset++] = static_cast(0xff & (m_vector >> 24)); + buffer[offset++] = static_cast(0xff & (m_vector >> 16)); + buffer[offset++] = static_cast(0xff & (m_vector >> 8)); + buffer[offset++] = static_cast(0xff & m_vector); + break; + default: + OLA_WARN << "unknown vector size " << m_vector_size; + return false; + } + + unsigned int bytes_used = length - offset; + if (!PackHeader(buffer + offset, bytes_used)) { + length = 0; + return false; + } + offset += bytes_used; + + bytes_used = length - offset; + if (!PackData(buffer + offset, bytes_used)) { + length = 0; + return false; + } + offset += bytes_used; + length = offset; + return true; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.h new file mode 100644 index 0000000..40b28cc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDU.h @@ -0,0 +1,139 @@ +/* + * 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 Library 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. + * + * PDU.h + * Interface for the PDU and PDUBlock classes + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_PDU_H_ +#define PLUGINS_E131_E131_PDU_H_ + +#include +#include + +namespace ola { +namespace plugin { +namespace e131 { + + +/* + * The Base PDU class + */ +class PDU { + public: + typedef enum { + ONE_BYTE = 1, + TWO_BYTES = 2, + FOUR_BYTES = 4, + } vector_size; + + PDU(unsigned int vector, vector_size size = FOUR_BYTES): + m_vector(vector), + m_vector_size(size) {} + virtual ~PDU() {} + + // Returns the size of this PDU + virtual unsigned int Size() const; + virtual unsigned int VectorSize() const { return m_vector_size; } + virtual unsigned int HeaderSize() const = 0; + virtual unsigned int DataSize() const = 0; + + // Set the vector + void SetVector(unsigned int vector) { m_vector = vector; } + + /* + * Pack the PDU into the memory pointed to by data + * @return true on success, false on failure + */ + virtual bool Pack(uint8_t *data, unsigned int &length) const; + virtual bool PackHeader(uint8_t *data, unsigned int &length) const = 0; + virtual bool PackData(uint8_t *data, unsigned int &length) const = 0; + + // This indicates a vector is present + static const uint8_t VFLAG_MASK = 0x40; + // This indicates a header field is present + static const uint8_t HFLAG_MASK = 0x20; + // This indicates a data field is present + static const uint8_t DFLAG_MASK = 0x10; + + private: + unsigned int m_vector; + unsigned int m_vector_size; + + // The max PDU length that can be represented with the 2 byte format for + // the length field. + static const unsigned int TWOB_LENGTH_LIMIT = 0x0FFF; +}; + + +/* + * Represents a block of pdus + */ +template +class PDUBlock { + public: + PDUBlock(): m_size(0) {} + ~PDUBlock() {} + + // Add a PDU to this block + void AddPDU(const C *msg) { + m_pdus.push_back(msg); + m_size += msg->Size(); + } + // Remove all PDUs from the block + void Clear() { + m_pdus.clear(); + m_size = 0; + } + // The number of bytes this block would consume, this ignores optimizations + // like repeating headers/vectors. + unsigned int Size() const { return m_size; } + /* + * Pack this PDUBlock into memory pointed to by data + * @return true on success, false on failure + */ + bool Pack(uint8_t *data, unsigned int &length) const; + + private: + std::vector m_pdus; + unsigned int m_size; +}; + + +/* + * Pack this block of PDUs into a buffer + * @param data a pointer to the buffer + * @param length size of the buffer, updated with the number of bytes used + * @return true on success, false on failure + */ +template +bool PDUBlock::Pack(uint8_t *data, unsigned int &length) const { + bool status = true; + unsigned int i = 0; + typename std::vector::const_iterator iter; + for (iter = m_pdus.begin(); iter != m_pdus.end(); ++iter) { + // TODO(simon): optimize repeated headers & vectors here + unsigned int remaining = i < length ? length - i : 0; + status &= (*iter)->Pack(data + i, remaining); + i+= remaining; + } + length = i; + return status; +} +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_PDU_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTest.cpp new file mode 100644 index 0000000..756b8db --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTest.cpp @@ -0,0 +1,74 @@ +/* + * 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 Library 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. + * + * PDUTest.cpp + * Test fixture for the PDU class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include + +#include "plugins/e131/e131/PDU.h" +#include "plugins/e131/e131/PDUTestCommon.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +class PDUTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(PDUTest); + CPPUNIT_TEST(testPDUBlock); + CPPUNIT_TEST_SUITE_END(); + + public: + void testPDUBlock(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(PDUTest); + + +/* + * Test that packing a PDUBlock works. + */ +void PDUTest::testPDUBlock() { + FakePDU pdu1(1); + FakePDU pdu2(2); + FakePDU pdu42(42); + PDUBlock block; + block.AddPDU(&pdu1); + block.AddPDU(&pdu2); + block.AddPDU(&pdu42); + + unsigned int block_size = block.Size(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 12, block_size); + uint8_t *data = new uint8_t[block_size]; + unsigned int bytes_used = block_size; + CPPUNIT_ASSERT(block.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL(block_size, bytes_used); + + unsigned int *test = (unsigned int*) data; + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, *test++); + CPPUNIT_ASSERT_EQUAL((unsigned int) 2, *test++); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, *test); + delete[] data; + + block.Clear(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, block.Size()); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTestCommon.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTestCommon.h new file mode 100644 index 0000000..da7bde1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/PDUTestCommon.h @@ -0,0 +1,162 @@ +/* + * 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 Library 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. + * + * PDUTestCommon.cpp + * Provides a simple PDU class for testing + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_PDUTESTCOMMON_H_ +#define PLUGINS_E131_E131_PDUTESTCOMMON_H_ + +#include "ola/Closure.h" +#include "plugins/e131/e131/BaseInflator.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +/* + * This isn't a PDU at all, it just packs a uint32 for testing. + */ +class FakePDU: public PDU { + public: + explicit FakePDU(unsigned int value): PDU(0), m_value(value) {} + unsigned int Size() const { return sizeof(m_value); } + unsigned int HeaderSize() const { return 0; } + unsigned int DataSize() const { return 0; } + + bool Pack(uint8_t *data, unsigned int &length) const { + if (length < sizeof(m_value)) + return false; + memcpy(data, &m_value, sizeof(m_value)); + length = sizeof(m_value); + return true; + } + bool PackHeader(uint8_t *data, unsigned int &length) const { + return true; + (void) data; + (void) length; + } + bool PackData(uint8_t *data, unsigned int &length) const { + return true; + (void) data; + (void) length; + } + + private: + unsigned int m_value; +}; + + +/* + * A Mock PDU class that can be used for testing. + * Mock PDUs have a 4 byte header, and a 4 byte data payload which the inflator + * will check is 2x the header value. + */ +class MockPDU: public PDU { + public: + MockPDU(unsigned int header, unsigned int value): + PDU(TEST_DATA_VECTOR), + m_header(header), + m_value(value) {} + unsigned int HeaderSize() const { return sizeof(m_header); } + unsigned int DataSize() const { return sizeof(m_value); } + + bool PackHeader(uint8_t *data, unsigned int &length) const { + if (length < HeaderSize()) { + length = 0; + return false; + } + memcpy(data, &m_header, sizeof(m_header)); + length = HeaderSize(); + return true; + } + + bool PackData(uint8_t *data, unsigned int &length) const { + if (length < DataSize()) { + length = 0; + return false; + } + memcpy(data, &m_value, sizeof(m_value)); + length = DataSize(); + return true; + } + + // This is used to id 'Mock' PDUs in the higher level protocol + static const unsigned int TEST_VECTOR = 42; + // This is is the vector used by MockPDUs + static const unsigned int TEST_DATA_VECTOR = 43; + + private: + unsigned int m_header; + unsigned int m_value; +}; + + +/* + * The inflator the works with MockPDUs. We check that the data = 2 * header + */ +class MockInflator: public BaseInflator { + public: + MockInflator(const CID &cid, Closure *on_recv = NULL): + BaseInflator(), + m_cid(cid), + m_on_recv(on_recv) {} + uint32_t Id() const { return MockPDU::TEST_VECTOR; } + + protected: + void ResetHeaderField() {} + bool DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + bytes_used = 4; + memcpy(&m_last_header, data, sizeof(m_last_header)); + return true; + (void) headers; + (void) length; + } + + bool HandlePDUData(uint32_t vector, HeaderSet &headers, + const uint8_t *data, unsigned int pdu_length) { + CPPUNIT_ASSERT_EQUAL((uint32_t) MockPDU::TEST_DATA_VECTOR, vector); + CPPUNIT_ASSERT_EQUAL((unsigned int) 4, pdu_length); + unsigned int *value = (unsigned int*) data; + CPPUNIT_ASSERT_EQUAL(m_last_header * 2, *value); + + if (!m_cid.IsNil()) { + // check the CID as well + RootHeader root_header = headers.GetRootHeader(); + CPPUNIT_ASSERT(m_cid == root_header.GetCid()); + } + + if (m_on_recv) + m_on_recv->Run(); + return true; + } + + private: + CID m_cid; + Closure *m_on_recv; + unsigned int m_last_header; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_PDUTESTCOMMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootHeader.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootHeader.h new file mode 100644 index 0000000..22695fc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootHeader.h @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * RootHeader.h + * Interface for the RootHeader class + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_ROOTHEADER_H_ +#define PLUGINS_E131_E131_ROOTHEADER_H_ + +#include "plugins/e131/e131/CID.h" + +namespace ola { +namespace plugin { +namespace e131 { + +/* + * The header for the root layer + */ +class RootHeader { + public: + RootHeader() {} + ~RootHeader() {} + void SetCid(CID cid) { m_cid = cid; } + CID GetCid() const { return m_cid; } + + bool operator==(const RootHeader &other) const { + return m_cid == other.m_cid; + } + private: + CID m_cid; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_ROOTHEADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.cpp new file mode 100644 index 0000000..34f2cf4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.cpp @@ -0,0 +1,71 @@ +/* + * 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 Library 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. + * + * RootInflator.cpp + * The Inflator for the root level packets over UDP + * Copyright (C) 2007 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include "ola/Logging.h" +#include "plugins/e131/e131/RootInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + + +/* + * Decode the root headers. If data is null we're expected to use the last + * header we got. + * @param headers the HeaderSet to add to + * @param data a pointer to the data + * @param length length of the data + * @returns true if successful, false otherwise + */ +bool RootInflator::DecodeHeader(HeaderSet &headers, + const uint8_t *data, + unsigned int length, + unsigned int &bytes_used) { + if (data) { + if (length >= CID::CID_LENGTH) { + CID cid = CID::FromData(data); + m_last_hdr.SetCid(cid); + headers.SetRootHeader(m_last_hdr); + bytes_used = CID::CID_LENGTH; + return true; + } + return false; + } + bytes_used = 0; + if (m_last_hdr.GetCid().IsNil()) { + OLA_WARN << "Missing CID data"; + return false; + } + headers.SetRootHeader(m_last_hdr); + return true; +} + + +/* + * Reset the header field + */ +void RootInflator::ResetHeaderField() { + CID cid; + m_last_hdr.SetCid(cid); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.h new file mode 100644 index 0000000..5bec2e9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflator.h @@ -0,0 +1,48 @@ +/* + * 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 Library 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. + * + * RootInflator.h + * Interface for the RootInflator class. + * Copyright (C) 2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_ROOTINFLATOR_H_ +#define PLUGINS_E131_E131_ROOTINFLATOR_H_ + +#include "plugins/e131/e131/BaseInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class RootInflator: public BaseInflator { + public: + RootInflator(): BaseInflator() {} + ~RootInflator() {} + uint32_t Id() const { return 0; } // no effect for the root inflator + + protected: + // Decode a header block and adds any PduHeaders to the HeaderSet object + bool DecodeHeader(HeaderSet &headers, const uint8_t *data, + unsigned int len, unsigned int &bytes_used); + + virtual void ResetHeaderField(); + private : + RootHeader m_last_hdr; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_ROOTINFLATOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflatorTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflatorTest.cpp new file mode 100644 index 0000000..daa5e1c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootInflatorTest.cpp @@ -0,0 +1,74 @@ +/* + * 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 Library 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. + * + * RootInflatorTest.cpp + * Test fixture for the RootInflator class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include + +#include "plugins/e131/e131/HeaderSet.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/RootInflator.h" +#include "plugins/e131/e131/RootPDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class RootInflatorTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RootInflatorTest); + CPPUNIT_TEST(testInflatePDU); + CPPUNIT_TEST_SUITE_END(); + + public: + void testInflatePDU(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(RootInflatorTest); + + +/* + * Check that we can inflate a Root PDU that contains other PDUs + */ +void RootInflatorTest::testInflatePDU() { + MockPDU pdu1(1, 2); + MockPDU pdu2(4, 8); + PDUBlock block; + block.AddPDU(&pdu1); + block.AddPDU(&pdu2); + + CID cid = CID::Generate(); + RootPDU pdu(MockPDU::TEST_VECTOR, cid, &block); + CPPUNIT_ASSERT_EQUAL((unsigned int) 50, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + MockInflator mock_inflator(cid); + RootInflator inflator; + inflator.AddInflator(&mock_inflator); + HeaderSet header_set; + CPPUNIT_ASSERT(inflator.InflatePDUBlock(header_set, data, size)); + delete[] data; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.cpp new file mode 100644 index 0000000..044440b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.cpp @@ -0,0 +1,148 @@ +/* + * 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 Library 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. + * + * RootLayer.cpp + * The RootLayer + * Copyright (C) 2007 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/RootLayer.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +/* + * Create a new RootLayer + * @param parser the parser to use + * @param ip_address the desired IP address to use + * @param loop set to true to loop multicast packets + */ +RootLayer::RootLayer(UDPTransport *transport, const CID &cid) + : m_transport(transport), + m_root_pdu(0) { + m_root_pdu.Cid(cid); + if (!m_transport) { + OLA_WARN << "transport is null, this won't work"; + return; + } + m_transport->SetInflator(&m_root_inflator); +} + + +/* + * Add an inflator to the root level + */ +bool RootLayer::AddInflator(BaseInflator *inflator) { + return m_root_inflator.AddInflator(inflator); +} + + +/* + * Encapsulate this PDU in a RootPDU and send it to the destination. + * @param addr where to send the PDU + * @param vector the vector to use at the root level + * @param pdu the pdu to send. + */ +bool RootLayer::SendPDU(struct in_addr &addr, + unsigned int vector, + const PDU &pdu) { + m_working_block.Clear(); + m_working_block.AddPDU(&pdu); + return SendPDUBlock(addr, vector, m_working_block); +} + + +/* + * This is used to inject a packet from a different CID. + * @param addr where to send the PDU + * @param vector the vector to use at the root level + * @param pdu the pdu to send. + * @param cid the cid to send from + */ +bool RootLayer::SendPDU(struct in_addr &addr, unsigned int vector, + const PDU &pdu, const CID &cid) { + if (!m_transport) + return false; + + PDUBlock root_block, working_block; + working_block.AddPDU(&pdu); + RootPDU root_pdu(vector); + root_pdu.Cid(cid); + root_pdu.SetBlock(&working_block); + root_block.AddPDU(&root_pdu); + return SendBlock(addr, root_block); +} + + +/* + * Encapsulate this PDUBlock in a RootPDU and send it to the destination. + * @param addr where to send the PDU + * @param vector the vector to use at the root level + * @param block the PDUBlock to send. + */ +bool RootLayer::SendPDUBlock(struct in_addr &addr, + unsigned int vector, + const PDUBlock &block) { + if (!m_transport) + return false; + + m_root_pdu.SetVector(vector); + m_root_pdu.SetBlock(&block); + m_root_block.Clear(); + m_root_block.AddPDU(&m_root_pdu); + return SendBlock(addr, m_root_block); +} + + +/* + * Join a multicast group + */ +bool RootLayer::JoinMulticast(const struct in_addr &group) { + if (m_transport) + return m_transport->JoinMulticast(group); + return false; +} + + +/* + * Leave a multicast group + */ +bool RootLayer::LeaveMulticast(const struct in_addr &group) { + if (m_transport) + return m_transport->LeaveMulticast(group); + return false; +} + + +/* + * Send a block of pdus to an address + */ +bool RootLayer::SendBlock(struct in_addr &addr, + const PDUBlock &root_block) { + struct sockaddr_in destination; + destination.sin_family = AF_INET; + destination.sin_port = HostToNetwork(UDPTransport::ACN_PORT); + destination.sin_addr = addr; + return m_transport->Send(root_block, destination); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.h new file mode 100644 index 0000000..f421bc3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayer.h @@ -0,0 +1,73 @@ +/* + * 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 Library 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. + * + * RootLayer.h + * Interface for the RootLayer class, this abstracts the encapsulation and + * sending of PDUs contained within RootPDUs as well as the setting of + * inflators. + * Copyright (C) 2007 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_ROOTLAYER_H_ +#define PLUGINS_E131_E131_ROOTLAYER_H_ + +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/PDU.h" +#include "plugins/e131/e131/RootPDU.h" +#include "plugins/e131/e131/RootInflator.h" +#include "plugins/e131/e131/UDPTransport.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class RootLayer { + public: + RootLayer(UDPTransport *transport, const CID &cid); + ~RootLayer() {} + + bool AddInflator(BaseInflator *inflator); + + // Convenience method to encapsulate & send a single PDU + bool SendPDU(struct in_addr &addr, unsigned int vector, const PDU &pdu); + // Use for testing to force a message from a particular cid + bool SendPDU(struct in_addr &addr, unsigned int vector, const PDU &pdu, + const CID &cid); + // Encapsulation & send a block of PDUs + bool SendPDUBlock(struct in_addr &addr, + unsigned int vector, + const PDUBlock &block); + + // TODO(simon): add methods to queue and send PDUs/blocks with different + // vectors + + bool JoinMulticast(const struct in_addr &group); + bool LeaveMulticast(const struct in_addr &group); + + private: + UDPTransport *m_transport; + RootInflator m_root_inflator; + PDUBlock m_working_block; + PDUBlock m_root_block; + RootPDU m_root_pdu; + + RootLayer(const RootLayer&); + RootLayer& operator=(const RootLayer&); + bool SendBlock(struct in_addr &addr, const PDUBlock &root_block); +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_ROOTLAYER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayerTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayerTest.cpp new file mode 100644 index 0000000..606b10d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootLayerTest.cpp @@ -0,0 +1,121 @@ +/* + * 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 Library 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. + * + * RootLayerTest.cpp + * Test fixture for the RootLayer class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include "ola/network/InterfacePicker.h" +#include "ola/network/NetworkUtils.h" +#include "ola/network/SelectServer.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/RootInflator.h" +#include "plugins/e131/e131/RootLayer.h" +#include "plugins/e131/e131/UDPTransport.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class RootLayerTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RootLayerTest); + CPPUNIT_TEST(testRootLayer); + CPPUNIT_TEST(testRootLayerWithCustomCID); + CPPUNIT_TEST_SUITE_END(); + + public: + RootLayerTest(): TestFixture(), m_ss(NULL) {} + void testRootLayer(); + void testRootLayerWithCustomCID(); + void setUp(); + void tearDown(); + void Stop(); + void FatalStop() { CPPUNIT_ASSERT(false); } + + private: + void testRootLayerWithCIDs(const CID &root_cid, const CID &send_cid); + ola::network::SelectServer *m_ss; + static const int ABORT_TIMEOUT_IN_MS = 1000; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(RootLayerTest); + +void RootLayerTest::setUp() { + m_ss = new ola::network::SelectServer(); +} + +void RootLayerTest::tearDown() { + delete m_ss; +} + +void RootLayerTest::Stop() { + if (m_ss) + m_ss->Terminate(); +} + + +/* + * Test the RootLayer + */ +void RootLayerTest::testRootLayer() { + CID cid = CID::Generate(); + testRootLayerWithCIDs(cid, cid); +} + + +/* + * Test the method to send using a custom cid works + */ +void RootLayerTest::testRootLayerWithCustomCID() { + CID cid = CID::Generate(); + CID send_cid = CID::Generate(); + testRootLayerWithCIDs(cid, send_cid); +} + + +void RootLayerTest::testRootLayerWithCIDs(const CID &root_cid, + const CID &send_cid) { + ola::network::Interface interface; + UDPTransport transport; + CPPUNIT_ASSERT(transport.Init(interface)); + CPPUNIT_ASSERT(m_ss->AddSocket(transport.GetSocket())); + RootLayer layer(&transport, root_cid); + + Closure *stop_closure = NewClosure(this, &RootLayerTest::Stop); + MockInflator inflator(send_cid, stop_closure); + CPPUNIT_ASSERT(layer.AddInflator(&inflator)); + + MockPDU mock_pdu(4, 8); + struct in_addr addr; + ola::network::StringToAddress("255.255.255.255", addr); + + if (root_cid == send_cid) + CPPUNIT_ASSERT(layer.SendPDU(addr, MockPDU::TEST_VECTOR, mock_pdu)); + else + CPPUNIT_ASSERT(layer.SendPDU(addr, MockPDU::TEST_VECTOR, mock_pdu, + send_cid)); + + SingleUseClosure *closure = + NewSingleClosure(this, &RootLayerTest::FatalStop); + m_ss->RegisterSingleTimeout(ABORT_TIMEOUT_IN_MS, closure); + m_ss->Run(); + delete stop_closure; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.cpp new file mode 100644 index 0000000..e841b1e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.cpp @@ -0,0 +1,63 @@ +/* + * 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 Library 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. + * + * RootPDU.cpp + * The RootPDU class + * Copyright (C) 2007-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include "ola/Logging.h" +#include "plugins/e131/e131/RootPDU.h" +#include "plugins/e131/e131/BaseInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +/* + * Pack the header into a buffer. + */ +bool RootPDU::PackHeader(uint8_t *data, unsigned int &length) const { + if (length < HeaderSize()) { + length = 0; + return false; + } + + m_cid.Pack(data); + length = HeaderSize(); + return true; +} + + +/* + * Pack the data into a buffer + */ +bool RootPDU::PackData(uint8_t *data, unsigned int &length) const { + if (m_block) + return m_block->Pack(data, length); + + length = 0; + return true; +} + + +void RootPDU::SetBlock(const PDUBlock *block) { + m_block = block; + m_block_size = m_block ? block->Size() : 0; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.h new file mode 100644 index 0000000..98d31e0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDU.h @@ -0,0 +1,63 @@ +/* + * 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 Library 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. + * + * RootPDU.h + * Interface for the RootPDU class + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_ROOTPDU_H_ +#define PLUGINS_E131_E131_ROOTPDU_H_ + +#include +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/PDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +class RootPDU: public PDU { + public: + explicit RootPDU(unsigned int vector): + PDU(vector), + m_block(NULL), + m_block_size(0) {} + RootPDU(unsigned int vector, const CID &cid, const PDUBlock *block): + PDU(vector), + m_cid(cid), + m_block(block) { + m_block_size = block ? block->Size() : 0; + } + ~RootPDU() {} + + unsigned int HeaderSize() const { return CID::CID_LENGTH; } + unsigned int DataSize() const { return m_block_size; } + bool PackHeader(uint8_t *data, unsigned int &length) const; + bool PackData(uint8_t *data, unsigned int &length) const; + + const CID &Cid() const { return m_cid; } + const CID &Cid(const CID &cid) { return m_cid = cid; } + void SetBlock(const PDUBlock *block); + + private: + CID m_cid; + const PDUBlock *m_block; + unsigned int m_block_size; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_ROOTPDU_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDUTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDUTest.cpp new file mode 100644 index 0000000..1c0ef52 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/RootPDUTest.cpp @@ -0,0 +1,152 @@ +/* + * 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 Library 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. + * + * RootPDUTest.cpp + * Test fixture for the RootPDU class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include + +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/CID.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/RootPDU.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::NetworkToHost; + +class RootPDUTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RootPDUTest); + CPPUNIT_TEST(testSimpleRootPDU); + CPPUNIT_TEST(testNestedRootPDU); + CPPUNIT_TEST_SUITE_END(); + + public: + void testSimpleRootPDU(); + void testNestedRootPDU(); + private: + static const unsigned int TEST_VECTOR; + static const unsigned int TEST_VECTOR2 = 99; +}; + +const unsigned int RootPDUTest::TEST_VECTOR = 4; + +CPPUNIT_TEST_SUITE_REGISTRATION(RootPDUTest); + + +/* + * Test that packing a RootPDU without data works. + */ +void RootPDUTest::testSimpleRootPDU() { + CID cid = CID::Generate(); + RootPDU pdu1(TEST_VECTOR, cid, NULL); + CPPUNIT_ASSERT(cid == pdu1.Cid()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 22, pdu1.Size()); + + unsigned int size = pdu1.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu1.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + // spot check the data + CPPUNIT_ASSERT_EQUAL((uint8_t) 0x70, data[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) bytes_used, data[1]); + unsigned int actual_value; + memcpy(&actual_value, data + 2, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) HostToNetwork(TEST_VECTOR), + actual_value); + CID cid2 = CID::FromData(&data[6]); + CPPUNIT_ASSERT(cid2 == cid); + + // test undersized buffer + bytes_used = size - 1; + CPPUNIT_ASSERT(!pdu1.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, bytes_used); + + // test oversized buffer + bytes_used = size + 1; + CPPUNIT_ASSERT(pdu1.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + // change the vector + pdu1.SetVector(TEST_VECTOR2); + CPPUNIT_ASSERT(pdu1.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + CPPUNIT_ASSERT_EQUAL((uint8_t) 0x70, data[0]); + CPPUNIT_ASSERT_EQUAL((uint8_t) bytes_used, data[1]); + memcpy(&actual_value, data + 2, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) HostToNetwork(TEST_VECTOR2), + actual_value); + cid2 = CID::FromData(&data[6]); + CPPUNIT_ASSERT(cid2 == cid); + + // use the other constructor + RootPDU pdu2(TEST_VECTOR); + pdu2.Cid(cid); + + CPPUNIT_ASSERT(cid == pdu1.Cid()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 22, pdu1.Size()); + bytes_used = size; + uint8_t *data2 = new uint8_t[size]; + CPPUNIT_ASSERT(pdu1.Pack(data2, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + CPPUNIT_ASSERT(!memcmp(data, data2, bytes_used)); + + delete[] data; + delete[] data2; +} + + +/* + * Test that packing a RootPDU with nested data works + */ +void RootPDUTest::testNestedRootPDU() { + FakePDU pdu1(1); + FakePDU pdu2(42); + PDUBlock block; + block.AddPDU(&pdu1); + block.AddPDU(&pdu2); + + CID cid = CID::Generate(); + RootPDU pdu(TEST_VECTOR, cid, &block); + + CPPUNIT_ASSERT(cid == pdu.Cid()); + CPPUNIT_ASSERT_EQUAL((unsigned int) 30, pdu.Size()); + + unsigned int size = pdu.Size(); + uint8_t *data = new uint8_t[size]; + unsigned int bytes_used = size; + CPPUNIT_ASSERT(pdu.Pack(data, bytes_used)); + CPPUNIT_ASSERT_EQUAL((unsigned int) size, bytes_used); + + // spot check + unsigned int actual_value; + memcpy(&actual_value, data + 22, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 1, actual_value); + memcpy(&actual_value, data + 26, sizeof(actual_value)); + CPPUNIT_ASSERT_EQUAL((unsigned int) 42, actual_value); + + delete[] data; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.cpp new file mode 100644 index 0000000..a3b1728 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.cpp @@ -0,0 +1,145 @@ +/* + * 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 Library 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. + * + * UDPTransport.h + * The UDPTransport class + * Copyright (C) 2007 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include + +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/e131/e131/UDPTransport.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +const char UDPTransport::ACN_PACKET_ID[] = "ASC-E1.17\0\0\0"; + +/* + * Clean up + */ +UDPTransport::~UDPTransport() { + m_socket.Close(); + if (m_send_buffer) + delete[] m_send_buffer; + if (m_recv_buffer) + delete[] m_recv_buffer; +} + + +/* + * Setup the UDP Transport + */ +bool UDPTransport::Init(const ola::network::Interface &interface) { + if (!m_socket.Init()) + return false; + + if (!m_socket.Bind(m_port)) + return false; + + if (!m_socket.EnableBroadcast()) + return false; + + m_socket.SetOnData(NewClosure(this, &UDPTransport::Receive)); + + if (!m_send_buffer) { + m_send_buffer = new uint8_t[MAX_DATAGRAM_SIZE]; + memset(m_send_buffer, 0 , DATA_OFFSET); + uint16_t *ptr = reinterpret_cast(m_send_buffer); + *ptr++ = HostToNetwork(PREAMBLE_SIZE); + *ptr = HostToNetwork(POSTABLE_SIZE); + strncpy(reinterpret_cast(m_send_buffer + PREAMBLE_OFFSET), + ACN_PACKET_ID, + strlen(ACN_PACKET_ID)); + } + + if (!m_recv_buffer) + m_recv_buffer = new uint8_t[MAX_DATAGRAM_SIZE]; + + m_interface = interface; + return true; +} + + +/* + * Send a block of PDU messages, this may send separate packets if the size of + * the block is greater than the MAX_DATAGRAM_SIZE. + * @param pdu_block the block of pdus to send + */ +bool UDPTransport::Send(const PDUBlock &pdu_block, + const struct sockaddr_in &destination) { + if (!m_send_buffer) { + OLA_WARN << "Send called the transport hasn't been initialized"; + return false; + } + + unsigned int size = MAX_DATAGRAM_SIZE - DATA_OFFSET; + if (!pdu_block.Pack(m_send_buffer + DATA_OFFSET, size)) + return false; + + return m_socket.SendTo(m_send_buffer, DATA_OFFSET + size, destination); +} + + +/* + * Called when new data arrives. + */ +void UDPTransport::Receive() { + if (!m_recv_buffer) { + OLA_WARN << "Receive called the transport hasn't been initialized"; + return; + } + + ssize_t size = MAX_DATAGRAM_SIZE; + if (!m_socket.RecvFrom(m_recv_buffer, &size)) + return; + + if (size < (ssize_t) DATA_OFFSET) { + OLA_WARN << "short ACN frame, discarding"; + return; + } + + if (memcmp(m_recv_buffer, m_send_buffer, DATA_OFFSET)) { + OLA_WARN << "ACN header is bad, discarding"; + return; + } + + HeaderSet header_set; + m_inflator->InflatePDUBlock(header_set, + m_recv_buffer + DATA_OFFSET, + static_cast(size - DATA_OFFSET)); + return; +} + + +bool UDPTransport::JoinMulticast(const struct in_addr &group) { + return m_socket.JoinMulticast(m_interface.ip_address, group); +} + + +bool UDPTransport::LeaveMulticast(const struct in_addr &group) { + return m_socket.LeaveMulticast(m_interface.ip_address, group); +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.h b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.h new file mode 100644 index 0000000..ffc2c79 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransport.h @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * UDPTransport.h + * Interface for the UDPTransport class + * Copyright (C) 2007-2009 Simon Newton + */ + +#ifndef PLUGINS_E131_E131_UDPTRANSPORT_H_ +#define PLUGINS_E131_E131_UDPTRANSPORT_H_ + +#include +#include "ola/network/InterfacePicker.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "plugins/e131/e131/PDU.h" +#include "plugins/e131/e131/BaseInflator.h" + +namespace ola { +namespace plugin { +namespace e131 { + +/* + * Used to send and recv PDUs over UDP + */ +class UDPTransport { + public: + static const uint16_t ACN_PORT = 5568; + + explicit UDPTransport(uint16_t port = ACN_PORT): + m_inflator(NULL), + m_port(port), + m_send_buffer(NULL), + m_recv_buffer(NULL) { + } + + UDPTransport(BaseInflator *inflator, + uint16_t port = ACN_PORT): + m_inflator(inflator), + m_port(port), + m_send_buffer(NULL), + m_recv_buffer(NULL) { + } + ~UDPTransport(); + + bool Init(const ola::network::Interface &interface); + bool Send(const PDUBlock &pdu_block, + const struct sockaddr_in &destination); + ola::network::UdpSocket *GetSocket() { return &m_socket; } + void SetInflator(BaseInflator *inflator) { m_inflator = inflator; } + void Receive(); + + bool JoinMulticast(const struct in_addr &group); + bool LeaveMulticast(const struct in_addr &group); + + private: + ola::network::UdpSocket m_socket; + ola::network::Interface m_interface; + BaseInflator *m_inflator; + uint16_t m_port; + uint8_t *m_send_buffer; + uint8_t *m_recv_buffer; + + static const char ACN_PACKET_ID[]; // ASC-E1.17\0\0\0 + // TODO(simon): add MTU discovery? + static const unsigned int MAX_DATAGRAM_SIZE = 1472; + static const uint16_t PREAMBLE_SIZE = 0x10; + static const uint16_t POSTABLE_SIZE = 0; + static const unsigned int PREAMBLE_OFFSET = 4; + static const unsigned int DATA_OFFSET = PREAMBLE_OFFSET + 12; +}; +} // e131 +} // plugin +} // ola +#endif // PLUGINS_E131_E131_UDPTRANSPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransportTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransportTest.cpp new file mode 100644 index 0000000..f78758a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/UDPTransportTest.cpp @@ -0,0 +1,103 @@ +/* + * 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 Library 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. + * + * UDPTransportTest.cpp + * Test fixture for the UDPTransport class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include + +#include "ola/Logging.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/NetworkUtils.h" +#include "ola/network/SelectServer.h" +#include "ola/network/Socket.h" +#include "plugins/e131/e131/PDUTestCommon.h" +#include "plugins/e131/e131/UDPTransport.h" + +namespace ola { +namespace plugin { +namespace e131 { + +using ola::network::HostToNetwork; + +class UDPTransportTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(UDPTransportTest); + CPPUNIT_TEST(testUDPTransport); + CPPUNIT_TEST_SUITE_END(); + + public: + UDPTransportTest(): TestFixture(), m_ss(NULL) {} + void testUDPTransport(); + void setUp(); + void tearDown(); + void Stop(); + void FatalStop() { CPPUNIT_ASSERT(false); } + + private: + ola::network::SelectServer *m_ss; + static const int ABORT_TIMEOUT_IN_MS = 1000; +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(UDPTransportTest); + +void UDPTransportTest::setUp() { + m_ss = new ola::network::SelectServer(); +} + +void UDPTransportTest::tearDown() { + delete m_ss; +} + +void UDPTransportTest::Stop() { + if (m_ss) + m_ss->Terminate(); +} + + +/* + * Test the UDPTransport + */ +void UDPTransportTest::testUDPTransport() { + CID cid; + Closure *stop_closure = NewClosure(this, &UDPTransportTest::Stop); + MockInflator inflator(cid, stop_closure); + ola::network::Interface interface; + UDPTransport transport(&inflator); + CPPUNIT_ASSERT(transport.Init(interface)); + m_ss->AddSocket(transport.GetSocket()); + + PDUBlock pdu_block; + MockPDU mock_pdu(4, 8); + pdu_block.AddPDU(&mock_pdu); + + struct sockaddr_in destination; + destination.sin_family = AF_INET; + destination.sin_port = HostToNetwork(UDPTransport::ACN_PORT); + ola::InitLogging(ola::OLA_LOG_DEBUG, ola::OLA_LOG_STDERR); + ola::network::StringToAddress("255.255.255.255", destination.sin_addr); + CPPUNIT_ASSERT(transport.Send(pdu_block, destination)); + + SingleUseClosure *closure = + NewSingleClosure(this, &UDPTransportTest::FatalStop); + m_ss->RegisterSingleTimeout(ABORT_TIMEOUT_IN_MS, closure); + m_ss->Run(); + delete stop_closure; +} +} // e131 +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/e131_transmit_test.cpp b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/e131_transmit_test.cpp new file mode 100644 index 0000000..b8d0ed0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/e131/e131_transmit_test.cpp @@ -0,0 +1,273 @@ +/* + * 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 Library 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. + * + * e131_transmit_test.cpp + * The sends custom E1.31 packets in order to test the implementation of a + * remote node. + * Copyright (C) 2010 Simon Newton + * + * The remote node needs to be listening for Universe 1. + */ + +#include "plugins/e131/e131/E131Includes.h" // NOLINT, this has to be first +#include +#include +#include +#include "ola/DmxBuffer.h" +#include "ola/Logging.h" +#include "plugins/e131/e131/E131TestFramework.h" + +DmxBuffer BufferFromString(const string &data) { + DmxBuffer buffer; + buffer.SetFromString(data); + return buffer; +} + + +DmxBuffer BufferFromValue(uint8_t value) { + DmxBuffer buffer; + buffer.SetRangeToValue(0, value, DMX_UNIVERSE_SIZE); + return buffer; +} + + +TestState s1("Single Source Send", + new NodeSimpleSend(20), + new NodeInactive(), + "512 x 20", + BufferFromValue(20)); +TestState s2("Single Source Timeout", + new NodeInactive(), + new NodeInactive(), + "Loss of data after 2.5s", + DmxBuffer()); +TestState s3("Single Source Send", + new NodeSimpleSend(10), + new NodeInactive(), + "512 x 10", + BufferFromValue(10)); +TestState s4("Single Source Terminate", + new NodeTerminate(), + new NodeInactive(), + "Immediate loss of data", + DmxBuffer()); +TestState s5("Single Source Send", + new NodeSimpleSend(30), + new NodeInactive(), + "512 x 30", + BufferFromValue(30)); +TestState s6("Single Source Terminate with data", + new NodeTerminateWithData(10), + new NodeInactive(), + "Immediate loss of data, no values of 10", + DmxBuffer()); +TestState s7("Single Source priority = 201", + new NodeSimpleSend(201), + new NodeInactive(), + "No data, priority > 200 should be ignored", + DmxBuffer()); +TestState s8("Single Source priority = 100", + new NodeSimpleSend(100), + new NodeInactive(), + "512 x 100", + BufferFromValue(100)); +TestState s9("Single Source priority = 99", + new NodeSimpleSend(99), + new NodeInactive(), + "512 x 99, missing data indicates a problem when a source reduces" + " it's priority", + BufferFromValue(99)); +// stay in this state for 3s +TestState s10("Single Source Timeout", + new NodeInactive(), + new NodeInactive(), + "Loss of data after 2.5s", + DmxBuffer()); +TestState s11("Single Source Terminate with data", + new NodeTerminateWithData(10), + new NodeInactive(), + "No effect, source should have already timed out", + DmxBuffer()); + +// now test sequence handling +TestState s12("Single Source Sequence Test", + // 1 in 4 change of sending a packet with 0s rather than 255s + new NodeVarySequenceNumber(255, 0, 4), + new NodeInactive(), + "512x255, any 0s indicate a problem ith seq #", + BufferFromValue(255)); +TestState s13("Single Source Terminate", + new NodeTerminate(), + new NodeInactive(), + "Immediate loss of data", + DmxBuffer()); + +// now we do the merge tests, this tests a second source appearing with a +// priority less than the active one +TestState s14("Single Source Send", + new NodeSimpleSend(20), + new NodeInactive(), + "512 x 20", + BufferFromValue(20)); +TestState s15("Dual Sources with pri 20 & 10", + new NodeSimpleSend(20), + new NodeSimpleSend(10), + "512 x 20, no values of 10 otherwise this indicates a priority " + "problem", + BufferFromValue(20)); + +RelaxedTestState s16("Dual Sources with pri 20 & 30", + new NodeSimpleSend(20), + new NodeSimpleSend(30), + "One packet of 512x20, the 512 x 30", + BufferFromValue(20), + BufferFromValue(30)); +RelaxedTestState s17("Dual Sources with pri 20 & 10", + new NodeSimpleSend(20), + new NodeSimpleSend(10, "100,100,100,100"), + "512 x 20, may see single packet with 4 x 100", + BufferFromString("100,100,100,100"), + BufferFromValue(20)); +RelaxedTestState s18("Dual Sources with pri 20 & 20, HTP merge", + new NodeSimpleSend(20, "1,1,100,100"), + new NodeSimpleSend(20, "100,100,1,1"), + "4 x 100 if we HTP merge for arbitration", + BufferFromString("1,1,100,100"), + BufferFromString("100,100,100,100")); +RelaxedTestState s19("Dual Sources with pri 20 & 20, HTP merge", + new NodeSimpleSend(20, "1,1,100,0"), + new NodeSimpleSend(20, "100,0,1,1"), + "[100,1,100,1] if we HTP merge for arbitration", + BufferFromString("100,100,100,1"), + BufferFromString("100,1,100,1")); +// timing is important here +OrderedTestState s20("Dual Sources with one timing out", + new NodeInactive(), + new NodeSimpleSend(20, "100,0,1,1"), + "[100,0,1,1] after 2.5s", + BufferFromString("100,1,100,1"), + BufferFromString("100,0,1,1")); +TestState s21("Timeout", + new NodeInactive(), + new NodeInactive(), + "Loss of all data after 2.5s", + BufferFromString("100,0,1,1")); + +// now we test the case where a data arrives from a new source more than the +// active priority +TestState s22("Single Source Send", + new NodeSimpleSend(20), + new NodeInactive(), + "512 x 20", + BufferFromValue(20)); +RelaxedTestState s23("Dual Sources with pri 20 & 30", + new NodeSimpleSend(20), + new NodeSimpleSend(30), + "512 x 20, followed by 512 x 30", + BufferFromValue(20), + BufferFromValue(30)); +TestState s24("Both Sources Terminate", + new NodeTerminate(), + new NodeTerminate(), + "Loss of data, may see 512 x 20", + DmxBuffer()); + +// now we test the case where a data arrives from a new source equal to the +// active priority +TestState s25("Single Source Send", + new NodeSimpleSend(20, "20,20,20,20"), + new NodeInactive(), + "20,20,20,20", + BufferFromString("20,20,20,20")); +RelaxedTestState s26("Dual Sources with pri 20 & 20", + new NodeSimpleSend(20, "20,20,20,20"), + new NodeSimpleSend(20, "100,100,100,100"), + "[20,20,20,20], then [100,100,100,100]", + BufferFromString("20,20,20,20"), + BufferFromString("100,100,100,100")); +RelaxedTestState s27("Terminate second source", + new NodeSimpleSend(20, "20,20,20,20"), + new NodeTerminate(), + "512 x 20", + BufferFromString("100,100,100,100"), + BufferFromString("20,20,20,20")); + +TestState *states[] = {&s1, &s2, &s3, &s4, &s5, &s6, &s7, &s8, &s9, &s10, + &s11, &s11, &s12, &s13, &s14, &s15, &s16, &s17, &s18, + &s19, &s20, &s21, &s22, &s23, &s24, &s25, &s26, &s27, + NULL}; + + +/* + * Display the help message + */ +void DisplayHelp(const char *binary_name) { + cout << "Usage: " << binary_name << " [--interactive]\n" + "\n" + "Run the E1.31 Transmit test. This test can run in one of two modes:\n" + " * interactive mode. This sends data to the multicast addresses\n" + " and a human gets to verify it.\n" + " * local mode (default). This starts a local E131Node and sends it data,\n" + " verifying against the expected output.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -i, --interactive Run in interactive mode.\n" + << endl; +} + + +int main(int argc, char* argv[]) { + bool interactive_mode = false; + + ola::InitLogging(ola::OLA_LOG_INFO, ola::OLA_LOG_STDERR); + std::vector test_states; + TestState **ptr = states; + while (*ptr) + test_states.push_back(*ptr++); + + static struct option long_options[] = { + {"interactive", no_argument, 0, 'i'}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + + int option_index = 0; + + while (1) { + int c = getopt_long(argc, argv, "ih", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'h': + DisplayHelp(argv[0]); + return 0; + case 'i': + interactive_mode = true; + break; + case '?': + break; + default: + break; + } + } + StateManager manager(test_states, interactive_mode); + manager.Init(); + manager.Run(); + return manager.Passed() ? 0 : 1; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/E131ConfigMessages.proto b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/E131ConfigMessages.proto new file mode 100644 index 0000000..30e3918 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/E131ConfigMessages.proto @@ -0,0 +1,73 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ConfigMessages.proto + * Defines the protocol buffers used to configure the Artnet device + * Copyright (C) 2005 - 2008 Simon Newton + */ + +package ola.plugin.e131; + +/* + * Controls the preview bit for output ports. + */ +message PreviewModeRequest { + required int32 port_id = 1; + required bool preview_mode = 2; + required bool input_port = 3; +} + + +message InputPortInfo { + required int32 port_id = 1; + required bool preview_mode = 2; +} + + +message OutputPortInfo { + required int32 port_id = 1; + required bool preview_mode = 2; +} + + +/* + * Contains the status of input & output ports + */ +message PortInfoReply { + repeated InputPortInfo input_port = 1; + repeated OutputPortInfo output_port = 2; +} + + +/* + * A generic request + */ +message Request { + enum RequestType { + E131_PORT_INFO = 1; + E131_PREVIEW_MODE = 2; + } + + required RequestType type = 1; + optional PreviewModeRequest preview_mode = 2; +} + +message Reply { + enum ReplyType { + E131_PORT_INFO = 1; + } + required ReplyType type = 1; + optional PortInfoReply port_info = 2; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.am new file mode 100644 index 0000000..f74d2bf --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.am @@ -0,0 +1,19 @@ +include $(top_srcdir)/common.mk + +pkgincludedir = $(includedir)/ola/e131 +lib_LTLIBRARIES = libolae131conf.la +nodist_pkginclude_HEADERS = E131ConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolae131conf.pc + +BUILT_SOURCES = E131ConfigMessages.pb.cc E131ConfigMessages.pb.h + +nodist_libolae131conf_la_SOURCES = E131ConfigMessages.pb.cc + +EXTRA_DIST = E131ConfigMessages.proto + +E131ConfigMessages.pb.cc E131ConfigMessages.pb.h: E131ConfigMessages.proto + protoc --cpp_out ./ E131ConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.in new file mode 100644 index 0000000..584ced4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/Makefile.in @@ -0,0 +1,553 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libolae131conf.pc.in $(top_srcdir)/common.mk +subdir = plugins/e131/messages +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libolae131conf.pc +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolae131conf_la_LIBADD = +nodist_libolae131conf_la_OBJECTS = E131ConfigMessages.pb.lo +libolae131conf_la_OBJECTS = $(nodist_libolae131conf_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nodist_libolae131conf_la_SOURCES) +DIST_SOURCES = +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +nodist_pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(nodist_pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/e131 +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +lib_LTLIBRARIES = libolae131conf.la +nodist_pkginclude_HEADERS = E131ConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolae131conf.pc +BUILT_SOURCES = E131ConfigMessages.pb.cc E131ConfigMessages.pb.h +nodist_libolae131conf_la_SOURCES = E131ConfigMessages.pb.cc +EXTRA_DIST = E131ConfigMessages.proto +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/e131/messages/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/e131/messages/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +libolae131conf.pc: $(top_builddir)/config.status $(srcdir)/libolae131conf.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolae131conf.la: $(libolae131conf_la_OBJECTS) $(libolae131conf_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolae131conf_la_OBJECTS) $(libolae131conf_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/E131ConfigMessages.pb.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(nodist_pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-nodist_pkgincludeHEADERS \ + install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ + install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + + +E131ConfigMessages.pb.cc E131ConfigMessages.pb.h: E131ConfigMessages.proto + protoc --cpp_out ./ E131ConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} +# 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/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/libolae131conf.pc.in b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/libolae131conf.pc.in new file mode 100644 index 0000000..c6780c3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/e131/messages/libolae131conf.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libolae131conf +Version: @VERSION@ +Description: Open Lighting Architecture - E1.31 Config Messages +Libs: -lprotobuf diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.cpp new file mode 100644 index 0000000..3dd4872 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.cpp @@ -0,0 +1,109 @@ +/* + * 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 Library 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. + * + * EspNetDevice.cpp + * Esp-Net device + * Copyright (C) 2005-2006 Simon Newton + * + * + */ + +#include +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" + +#include "plugins/espnet/EspNetDevice.h" +#include "plugins/espnet/EspNetNode.h" +#include "plugins/espnet/EspNetPluginCommon.h" +#include "plugins/espnet/EspNetPort.h" + +namespace ola { +namespace plugin { +namespace espnet { + +const char EspNetDevice::ESPNET_DEVICE_NAME[] = "ESP Net"; +const char EspNetDevice::IP_KEY[] = "ip"; +const char EspNetDevice::NODE_NAME_KEY[] = "name"; + +/* + * Create a new device + */ +EspNetDevice::EspNetDevice(Plugin *owner, + Preferences *prefs, + const PluginAdaptor *plugin_adaptor): + Device(owner, ESPNET_DEVICE_NAME), + m_preferences(prefs), + m_plugin_adaptor(plugin_adaptor), + m_node(NULL) { +} + + +/* + * Start this device + */ +bool EspNetDevice::StartHook() { + m_node = new EspNetNode(m_preferences->GetValue(IP_KEY)); + m_node->SetName(m_preferences->GetValue(NODE_NAME_KEY)); + m_node->SetType(ESPNET_NODE_TYPE_IO); + + if (!m_node->Start()) { + delete m_node; + m_node = NULL; + return false; + } + + stringstream str; + str << ESPNET_DEVICE_NAME << " [" << + ola::network::AddressToString(m_node->GetInterface().ip_address) << "]"; + SetName(str.str()); + + for (unsigned int i = 0; i < PORTS_PER_DEVICE; i++) { + EspNetInputPort *input_port = new EspNetInputPort( + this, + i, + m_plugin_adaptor->WakeUpTime(), + m_node); + AddPort(input_port); + EspNetOutputPort *output_port = new EspNetOutputPort(this, i, m_node); + AddPort(output_port); + } + + m_plugin_adaptor->AddSocket(m_node->GetSocket()); + return true; +} + + +/* + * Stop this device + */ +void EspNetDevice::PrePortStop() { + m_plugin_adaptor->RemoveSocket(m_node->GetSocket()); +} + +/* + * Stop this device + */ +void EspNetDevice::PostPortStop() { + m_node->Stop(); + delete m_node; + m_node = NULL; +} +} // espnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.h new file mode 100644 index 0000000..5d86f34 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetDevice.h @@ -0,0 +1,58 @@ +/* + * 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 Library 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. + * + * EspNetDevice.h + * Interface for the EspNet device + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETDEVICE_H_ +#define PLUGINS_ESPNET_ESPNETDEVICE_H_ + +#include +#include "olad/Device.h" +#include "olad/Plugin.h" + +namespace ola { +namespace plugin { +namespace espnet { + +class EspNetDevice: public Device { + public: + EspNetDevice(Plugin *owner, + class Preferences *prefs, + const class PluginAdaptor *plugin_adaptor); + + string DeviceId() const { return "1"; } + + static const char IP_KEY[]; + static const char NODE_NAME_KEY[]; + + protected: + bool StartHook(); + void PrePortStop(); + void PostPortStop(); + + private: + class Preferences *m_preferences; + const class PluginAdaptor *m_plugin_adaptor; + class EspNetNode *m_node; + + static const char ESPNET_DEVICE_NAME[]; +}; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.cpp new file mode 100644 index 0000000..f902a13 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.cpp @@ -0,0 +1,448 @@ +/* + * 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 Library 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. + * + * EspNetNode.cpp + * A EspNet node + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "ola/network/InterfacePicker.h" +#include "plugins/espnet/EspNetNode.h" + + +namespace ola { +namespace plugin { +namespace espnet { + +using std::string; +using std::map; +using ola::network::UdpSocket; +using ola::network::HostToNetwork; +using ola::network::NetworkToHost; +using ola::Closure; + +const char EspNetNode::NODE_NAME[] = "OLA Node"; + +/* + * Create a new node + * @param ip_address the IP address to prefer to listen on, if NULL we choose + * one. + */ +EspNetNode::EspNetNode(const string &ip_address) + : m_running(false), + m_options(DEFAULT_OPTIONS), + m_tos(DEFAULT_TOS), + m_ttl(DEFAULT_TTL), + m_universe(0), + m_type(ESPNET_NODE_TYPE_IO), + m_node_name(NODE_NAME), + m_preferred_ip(ip_address) { +} + + +/* + * Cleanup + */ +EspNetNode::~EspNetNode() { + Stop(); + + std::map::iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) { + delete iter->second.closure; + } + m_handlers.clear(); +} + + +/* + * Start this node + */ +bool EspNetNode::Start() { + if (m_running) + return false; + + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + + if (!picker->ChooseInterface(&m_interface, m_preferred_ip)) { + OLA_INFO << "Failed to find an interface"; + delete picker; + return false; + } + delete picker; + + if (!InitNetwork()) + return false; + + m_running = true; + return true; +} + + +/* + * Stop this node + */ +bool EspNetNode::Stop() { + if (!m_running) + return false; + + m_running = false; + return true; +} + + +/* + * Called when there is data on this socket + */ +void EspNetNode::SocketReady() { + espnet_packet_union_t packet; + memset(&packet, 0, sizeof(packet)); + struct sockaddr_in source; + socklen_t source_length = sizeof(source); + + ssize_t packet_size = sizeof(packet); + if (!m_socket.RecvFrom(reinterpret_cast(&packet), + &packet_size, + source, + source_length)) + return; + + if (packet_size < (ssize_t) sizeof(packet.poll.head)) { + OLA_WARN << "Small espnet packet received, discarding"; + return; + } + + // skip packets sent by us + if (source.sin_addr.s_addr == m_interface.ip_address.s_addr) { + return; + } + + switch (NetworkToHost(packet.poll.head)) { + case ESPNET_POLL: + HandlePoll(packet.poll, packet_size, source.sin_addr); + break; + case ESPNET_REPLY: + HandleReply(packet.reply, packet_size, source.sin_addr); + break; + case ESPNET_DMX: + HandleData(packet.dmx, packet_size, source.sin_addr); + break; + case ESPNET_ACK: + HandleAck(packet.ack, packet_size, source.sin_addr); + break; + default: + OLA_INFO << "Skipping a packet with invalid header" << packet.poll.head; + } +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool EspNetNode::SetHandler(uint8_t universe, + DmxBuffer *buffer, + Closure *closure) { + if (!closure) + return false; + + map::iterator iter = + m_handlers.find(universe); + + if (iter == m_handlers.end()) { + universe_handler handler; + handler.buffer = buffer; + handler.closure = closure; + m_handlers[universe] = handler; + } else { + Closure *old_closure = iter->second.closure; + iter->second.closure = closure; + delete old_closure; + } + return true; +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool EspNetNode::RemoveHandler(uint8_t universe) { + map::iterator iter = + m_handlers.find(universe); + + if (iter != m_handlers.end()) { + Closure *old_closure = iter->second.closure; + m_handlers.erase(iter); + delete old_closure; + return true; + } + return false; +} + + +/* + * Send an Esp Poll + * @param full_poll + */ +bool EspNetNode::SendPoll(bool full_poll) { + if (!m_running) + return false; + + return SendEspPoll(m_interface.bcast_address, full_poll); +} + + +/* + * Send some DMX data + * @param universe the id of the universe to send + * @param buffer the DMX data + * @return true if it was send successfully, false otherwise + */ +bool EspNetNode::SendDMX(uint8_t universe, const ola::DmxBuffer &buffer) { + if (!m_running) + return false; + + return SendEspData(m_interface.bcast_address, universe, buffer); +} + + +/* + * Setup the networking compoents. + */ +bool EspNetNode::InitNetwork() { + if (!m_socket.Init()) { + OLA_WARN << "Socket init failed"; + return false; + } + + if (!m_socket.Bind(ESPNET_PORT)) { + OLA_WARN << "Failed to bind to:" << ESPNET_PORT; + return false; + } + + if (!m_socket.EnableBroadcast()) { + OLA_WARN << "Failed to enable broadcasting"; + return false; + } + + m_socket.SetOnData(NewClosure(this, &EspNetNode::SocketReady)); + return true; +} + + +/* + * Handle an Esp Poll packet + */ +void EspNetNode::HandlePoll(const espnet_poll_t &poll, + ssize_t length, + const struct in_addr &source) { + OLA_DEBUG << "Got ESP Poll " << poll.type; + if (length < (ssize_t) sizeof(espnet_poll_t)) { + OLA_DEBUG << "Poll size too small " << length << " < " << + sizeof(espnet_poll_t); + return; + } + + if (poll.type) + SendEspPollReply(source); + else + SendEspAck(source, 0, 0); +} + + +/* + * Handle an Esp reply packet + */ +void EspNetNode::HandleReply(const espnet_poll_reply_t &reply, + ssize_t length, + const struct in_addr &source) { + if (length < (ssize_t) sizeof(espnet_poll_reply_t)) { + OLA_DEBUG << "Poll reply size too small " << length << " < " << + sizeof(espnet_poll_reply_t); + return; + } + + // TODO(simon): Call a handler here + (void) reply; + (void) source; +} + + +/* + * Handle a Esp Ack packet + */ +void EspNetNode::HandleAck(const espnet_ack_t &ack, + ssize_t length, + const struct in_addr &source) { + if (length < (ssize_t) sizeof(espnet_ack_t)) { + OLA_DEBUG << "Ack size too small " << length << " < " << + sizeof(espnet_ack_t); + return; + } + + (void) ack; + (void) source; +} + + +/* + * Handle an Esp data packet + */ +void EspNetNode::HandleData(const espnet_data_t &data, + ssize_t length, + const struct in_addr &source) { + static const ssize_t header_size = sizeof(espnet_data_t) - DMX_UNIVERSE_SIZE; + if (length < header_size) { + OLA_DEBUG << "Data size too small " << length << " < " << header_size; + return; + } + + map::iterator iter = + m_handlers.find(data.universe); + + if (iter == m_handlers.end()) { + OLA_DEBUG << "Not interested in universe " << + static_cast(data.universe) << ", skipping "; + return; + } + + ssize_t data_size = std::min(length - header_size, + (ssize_t) NetworkToHost(data.size)); + + // we ignore the start code + switch (data.type) { + case DATA_RAW: + iter->second.buffer->Set(data.data, data_size); + break; + case DATA_PAIRS: + OLA_WARN << "espnet data pairs aren't supported"; + return; + case DATA_RLE: + m_decoder.Decode(iter->second.buffer, data.data, data_size); + break; + default: + OLA_WARN << "unknown espnet data type " << data.type; + return; + } + iter->second.closure->Run(); + (void) source; +} + + +/* + * Send an EspNet poll + */ +bool EspNetNode::SendEspPoll(const struct in_addr &dst, bool full) { + espnet_packet_union_t packet; + packet.poll.head = HostToNetwork((uint32_t) ESPNET_POLL); + packet.poll.type = full; + return SendPacket(dst, packet, sizeof(packet.poll)); +} + + +/* + * Send an EspNet Ack + */ +bool EspNetNode::SendEspAck(const struct in_addr &dst, + uint8_t status, + uint8_t crc) { + espnet_packet_union_t packet; + packet.ack.head = HostToNetwork((uint32_t) ESPNET_ACK); + packet.ack.status = status; + packet.ack.crc = crc; + return SendPacket(dst, packet, sizeof(packet.ack)); +} + + +/* + * Send an EspNet Poll Reply + */ +bool EspNetNode::SendEspPollReply(const struct in_addr &dst) { + espnet_packet_union_t packet; + packet.reply.head = HostToNetwork((uint32_t) ESPNET_REPLY); + + memcpy(packet.reply.mac, m_interface.hw_address, ola::network::MAC_LENGTH); + packet.reply.type = HostToNetwork((uint32_t) m_type); + packet.reply.version = FIRMWARE_VERSION; + packet.reply.sw = SWITCH_SETTINGS; + memcpy(packet.reply.name, m_node_name.data(), ESPNET_NAME_LENGTH); + packet.reply.name[ESPNET_NAME_LENGTH - 1] = 0; + + packet.reply.option = m_options; + packet.reply.option = 0x01; + packet.reply.tos = m_tos; + packet.reply.ttl = m_ttl; + packet.reply.config.listen = 0x04; + memcpy(&packet.reply.config.ip, &m_interface.ip_address.s_addr, + sizeof(packet.reply.config.ip)); + packet.reply.config.universe = m_universe; + return SendPacket(dst, packet, sizeof(packet.reply)); +} + + +/* + * Send an EspNet data packet + */ +bool EspNetNode::SendEspData(const struct in_addr &dst, + uint8_t universe, + const DmxBuffer &buffer) { + espnet_packet_union_t packet; + memset(&packet.dmx, 0, sizeof(packet.dmx)); + packet.dmx.head = HostToNetwork((uint32_t) ESPNET_DMX); + packet.dmx.universe = universe; + packet.dmx.start = START_CODE; + packet.dmx.type = DATA_RAW; + unsigned int size = DMX_UNIVERSE_SIZE; + buffer.Get(packet.dmx.data, &size); + packet.dmx.size = HostToNetwork((uint16_t) size); + return SendPacket(dst, packet, sizeof(packet.dmx)); +} + + +/* + * Send an EspNet packet + */ +bool EspNetNode::SendPacket(const struct in_addr &dst, + const espnet_packet_union_t &packet, + unsigned int size) { + struct sockaddr_in m_destination; + memset(&m_destination, 0, sizeof(m_destination)); + m_destination.sin_family = AF_INET; + m_destination.sin_port = HostToNetwork((uint16_t) ESPNET_PORT); + m_destination.sin_addr = dst; + + ssize_t bytes_sent = m_socket.SendTo( + reinterpret_cast(&packet), + size, + m_destination); + if (bytes_sent != (ssize_t) size) { + OLA_WARN << "Only sent " << bytes_sent << " of " << size; + return false; + } + return true; +} +} // espnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.h new file mode 100644 index 0000000..7946f29 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetNode.h @@ -0,0 +1,137 @@ +/* + * 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 Library 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. + * + * EspNetNode.h + * Header file for the EspNetNode class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETNODE_H_ +#define PLUGINS_ESPNET_ESPNETNODE_H_ + +#include +#include +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/network/Interface.h" +#include "ola/network/Socket.h" +#include "plugins/espnet/EspNetPackets.h" +#include "plugins/espnet/RunLengthDecoder.h" + +namespace ola { +namespace plugin { +namespace espnet { + +// the node types +typedef enum { + ESPNET_NODE_TYPE_SINGLE_OUT = 0x0001, // ip to dmx + ESPNET_NODE_TYPE_SINGLE_IN = 0x0002, // dmx to ip + ESPNET_NODE_TYPE_RS232 = 0x0060, + ESPNET_NODE_TYPE_IO = 0x0061, // multi universe + ESPNET_NODE_TYPE_LONWORKS = 0x0100, +} espnet_node_type; + +enum { ESPNET_MAX_UNIVERSES = 512 }; + + +class EspNetNode { + public: + explicit EspNetNode(const std::string &ip_address); + virtual ~EspNetNode(); + + bool Start(); + bool Stop(); + + const ola::network::Interface &GetInterface() const { + return m_interface; + } + + void SetName(const std::string &name) { m_node_name = name; } + void SetType(espnet_node_type type) { m_type = type; } + void SetUniverse(uint8_t universe) { m_universe = universe; } + + // IO methods + ola::network::UdpSocket* GetSocket() { return &m_socket; } + void SocketReady(); + + // DMX Receiving methods + bool SetHandler(uint8_t universe, DmxBuffer *buffer, + ola::Closure *handler); + bool RemoveHandler(uint8_t universe); + + // Sending methods + bool SendPoll(bool full_poll = false); + bool SendDMX(uint8_t universe, const ola::DmxBuffer &buffer); + + private: + typedef struct { + DmxBuffer *buffer; + Closure *closure; + } universe_handler; + + EspNetNode(const EspNetNode&); + EspNetNode& operator=(const EspNetNode&); + bool InitNetwork(); + void HandlePoll(const espnet_poll_t &poll, ssize_t length, + const struct in_addr &source); + void HandleReply(const espnet_poll_reply_t &reply, + ssize_t length, + const struct in_addr &source); + void HandleAck(const espnet_ack_t &ack, ssize_t length, + const struct in_addr &source); + void HandleData(const espnet_data_t &data, ssize_t length, + const struct in_addr &source); + + bool SendEspPoll(const struct in_addr &dst, bool full); + bool SendEspAck(const struct in_addr &dst, + uint8_t status, + uint8_t crc); + bool SendEspPollReply(const struct in_addr &dst); + bool SendEspData(const struct in_addr &dst, + uint8_t universe, + const DmxBuffer &buffer); + bool SendPacket(const struct in_addr &dst, + const espnet_packet_union_t &packet, + unsigned int size); + + bool m_running; + uint8_t m_options; + uint8_t m_tos; + uint8_t m_ttl; + uint8_t m_universe; + espnet_node_type m_type; + std::string m_node_name; + std::string m_preferred_ip; + std::map m_handlers; + ola::network::Interface m_interface; + ola::network::UdpSocket m_socket; + RunLengthDecoder m_decoder; + + static const char NODE_NAME[]; + static const uint8_t DEFAULT_OPTIONS = 0; + static const uint8_t DEFAULT_TOS = 0; + static const uint8_t DEFAULT_TTL = 4; + static const uint8_t FIRMWARE_VERSION = 1; + static const uint8_t SWITCH_SETTINGS = 0; + static const uint16_t ESPNET_PORT = 3333; + static const uint8_t DATA_RAW = 1; + static const uint8_t DATA_PAIRS = 2; + static const uint8_t DATA_RLE = 4; + static const uint8_t START_CODE = 0; +}; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETNODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPackets.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPackets.h new file mode 100644 index 0000000..96854a2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPackets.h @@ -0,0 +1,128 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * EspNetPackets.h + * Datagram definitions for EspNet + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETPACKETS_H_ +#define PLUGINS_ESPNET_ESPNETPACKETS_H_ + +#include +#include +#include + +#include "ola/network/InterfacePicker.h" // MAC_LENGTH +#include "ola/BaseTypes.h" + +namespace ola { +namespace plugin { +namespace espnet { + +enum { ESPNET_NAME_LENGTH = 10 }; +enum { ESPNET_DATA_LENGTH = 200 }; + +enum espnet_packet_type_e { + ESPNET_POLL = 'E' << 24 | 'S' << 16 | 'P' << 8 | 'P', + ESPNET_REPLY = 'E' << 24 | 'S' << 16 | 'P' << 8 | 'R', + ESPNET_DMX = 'E' << 24 | 'S' << 16 | 'D' << 8 | 'D', + ESPNET_ACK = 'E' << 24 | 'S' << 16 | 'A' << 8 | 'P' +}__attribute__((packed)); + +typedef enum espnet_packet_type_e espnet_packet_type_t; + +/* + * poll datagram + */ +struct espnet_poll_s { + uint32_t head; + uint8_t type; +} __attribute__((packed)); + +typedef struct espnet_poll_s espnet_poll_t; + + +/* + * This is used in the poll reply and config + */ +struct espnet_node_config_s { + uint8_t listen; + uint8_t ip[4]; + uint8_t universe; // bit bizzare that nodes only listen to one universe?? +}; + +typedef struct espnet_node_config_s espnet_node_config_t; + +/* + * poll reply + */ +struct espnet_poll_reply_s { + uint32_t head; + uint8_t mac[ola::network::MAC_LENGTH]; + uint16_t type; + uint8_t version; + uint8_t sw; + uint8_t name[ESPNET_NAME_LENGTH]; + uint8_t option; + uint8_t tos; + uint8_t ttl; + espnet_node_config_t config; +} __attribute__((packed)); + +typedef struct espnet_poll_reply_s espnet_poll_reply_t; + +/* + * ack datagram + */ +struct espnet_ack_s { + uint32_t head; + uint8_t status; + uint8_t crc; +} __attribute__((packed)); + +typedef struct espnet_ack_s espnet_ack_t; + +/* + * dmx datagram + */ +struct espnet_data_s { + uint32_t head; + uint8_t universe; + uint8_t start; + uint8_t type; + uint16_t size; + uint8_t data[DMX_UNIVERSE_SIZE]; +} __attribute__((packed)); + +typedef struct espnet_data_s espnet_data_t; + + +// we need to add the TCP config crap here + + +/* + * union of all espnet packets + */ +typedef union { + espnet_poll_t poll; + espnet_poll_reply_t reply; + espnet_ack_t ack; + espnet_data_t dmx; +} espnet_packet_union_t; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETPACKETS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.cpp new file mode 100644 index 0000000..c5fc191 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.cpp @@ -0,0 +1,130 @@ +/* + * 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 Library 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. + * + * + * EspNetPlugin.cpp + * The EspNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include "olad/Preferences.h" +#include "plugins/espnet/EspNetPlugin.h" +#include "plugins/espnet/EspNetDevice.h" + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create( + const ola::PluginAdaptor *plugin_adaptor) { + return new ola::plugin::espnet::EspNetPlugin(plugin_adaptor); +} + +namespace ola { +namespace plugin { +namespace espnet { + +const char EspNetPlugin::ESPNET_NODE_NAME[] = "ola-EspNet"; +const char EspNetPlugin::PLUGIN_NAME[] = "ESP Net"; +const char EspNetPlugin::PLUGIN_PREFIX[] = "espnet"; + + +/* + * Start the plugin + * For now we just have one device. + */ +bool EspNetPlugin::StartHook() { + m_device = new EspNetDevice(this, + m_preferences, + m_plugin_adaptor); + + if (!m_device) + return false; + + if (!m_device->Start()) { + delete m_device; + return false; + } + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool EspNetPlugin::StopHook() { + if (m_device) { + bool ret = m_plugin_adaptor->UnregisterDevice(m_device); + m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin + */ +string EspNetPlugin::Description() const { + return +"Enttec ESP Net Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with five input and five output ports.\n" +"\n" +"ESP supports up to 255 universes. As ESP has no notion of ports, we provide\n" +"a fixed number of ports which can be patched to any universe. When sending\n" +"data from a port, the data is addressed to the universe the port is patched\n" +"to. For example if port 0 is patched to universe 10, the data will be\n" +"sent to ESP universe 10.\n" +"\n" +"--- Config file : ola-espnet.conf ---\n" +"\n" +"ip = a.b.c.d\n" +"The ip address to bind to. If not specified it will use the first " +"non-loopback ip.\n" +"\n" +"name = ola-EspNet\n" +"The name of the node.\n"; +} + +/* + * Set the default preferences. + */ +bool EspNetPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + save |= m_preferences->SetDefaultValue(EspNetDevice::IP_KEY, + IPv4Validator(), ""); + + save |= m_preferences->SetDefaultValue(EspNetDevice::NODE_NAME_KEY, + StringValidator(), ESPNET_NODE_NAME); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue("name").empty()) + return false; + + return true; +} +} // espnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.h new file mode 100644 index 0000000..3a9d938 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPlugin.h @@ -0,0 +1,60 @@ +/* + * 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 Library 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. + * + * EspNetPlugin.h + * Interface for the espnet plugin class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETPLUGIN_H_ +#define PLUGINS_ESPNET_ESPNETPLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace espnet { + +class EspNetDevice; + +class EspNetPlugin: public ola::Plugin { + public: + explicit EspNetPlugin(const ola::PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_device(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_ESPNET; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + EspNetDevice *m_device; + static const char ESPNET_NODE_NAME[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; +}; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETPLUGIN_H_ + diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPluginCommon.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPluginCommon.h new file mode 100644 index 0000000..d643bc4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPluginCommon.h @@ -0,0 +1,34 @@ +/* + * 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 Library 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. + * + * + * common.h + * Constants for the esp plugin + * Copyright (C) 2005 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETPLUGINCOMMON_H_ +#define PLUGINS_ESPNET_ESPNETPLUGINCOMMON_H_ + +namespace ola { +namespace plugin { +namespace espnet { + +// modify this to increase the number of ports in the plugin +enum { PORTS_PER_DEVICE = 5 }; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETPLUGINCOMMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.cpp new file mode 100644 index 0000000..59957d8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.cpp @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * EspNetPort.cpp + * The EspNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include "ola/Logging.h" +#include "olad/Universe.h" +#include "plugins/espnet/EspNetPort.h" +#include "plugins/espnet/EspNetDevice.h" +#include "plugins/espnet/EspNetNode.h" + +namespace ola { +namespace plugin { +namespace espnet { + + +string EspNetPortHelper::Description(Universe *universe) const { + std::stringstream str; + if (universe) + str << "EspNet universe " << (unsigned int) EspNetUniverseId(universe); + return str.str(); +} + + +/* + * Return the EspNet universe ID for this port. In case we don't have a + * universe, 0 is returned. Note that universe 0 is valid. + */ +uint8_t EspNetPortHelper::EspNetUniverseId(Universe *universe) const { + if (universe) + return universe->UniverseId() % ESPNET_MAX_UNIVERSES; + else + return 0; +} + + +/* + * Set the universe for an InputPort. + */ +void EspNetInputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (old_universe) + m_node->RemoveHandler(m_helper.EspNetUniverseId(old_universe)); + + if (new_universe) + m_node->SetHandler( + m_helper.EspNetUniverseId(new_universe), + &m_buffer, + ola::NewClosure(this, + &EspNetInputPort::DmxChanged)); +} + + +/* + * Write data to this port. + */ +bool EspNetOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + if (!GetUniverse()) + return false; + + if (!m_node->SendDMX(m_helper.EspNetUniverseId(GetUniverse()), buffer)) + return false; + return true; + (void) priority; +} +} // espnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.h new file mode 100644 index 0000000..1fab112 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetPort.h @@ -0,0 +1,78 @@ +/* + * 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 Library 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. + * + * EspNetPort.h + * The ESPNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_ESPNETPORT_H_ +#define PLUGINS_ESPNET_ESPNETPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "olad/Port.h" +#include "plugins/espnet/EspNetDevice.h" + +namespace ola { +namespace plugin { +namespace espnet { + +class EspNetPortHelper { + public: + string Description(Universe *universe) const; + uint8_t EspNetUniverseId(Universe *universe) const; +}; + + +class EspNetInputPort: public BasicInputPort { + public: + EspNetInputPort(EspNetDevice *parent, unsigned int id, + const TimeStamp *wake_time, EspNetNode *node) + : BasicInputPort(parent, id, wake_time), + m_helper(), + m_node(node) {} + ~EspNetInputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + const DmxBuffer &ReadDMX() const { return m_buffer; } + + private: + EspNetPortHelper m_helper; + EspNetNode *m_node; + DmxBuffer m_buffer; +}; + + +class EspNetOutputPort: public BasicOutputPort { + public: + EspNetOutputPort(EspNetDevice *parent, unsigned int id, EspNetNode *node) + : BasicOutputPort(parent, id), + m_helper(), + m_node(node) {} + ~EspNetOutputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + + private: + EspNetPortHelper m_helper; + EspNetNode *m_node; +}; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_ESPNETPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetTester.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetTester.cpp new file mode 100644 index 0000000..f60d131 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/EspNetTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * EspNetTester.cpp + * Runs all the EspNet tests + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.am new file mode 100644 index 0000000..46ef33d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.am @@ -0,0 +1,19 @@ +include $(top_srcdir)/common.mk +libdir = $(plugindir) + +EXTRA_DIST = EspNetPlugin.h EspNetDevice.h EspNetPort.h EspNetPackets.h \ + EspNetNode.h EspNetPluginCommon.h RunLengthDecoder.h + +lib_LTLIBRARIES = libolaespnet.la +libolaespnet_la_SOURCES = EspNetPlugin.cpp EspNetDevice.cpp EspNetPort.cpp \ + EspNetNode.cpp RunLengthDecoder.cpp +libolaespnet_la_LIBADD = @LIBS@ + +# Test Programs +TESTS = EspNetTester +check_PROGRAMS = $(TESTS) +EspNetTester_SOURCES = EspNetTester.cpp RunLengthDecoderTest.cpp \ + RunLengthDecoder.cpp +EspNetTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +EspNetTester_LDFLAGS = $(CPPUNIT_LIBS) +EspNetTester_LDADD = @LIBS@ -lprotobuf ../../common/libolacommon.la diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.in new file mode 100644 index 0000000..433c200 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/Makefile.in @@ -0,0 +1,650 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = EspNetTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = plugins/espnet +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolaespnet_la_DEPENDENCIES = +am_libolaespnet_la_OBJECTS = EspNetPlugin.lo EspNetDevice.lo \ + EspNetPort.lo EspNetNode.lo RunLengthDecoder.lo +libolaespnet_la_OBJECTS = $(am_libolaespnet_la_OBJECTS) +am__EXEEXT_1 = EspNetTester$(EXEEXT) +am_EspNetTester_OBJECTS = EspNetTester-EspNetTester.$(OBJEXT) \ + EspNetTester-RunLengthDecoderTest.$(OBJEXT) \ + EspNetTester-RunLengthDecoder.$(OBJEXT) +EspNetTester_OBJECTS = $(am_EspNetTester_OBJECTS) +EspNetTester_DEPENDENCIES = ../../common/libolacommon.la +EspNetTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(EspNetTester_CXXFLAGS) \ + $(CXXFLAGS) $(EspNetTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaespnet_la_SOURCES) $(EspNetTester_SOURCES) +DIST_SOURCES = $(libolaespnet_la_SOURCES) $(EspNetTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = EspNetPlugin.h EspNetDevice.h EspNetPort.h EspNetPackets.h \ + EspNetNode.h EspNetPluginCommon.h RunLengthDecoder.h + +lib_LTLIBRARIES = libolaespnet.la +libolaespnet_la_SOURCES = EspNetPlugin.cpp EspNetDevice.cpp EspNetPort.cpp \ + EspNetNode.cpp RunLengthDecoder.cpp + +libolaespnet_la_LIBADD = @LIBS@ +EspNetTester_SOURCES = EspNetTester.cpp RunLengthDecoderTest.cpp \ + RunLengthDecoder.cpp + +EspNetTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +EspNetTester_LDFLAGS = $(CPPUNIT_LIBS) +EspNetTester_LDADD = @LIBS@ -lprotobuf ../../common/libolacommon.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/espnet/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/espnet/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaespnet.la: $(libolaespnet_la_OBJECTS) $(libolaespnet_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolaespnet_la_OBJECTS) $(libolaespnet_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +EspNetTester$(EXEEXT): $(EspNetTester_OBJECTS) $(EspNetTester_DEPENDENCIES) + @rm -f EspNetTester$(EXEEXT) + $(EspNetTester_LINK) $(EspNetTester_OBJECTS) $(EspNetTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetTester-EspNetTester.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetTester-RunLengthDecoder.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EspNetTester-RunLengthDecoderTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RunLengthDecoder.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +EspNetTester-EspNetTester.o: EspNetTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-EspNetTester.o -MD -MP -MF $(DEPDIR)/EspNetTester-EspNetTester.Tpo -c -o EspNetTester-EspNetTester.o `test -f 'EspNetTester.cpp' || echo '$(srcdir)/'`EspNetTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-EspNetTester.Tpo $(DEPDIR)/EspNetTester-EspNetTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='EspNetTester.cpp' object='EspNetTester-EspNetTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-EspNetTester.o `test -f 'EspNetTester.cpp' || echo '$(srcdir)/'`EspNetTester.cpp + +EspNetTester-EspNetTester.obj: EspNetTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-EspNetTester.obj -MD -MP -MF $(DEPDIR)/EspNetTester-EspNetTester.Tpo -c -o EspNetTester-EspNetTester.obj `if test -f 'EspNetTester.cpp'; then $(CYGPATH_W) 'EspNetTester.cpp'; else $(CYGPATH_W) '$(srcdir)/EspNetTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-EspNetTester.Tpo $(DEPDIR)/EspNetTester-EspNetTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='EspNetTester.cpp' object='EspNetTester-EspNetTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-EspNetTester.obj `if test -f 'EspNetTester.cpp'; then $(CYGPATH_W) 'EspNetTester.cpp'; else $(CYGPATH_W) '$(srcdir)/EspNetTester.cpp'; fi` + +EspNetTester-RunLengthDecoderTest.o: RunLengthDecoderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-RunLengthDecoderTest.o -MD -MP -MF $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Tpo -c -o EspNetTester-RunLengthDecoderTest.o `test -f 'RunLengthDecoderTest.cpp' || echo '$(srcdir)/'`RunLengthDecoderTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Tpo $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthDecoderTest.cpp' object='EspNetTester-RunLengthDecoderTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-RunLengthDecoderTest.o `test -f 'RunLengthDecoderTest.cpp' || echo '$(srcdir)/'`RunLengthDecoderTest.cpp + +EspNetTester-RunLengthDecoderTest.obj: RunLengthDecoderTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-RunLengthDecoderTest.obj -MD -MP -MF $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Tpo -c -o EspNetTester-RunLengthDecoderTest.obj `if test -f 'RunLengthDecoderTest.cpp'; then $(CYGPATH_W) 'RunLengthDecoderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthDecoderTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Tpo $(DEPDIR)/EspNetTester-RunLengthDecoderTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthDecoderTest.cpp' object='EspNetTester-RunLengthDecoderTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-RunLengthDecoderTest.obj `if test -f 'RunLengthDecoderTest.cpp'; then $(CYGPATH_W) 'RunLengthDecoderTest.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthDecoderTest.cpp'; fi` + +EspNetTester-RunLengthDecoder.o: RunLengthDecoder.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-RunLengthDecoder.o -MD -MP -MF $(DEPDIR)/EspNetTester-RunLengthDecoder.Tpo -c -o EspNetTester-RunLengthDecoder.o `test -f 'RunLengthDecoder.cpp' || echo '$(srcdir)/'`RunLengthDecoder.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-RunLengthDecoder.Tpo $(DEPDIR)/EspNetTester-RunLengthDecoder.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthDecoder.cpp' object='EspNetTester-RunLengthDecoder.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-RunLengthDecoder.o `test -f 'RunLengthDecoder.cpp' || echo '$(srcdir)/'`RunLengthDecoder.cpp + +EspNetTester-RunLengthDecoder.obj: RunLengthDecoder.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -MT EspNetTester-RunLengthDecoder.obj -MD -MP -MF $(DEPDIR)/EspNetTester-RunLengthDecoder.Tpo -c -o EspNetTester-RunLengthDecoder.obj `if test -f 'RunLengthDecoder.cpp'; then $(CYGPATH_W) 'RunLengthDecoder.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthDecoder.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/EspNetTester-RunLengthDecoder.Tpo $(DEPDIR)/EspNetTester-RunLengthDecoder.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RunLengthDecoder.cpp' object='EspNetTester-RunLengthDecoder.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(EspNetTester_CXXFLAGS) $(CXXFLAGS) -c -o EspNetTester-RunLengthDecoder.obj `if test -f 'RunLengthDecoder.cpp'; then $(CYGPATH_W) 'RunLengthDecoder.cpp'; else $(CYGPATH_W) '$(srcdir)/RunLengthDecoder.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.cpp new file mode 100644 index 0000000..e3bb6a3 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.cpp @@ -0,0 +1,60 @@ +/* + * 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 Library 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. + * + * RunLengthEncoder.cpp + * The Run Length Encoder + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include "plugins/espnet/RunLengthDecoder.h" + +namespace ola { +namespace plugin { +namespace espnet { + +/* + * Decode the RLE'ed data into a DmxBuffer. + * @param dst the DmxBuffer to store the result + * @param src_data the data to decode + * @param length the length of the data to decode + */ +void RunLengthDecoder::Decode(DmxBuffer *dst, + const uint8_t *src_data, + unsigned int length) { + dst->Reset(); + unsigned int i = 0; + const uint8_t *value = src_data; + uint8_t count; + while (i < DMX_UNIVERSE_SIZE && value < src_data + length) { + switch (*value) { + case REPEAT_VALUE: + value++; + count = *(value++); + dst->SetRangeToValue(i, *value, count); + i+= count; + break; + case ESCAPE_VALUE: + value++; + default: + dst->SetChannel(i, *value); + i++; + } + value++; + } +} +} // espnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.h b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.h new file mode 100644 index 0000000..8a8c795 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoder.h @@ -0,0 +1,45 @@ +/* + * 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 Library 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. + * + * RunLengthDecoder.h + * Header file for the RunLengthDecoder class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_ESPNET_RUNLENGTHDECODER_H_ +#define PLUGINS_ESPNET_RUNLENGTHDECODER_H_ + +#include + +namespace ola { +namespace plugin { +namespace espnet { + +class RunLengthDecoder { + public : + RunLengthDecoder() {} + ~RunLengthDecoder() {} + + void Decode(DmxBuffer *dst, + const uint8_t *data, + unsigned int length); + private: + static const uint8_t ESCAPE_VALUE = 0xFD; + static const uint8_t REPEAT_VALUE = 0xFE; +}; +} // espnet +} // plugin +} // ola +#endif // PLUGINS_ESPNET_RUNLENGTHDECODER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoderTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoderTest.cpp new file mode 100644 index 0000000..b705796 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/espnet/RunLengthDecoderTest.cpp @@ -0,0 +1,56 @@ +/* + * 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 Library 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. + * + * RunLengthDecoderTest.cpp + * Test fixture for the RunLengthDecoder class + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include "plugins/espnet/RunLengthDecoder.h" + +class RunLengthDecoderTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(RunLengthDecoderTest); + CPPUNIT_TEST(testDecode); + CPPUNIT_TEST_SUITE_END(); + + public: + void testDecode(); + private: +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(RunLengthDecoderTest); + + +/* + * Check that we can decode DMX data + */ +void RunLengthDecoderTest::testDecode() { + ola::plugin::espnet::RunLengthDecoder decoder; + uint8_t data[] = {0x78, 0x56, 0x74, 0xFE, 0x5, 0x10, 0x41, 0x78, 0xFD, 0xFE, + 0x36, 0xFD, 0xFD}; + uint8_t expected_data[] = {0x78, 0x56, 0x74, 0x10, 0x10, 0x10, 0x10, 0x10, + 0x41, 0x78, 0xFE, 0x36, 0xFD}; + ola::DmxBuffer buffer; + ola::DmxBuffer expected(expected_data, sizeof(expected_data)); + + buffer.Blackout(); + buffer.Reset(); + CPPUNIT_ASSERT_EQUAL((unsigned int) 0, buffer.Size()); + decoder.Decode(&buffer, data, sizeof(data)); + CPPUNIT_ASSERT(buffer == expected); +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.am new file mode 100644 index 0000000..39fce30 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.am @@ -0,0 +1,10 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) + +EXTRA_DIST = OpenDmxPlugin.h OpenDmxDevice.h OpenDmxPort.h OpenDmxThread.h + +lib_LTLIBRARIES = libolaopendmx.la +libolaopendmx_la_SOURCES = OpenDmxPlugin.cpp OpenDmxDevice.cpp \ + OpenDmxThread.cpp +libolaopendmx_la_LIBADD = @LIBS@ -lpthread diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.in new file mode 100644 index 0000000..933754e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/Makefile.in @@ -0,0 +1,498 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/opendmx +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolaopendmx_la_DEPENDENCIES = +am_libolaopendmx_la_OBJECTS = OpenDmxPlugin.lo OpenDmxDevice.lo \ + OpenDmxThread.lo +libolaopendmx_la_OBJECTS = $(am_libolaopendmx_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaopendmx_la_SOURCES) +DIST_SOURCES = $(libolaopendmx_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = OpenDmxPlugin.h OpenDmxDevice.h OpenDmxPort.h OpenDmxThread.h +lib_LTLIBRARIES = libolaopendmx.la +libolaopendmx_la_SOURCES = OpenDmxPlugin.cpp OpenDmxDevice.cpp \ + OpenDmxThread.cpp + +libolaopendmx_la_LIBADD = @LIBS@ -lpthread +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/opendmx/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/opendmx/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaopendmx.la: $(libolaopendmx_la_OBJECTS) $(libolaopendmx_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolaopendmx_la_OBJECTS) $(libolaopendmx_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenDmxDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenDmxPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OpenDmxThread.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.cpp new file mode 100644 index 0000000..caf1f20 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.cpp @@ -0,0 +1,59 @@ +/* + * 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 Library 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. + * + * OpenDmxDevice.cpp + * The open dmx device + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "plugins/opendmx/OpenDmxDevice.h" +#include "plugins/opendmx/OpenDmxPort.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using ola::Device; + + +/* + * Create a new device + * @param owner + * @param name + * @param path to device + */ +OpenDmxDevice::OpenDmxDevice(AbstractPlugin *owner, + const string &name, + const string &path): + Device(owner, name), + m_path(path) { +} + + +/* + * Start this device + */ +bool OpenDmxDevice::StartHook() { + AddPort(new OpenDmxOutputPort(this, 0, m_path)); + return true; +} +} // opendmx +} // plugins +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.h new file mode 100644 index 0000000..f11e465 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxDevice.h @@ -0,0 +1,52 @@ +/* + * 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 Library 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. + * + * + * opendmxdevice.h + * Interface for the Open DMX device + * Copyright (C) 2005 Simon Newton + */ + +#ifndef PLUGINS_OPENDMX_OPENDMXDEVICE_H_ +#define PLUGINS_OPENDMX_OPENDMXDEVICE_H_ + +#include +#include "olad/Device.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using std::string; + +class OpenDmxDevice: public ola::Device { + public: + OpenDmxDevice(ola::AbstractPlugin *owner, + const string &name, + const string &path); + + // we only support one widget for now + string DeviceId() const { return "1"; } + + protected: + bool StartHook(); + + private: + string m_path; +}; +} // opendmx +} // plugins +} // ola +#endif // PLUGINS_OPENDMX_OPENDMXDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.cpp new file mode 100644 index 0000000..b2d67db --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.cpp @@ -0,0 +1,137 @@ +/* + * 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 Library 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. + * + * OpenDmxPlugin.cpp + * The Open DMX plugin for ola + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/opendmx/OpenDmxDevice.h" +#include "plugins/opendmx/OpenDmxPlugin.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using ola::PluginAdaptor; + +const char OpenDmxPlugin::OPENDMX_DEVICE_PATH[] = "/dev/dmx0"; +const char OpenDmxPlugin::OPENDMX_DEVICE_NAME[] = "OpenDmx USB Device"; +const char OpenDmxPlugin::PLUGIN_NAME[] = "Enttec Open DMX"; +const char OpenDmxPlugin::PLUGIN_PREFIX[] = "opendmx"; +const char OpenDmxPlugin::DEVICE_KEY[] = "device"; + + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create(const PluginAdaptor *plugin_adaptor) { + return new OpenDmxPlugin(plugin_adaptor); +} + + +/* + * Start the plugin + * For now we just have one device. + * TODO: scan /dev for devices? + * Need to get multi-device support working first :) + * Remember to fix DeviceId() when multiple devices are supported + */ +bool OpenDmxPlugin::StartHook() { + int fd; + + /* create new ola device */ + // first check if it's there + string device_path = m_preferences->GetValue(DEVICE_KEY); + fd = open(device_path.data(), O_WRONLY); + + if (fd >= 0) { + close(fd); + m_device = new OpenDmxDevice(this, OPENDMX_DEVICE_NAME, + device_path); + + m_device->Start(); + m_plugin_adaptor->RegisterDevice(m_device); + } else { + OLA_WARN << "Could not open " << device_path << " " << strerror(errno); + } + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool OpenDmxPlugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin + * + */ +string OpenDmxPlugin::Description() const { + return +"Enttec Open DMX Plugin\n" +"----------------------------\n" +"\n" +"The plugin creates a single device with one output port using the Enttec\n" +"Open DMX USB widget.\n\n" +"--- Config file : ola-opendmx.conf ---\n" +"\n" +"device = /dev/dmx0\n" +"The path to the open dmx usb device.\n"; +} + + +/* + * Set default preferences. + */ +bool OpenDmxPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + if (m_preferences->SetDefaultValue(DEVICE_KEY, StringValidator(), + OPENDMX_DEVICE_PATH)) + m_preferences->Save(); + + // check if this save correctly + // we don't want to use it if null + if (m_preferences->GetValue(DEVICE_KEY).empty()) + return false; + + return true; +} +} // opendmx +} // plugins +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.h new file mode 100644 index 0000000..042395f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPlugin.h @@ -0,0 +1,63 @@ +/* + * 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 Library 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. + * + * OpenDmxPlugin.h + * Interface for the opendmx plugin class + * Copyright (C) 2005-2008 Simon Newton + */ + +#ifndef PLUGINS_OPENDMX_OPENDMXPLUGIN_H_ +#define PLUGINS_OPENDMX_OPENDMXPLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using ola::PluginAdaptor; + +class OpenDmxDevice; + +class OpenDmxPlugin: public Plugin { + public: + explicit OpenDmxPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_device(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_OPENDMX; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + OpenDmxDevice *m_device; // only have one device + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char OPENDMX_DEVICE_PATH[]; + static const char OPENDMX_DEVICE_NAME[]; + static const char DEVICE_KEY[]; +}; +} // opendmx +} // plugins +} // ola + +#endif // PLUGINS_OPENDMX_OPENDMXPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPort.h b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPort.h new file mode 100644 index 0000000..5855a52 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxPort.h @@ -0,0 +1,65 @@ +/* + * 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 Library 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. + * + * OpenDmxPort.h + * The Open DMX plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_OPENDMX_OPENDMXPORT_H_ +#define PLUGINS_OPENDMX_OPENDMXPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "olad/Port.h" +#include "plugins/opendmx/OpenDmxDevice.h" +#include "plugins/opendmx/OpenDmxThread.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using std::string; + +class OpenDmxOutputPort: public BasicOutputPort { + public: + OpenDmxOutputPort(OpenDmxDevice *parent, + unsigned int id, + const string &path) + : BasicOutputPort(parent, id), + m_thread(), + m_path(path) { + m_thread.Start(path); + } + + ~OpenDmxOutputPort() { + m_thread.Stop(); + } + + string Description() const { return "Open Dmx at " + m_path; } + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + return m_thread.WriteDmx(buffer); + (void) priority; + } + + private: + OpenDmxThread m_thread; + string m_path; +}; +} // opendmx +} // plugins +} // ola +#endif // PLUGINS_OPENDMX_OPENDMXPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.cpp b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.cpp new file mode 100644 index 0000000..5a5da3d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.cpp @@ -0,0 +1,198 @@ +/* + * 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 Library 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. + * + * OpenDmxThread.h + * Thread for the open dmx device + * Copyright (C) 2005-2007 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "plugins/opendmx/OpenDmxThread.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +using std::string; + +typedef struct { + OpenDmxThread *th; + string path; +} t_args; + + +void *thread_run(void *d) { + t_args *args = reinterpret_cast(d); + args->th->Run(args->path); + delete args; + return NULL; +} + +/* + * Create a new OpenDmxThread object + * + */ +OpenDmxThread::OpenDmxThread() { + m_fd = -1; + pthread_mutex_init(&m_mutex, NULL); + m_term = false; + pthread_mutex_init(&m_term_mutex, NULL); + pthread_cond_init(&m_term_cond, NULL); + + m_tid = 0; +} + + +/* + * + */ +OpenDmxThread::~OpenDmxThread() { + pthread_cond_destroy(&m_term_cond); + pthread_mutex_destroy(&m_term_mutex); + pthread_mutex_destroy(&m_mutex); +} + + +/* + * Run this thread + */ +void *OpenDmxThread::Run(const string &path) { + uint8_t buffer[DMX_UNIVERSE_SIZE+1]; + unsigned int length = DMX_UNIVERSE_SIZE; + struct timeval tv; + struct timespec ts; + + // should close other fd here + + // start code + buffer[0] = 0x00; + m_fd = open(path.c_str(), O_WRONLY); + + while (1) { + pthread_mutex_lock(&m_term_mutex); + if (m_term) { + pthread_mutex_unlock(&m_term_mutex); + break; + } + pthread_mutex_unlock(&m_term_mutex); + + if (m_fd == -1) { + if (gettimeofday(&tv, NULL) < 0) { + OLA_WARN << "gettimeofday error"; + break; + } + ts.tv_sec = tv.tv_sec + 1; + ts.tv_nsec = tv.tv_usec * 1000; + + pthread_cond_timedwait(&m_term_cond, &m_term_mutex, &ts); + pthread_mutex_unlock(&m_term_mutex); + + m_fd = open(path.c_str(), O_WRONLY); + + if (m_fd == -1) + OLA_WARN << "Open " << m_fd << ": " << strerror(errno); + + } else { + length = DMX_UNIVERSE_SIZE; + pthread_mutex_lock(&m_mutex); + m_buffer.Get(buffer + 1, &length); + pthread_mutex_unlock(&m_mutex); + + DoWrite(buffer, length + 1); + } + } + return NULL; +} + + +/* + * Start this thread + * + */ +int OpenDmxThread::Start(const string &path) { + // this is passed to the thread and free'ed there + t_args *args = new t_args; + + args->th = this; + args->path = path; + + if (pthread_create(&m_tid, NULL, ola::plugin::opendmx::thread_run, + reinterpret_cast(args))) { + OLA_WARN << "pthread create failed"; + return -1; + } + return 0; +} + + +/* + * Stop the thread + */ +int OpenDmxThread::Stop() { + pthread_mutex_lock(&m_term_mutex); + m_term = true; + pthread_mutex_unlock(&m_term_mutex); + + pthread_cond_signal(&m_term_cond); + pthread_join(m_tid, NULL); + return 0; +} + + +/* + * Store the data in the shared buffer + * + */ +bool OpenDmxThread::WriteDmx(const DmxBuffer &buffer) { + pthread_mutex_lock(&m_mutex); + m_buffer = buffer; + pthread_mutex_unlock(&m_mutex); + return true; +} + + +int OpenDmxThread::DoWrite(uint8_t *buf, int length) { + int res = write(m_fd, buf, length); + + if (res < 0) { + // if you unplug devices from the dongle + perror("Error writing to device"); + + res = close(m_fd); + if (res < 0) + perror("close"); + else + m_fd = -1; + + return -1; + } + return 0; +} +} // opendmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.h b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.h new file mode 100644 index 0000000..9b39328 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/opendmx/OpenDmxThread.h @@ -0,0 +1,56 @@ +/* + * 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 Library 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. + * + * OpenDmxThread.h + * Thread for the open dmx device + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_OPENDMX_OPENDMXTHREAD_H_ +#define PLUGINS_OPENDMX_OPENDMXTHREAD_H_ + +#include +#include +#include "ola/DmxBuffer.h" + +namespace ola { +namespace plugin { +namespace opendmx { + +class OpenDmxThread { + public: + OpenDmxThread(); + ~OpenDmxThread(); + + int Start(const std::string &path); + int Stop(); + bool WriteDmx(const DmxBuffer &buffer); + void *Run(const std::string &path); + + private: + int DoWrite(uint8_t *buf, int length); + + int m_fd; + DmxBuffer m_buffer; + pthread_mutex_t m_mutex; + bool m_term; + pthread_mutex_t m_term_mutex; + pthread_cond_t m_term_cond; + pthread_t m_tid; +}; +} // opendmx +} // plugin +} // ola +#endif // PLUGINS_OPENDMX_OPENDMXTHREAD_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.am new file mode 100644 index 0000000..46d86a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) + +EXTRA_DIST = PathportPlugin.h PathportDevice.h PathportPort.h \ + PathportNode.h PathportPackets.h + +lib_LTLIBRARIES = libolapathport.la +libolapathport_la_SOURCES = PathportPlugin.cpp PathportDevice.cpp \ + PathportPort.cpp PathportNode.cpp +libolapathport_la_LIBADD = @LIBS@ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.in new file mode 100644 index 0000000..d986c38 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/Makefile.in @@ -0,0 +1,501 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/pathport +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolapathport_la_DEPENDENCIES = +am_libolapathport_la_OBJECTS = PathportPlugin.lo PathportDevice.lo \ + PathportPort.lo PathportNode.lo +libolapathport_la_OBJECTS = $(am_libolapathport_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolapathport_la_SOURCES) +DIST_SOURCES = $(libolapathport_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = PathportPlugin.h PathportDevice.h PathportPort.h \ + PathportNode.h PathportPackets.h + +lib_LTLIBRARIES = libolapathport.la +libolapathport_la_SOURCES = PathportPlugin.cpp PathportDevice.cpp \ + PathportPort.cpp PathportNode.cpp + +libolapathport_la_LIBADD = @LIBS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/pathport/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/pathport/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolapathport.la: $(libolapathport_la_OBJECTS) $(libolapathport_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolapathport_la_OBJECTS) $(libolapathport_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PathportDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PathportNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PathportPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PathportPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.cpp new file mode 100644 index 0000000..cd73119 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.cpp @@ -0,0 +1,151 @@ +/* + * 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 Library 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. + * + * PathportDevice.cpp + * Pathport device + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "ola/network/NetworkUtils.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "olad/Universe.h" +#include "plugins/pathport/PathportDevice.h" +#include "plugins/pathport/PathportPort.h" +#include "plugins/pathport/PathportPlugin.h" + +namespace ola { +namespace plugin { +namespace pathport { + + +const char PathportDevice::K_DEFAULT_NODE_NAME[] = "ola-Pathport"; +const char PathportDevice::K_DSCP_KEY[] = "dscp"; +const char PathportDevice::K_NODE_ID_KEY[] = "node-id"; +const char PathportDevice::K_NODE_IP_KEY[] = "ip"; +const char PathportDevice::K_NODE_NAME_KEY[] = "name"; +const char PathportDevice::PATHPORT_DEVICE_NAME[] = "Pathport"; + +/* + * Create a new device + */ +PathportDevice::PathportDevice(PathportPlugin *owner, + Preferences *prefs, + const PluginAdaptor *plugin_adaptor) + : Device(owner, PATHPORT_DEVICE_NAME), + m_preferences(prefs), + m_plugin_adaptor(plugin_adaptor), + m_node(NULL), + m_timeout_id(ola::network::INVALID_TIMEOUT) { +} + + +/* + * Start this device + */ +bool PathportDevice::StartHook() { + vector sockets; + vector::iterator iter; + + uint32_t product_id; + if (!StringToUInt(m_preferences->GetValue(K_NODE_ID_KEY), &product_id)) { + OLA_WARN << "Invalid node Id " << m_preferences->GetValue(K_NODE_ID_KEY); + } + + unsigned int dscp; + if (!StringToUInt(m_preferences->GetValue(K_DSCP_KEY), &dscp)) { + OLA_WARN << "Can't convert dscp value " << + m_preferences->GetValue(K_DSCP_KEY) << " to int"; + dscp = 0; + } else { + // shift 2 bits left + dscp = dscp << 2; + } + + m_node = new PathportNode(m_preferences->GetValue(K_NODE_ID_KEY), + product_id, dscp); + + if (!m_node->Start()) { + delete m_node; + m_node = NULL; + return false; + } + + stringstream str; + str << PATHPORT_DEVICE_NAME << " [" << + ola::network::AddressToString(m_node->GetInterface().ip_address) << "]"; + SetName(str.str()); + + for (unsigned int i = 0; i < PORTS_PER_DEVICE; i++) { + PathportInputPort *port = new PathportInputPort( + this, + i, + m_plugin_adaptor->WakeUpTime(), + m_node); + AddPort(port); + } + + for (unsigned int i = 0; i < PORTS_PER_DEVICE; i++) { + PathportOutputPort *port = new PathportOutputPort(this, i, m_node); + AddPort(port); + } + + m_plugin_adaptor->AddSocket(m_node->GetSocket()); + m_timeout_id = m_plugin_adaptor->RegisterRepeatingTimeout( + ADVERTISTMENT_PERIOD_MS, + NewClosure(this, &PathportDevice::SendArpReply)); + + return true; +} + + +/* + * Stop this device + */ +void PathportDevice::PrePortStop() { + m_plugin_adaptor->RemoveSocket(m_node->GetSocket()); + + if (m_timeout_id != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_timeout_id); + m_timeout_id = ola::network::INVALID_TIMEOUT; + } +} + + +/* + * Stop this device + */ +void PathportDevice::PostPortStop() { + m_node->Stop(); + delete m_node; +} + + +bool PathportDevice::SendArpReply() { + OLA_DEBUG << "Sending pathport arp reply"; + if (m_node) + m_node->SendArpReply(); + return true; +} +} // pathport +} // plugin +} // ola + diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.h new file mode 100644 index 0000000..d9e84c4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportDevice.h @@ -0,0 +1,67 @@ +/* + * 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 Library 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. + * + * PathportDevice.h + * Interface for the pathport device + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_PATHPORT_PATHPORTDEVICE_H_ +#define PLUGINS_PATHPORT_PATHPORTDEVICE_H_ + +#include +#include "olad/Device.h" +#include "ola/network/SelectServer.h" +#include "plugins/pathport/PathportNode.h" + +namespace ola { +namespace plugin { +namespace pathport { + +class PathportDevice: public ola::Device { + public: + PathportDevice(class PathportPlugin *owner, + class Preferences *preferences, + const class PluginAdaptor *plugin_adaptor); + + string DeviceId() const { return "1"; } + PathportNode *GetNode() const { return m_node; } + bool SendArpReply(); + + static const char K_DEFAULT_NODE_NAME[]; + static const char K_DSCP_KEY[]; + static const char K_NODE_ID_KEY[]; + static const char K_NODE_IP_KEY[]; + static const char K_NODE_NAME_KEY[]; + + protected: + bool StartHook(); + void PrePortStop(); + void PostPortStop(); + + private: + class Preferences *m_preferences; + const class PluginAdaptor *m_plugin_adaptor; + PathportNode *m_node; + ola::network::timeout_id m_timeout_id; + + static const char PATHPORT_DEVICE_NAME[]; + static const uint32_t PORTS_PER_DEVICE = 8; + static const int ADVERTISTMENT_PERIOD_MS = 6000; +}; +} // pathport +} // plugin +} // ola +#endif // PLUGINS_PATHPORT_PATHPORTDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.cpp b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.cpp new file mode 100644 index 0000000..bac0ce7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.cpp @@ -0,0 +1,457 @@ +/* + * 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 Library 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. + * + * PathportNode.cpp + * A SandNet node + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include "ola/Logging.h" +#include "ola/BaseTypes.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/pathport/PathportNode.h" + + +namespace ola { +namespace plugin { +namespace pathport { + +using std::string; +using std::map; +using std::vector; +using ola::network::HostToNetwork; +using ola::network::NetworkToHost; +using ola::network::StringToAddress; +using ola::network::UdpSocket; +using ola::Closure; + +/* + * Create a new node + * @param ip_address the IP address to prefer to listen on, if NULL we choose + * one. + */ +PathportNode::PathportNode(const string &ip_address, + uint32_t device_id, + uint8_t dscp) + : m_running(false), + m_dscp(dscp), + m_preferred_ip(ip_address), + m_device_id(device_id), + m_sequence_number(1) { +} + + +/* + * Cleanup + */ +PathportNode::~PathportNode() { + Stop(); + + universe_handlers::iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) { + delete iter->second.closure; + } + m_handlers.clear(); +} + + +/* + * Start this node + */ +bool PathportNode::Start() { + if (m_running) + return false; + + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&m_interface, m_preferred_ip)) { + delete picker; + OLA_INFO << "Failed to find an interface"; + return false; + } + delete picker; + + m_config_addr.s_addr = HostToNetwork(PATHPORT_CONFIG_GROUP); + m_status_addr.s_addr = HostToNetwork(PATHPORT_STATUS_GROUP); + m_data_addr.s_addr = HostToNetwork(PATHPORT_DATA_GROUP); + + if (!InitNetwork()) + return false; + + m_socket.SetTos(m_dscp); + m_running = true; + SendArpReply(); + + return true; +} + + +/* + * Stop this node + */ +bool PathportNode::Stop() { + if (!m_running) + return false; + + m_socket.Close(); + m_running = false; + return true; +} + + +/* + * Called when there is data on this socket + */ +void PathportNode::SocketReady(UdpSocket *socket) { + pathport_packet_s packet; + ssize_t packet_size = sizeof(packet); + struct sockaddr_in source; + socklen_t source_length = sizeof(source); + + if (!socket->RecvFrom(reinterpret_cast(&packet), + &packet_size, + source, + source_length)) + return; + + // skip packets sent by us + if (source.sin_addr.s_addr == m_interface.ip_address.s_addr) + return; + + if (packet_size < static_cast(sizeof(packet.header))) { + OLA_WARN << "Small pathport packet received, discarding"; + return; + } + packet_size -= static_cast(sizeof(packet.header)); + + // Validate header + if (!ValidateHeader(packet.header)) { + OLA_WARN << "Invalid pathport packet"; + return; + } + + uint32_t destination = NetworkToHost(packet.header.destination); + if (destination != m_device_id && + destination != PATHPORT_ID_BROADCAST && + destination != PATHPORT_STATUS_GROUP && + destination != PATHPORT_CONFIG_GROUP && + destination != PATHPORT_DATA_GROUP) { + OLA_WARN << "pathport destination not set to us: " << destination; + return; + } + + // TODO(simon): Handle multiple pdus here + pathport_packet_pdu *pdu = &packet.d.pdu; + + if (packet_size < static_cast(sizeof(pathport_pdu_header))) { + OLA_WARN << "Pathport packet too small to fit a pdu header"; + return; + } + packet_size -= sizeof(pathport_pdu_header); + + switch (NetworkToHost(pdu->head.type)) { + case PATHPORT_DATA: + HandleDmxData(pdu->d.data, packet_size); + break; + case PATHPORT_ARP_REQUEST: + SendArpReply(); + break; + case PATHPORT_ARP_REPLY: + OLA_DEBUG << "Got pathport arp reply"; + break; + default: + OLA_INFO << "Unhandled pathport packet with id: " << + NetworkToHost(pdu->head.type); + } +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool PathportNode::SetHandler(uint8_t universe, + DmxBuffer *buffer, + Closure *closure) { + if (!closure) + return false; + + universe_handlers::iterator iter = m_handlers.find(universe); + + if (iter == m_handlers.end()) { + universe_handler handler; + handler.buffer = buffer; + handler.closure = closure; + m_handlers[universe] = handler; + } else { + Closure *old_closure = iter->second.closure; + iter->second.closure = closure; + delete old_closure; + } + return true; +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool PathportNode::RemoveHandler(uint8_t universe) { + universe_handlers::iterator iter = m_handlers.find(universe); + + if (iter != m_handlers.end()) { + Closure *old_closure = iter->second.closure; + m_handlers.erase(iter); + delete old_closure; + return true; + } + return false; +} + + +/* + * Send an arp reply + */ +bool PathportNode::SendArpReply() { + if (!m_running) + return false; + + pathport_packet_s packet; + + // Should this go to status or config? + PopulateHeader(&packet.header, PATHPORT_STATUS_GROUP); + + pathport_packet_pdu *pdu = &packet.d.pdu; + pdu->head.type = HostToNetwork((uint16_t) PATHPORT_ARP_REPLY); + pdu->head.len = HostToNetwork((uint16_t) sizeof(pathport_pdu_arp_reply)); + pdu->d.arp_reply.id = HostToNetwork(m_device_id); + pdu->d.arp_reply.ip = m_interface.ip_address.s_addr; + pdu->d.arp_reply.manufacturer_code = NODE_MANUF_ZP_TECH; + pdu->d.arp_reply.device_class = NODE_CLASS_DMX_NODE; + pdu->d.arp_reply.device_type = NODE_DEVICE_PATHPORT; + pdu->d.arp_reply.component_count = 1; + + unsigned int length = sizeof(pathport_packet_header) + + sizeof(pathport_pdu_header) + + sizeof(pathport_pdu_arp_reply); + return SendPacket(packet, length, m_config_addr); +} + + +/* + * Send some DMX data + * @param buffer the DMX data + * @return true if it was send successfully, false otherwise + */ +bool PathportNode::SendDMX(unsigned int universe, const DmxBuffer &buffer) { + if (!m_running) + return false; + + if (universe > MAX_UNIVERSES) { + OLA_WARN << "attempt to send to universe " << universe; + return false; + } + + pathport_packet_s packet; + + // pad to a multiple of 4 bytes + unsigned int padded_size = (buffer.Size() + 3) & ~3; + PopulateHeader(&packet.header, PATHPORT_DATA_GROUP); + + pathport_packet_pdu *pdu = &packet.d.pdu; + pdu->head.type = HostToNetwork((uint16_t) PATHPORT_DATA); + pdu->head.len = HostToNetwork( + (uint16_t) (padded_size + sizeof(pathport_pdu_data))); + + pdu->d.data.type = HostToNetwork((uint16_t) XDMX_DATA_FLAT); + pdu->d.data.channel_count = HostToNetwork((uint16_t) buffer.Size()); + pdu->d.data.universe = 0; + pdu->d.data.start_code = 0; + pdu->d.data.offset = HostToNetwork( + (uint16_t) (DMX_UNIVERSE_SIZE * universe)); + + unsigned int length = padded_size; + buffer.Get(pdu->d.data.data, &length); + + // pad data to multiple of 4 bytes + length = sizeof(pathport_packet_header) + + sizeof(pathport_pdu_header) + + sizeof(pathport_pdu_data) + padded_size; + + return SendPacket(packet, length, m_data_addr); +} + + +/* + * Setup the networking compoents. + */ +bool PathportNode::InitNetwork() { + if (!m_socket.Init()) { + OLA_WARN << "Socket init failed"; + return false; + } + + if (!m_socket.Bind(PATHPORT_PORT)) { + OLA_WARN << "Failed to bind to:" << PATHPORT_PORT; + m_socket.Close(); + return false; + } + + if (!m_socket.JoinMulticast(m_interface.ip_address, m_config_addr)) { + OLA_WARN << "Failed to join multicast to: " << inet_ntoa(m_config_addr); + m_socket.Close(); + return false; + } + + if (!m_socket.JoinMulticast(m_interface.ip_address, m_data_addr)) { + OLA_WARN << "Failed to join multicast to: " << inet_ntoa(m_data_addr); + m_socket.Close(); + return false; + } + + if (!m_socket.JoinMulticast(m_interface.ip_address, m_status_addr)) { + OLA_WARN << "Failed to join multicast to: " << inet_ntoa(m_status_addr); + m_socket.Close(); + return false; + } + + m_socket.SetOnData( + NewClosure(this, &PathportNode::SocketReady, &m_socket)); + return true; +} + + +/* + * Fill in a pathport header structure + */ +void PathportNode::PopulateHeader(pathport_packet_header *header, + uint32_t destination) { + header->protocol = HostToNetwork(PATHPORT_PROTOCOL); + header->version_major = MAJOR_VERSION; + header->version_minor = MINOR_VERSION; + header->sequence = HostToNetwork(m_sequence_number); + memset(header->reserved, 0, sizeof(header->reserved)); + header->source = HostToNetwork(m_device_id); + header->destination = HostToNetwork(destination); +} + + +/* + * Check a pathport header structure is valid. + */ +bool PathportNode::ValidateHeader(const pathport_packet_header &header) { + return ( + header.protocol == HostToNetwork(PATHPORT_PROTOCOL) && + header.version_major == MAJOR_VERSION && + header.version_minor == MINOR_VERSION); +} + + +/* + * Handle new DMX data + */ +void PathportNode::HandleDmxData(const pathport_pdu_data &packet, + unsigned int size) { + if (size < sizeof(pathport_pdu_data)) { + OLA_WARN << "Small pathport data packet received, ignoring"; + return; + } + + // Don't handle release messages yet + if (NetworkToHost(packet.type) != XDMX_DATA_FLAT) + return; + + if (packet.start_code) { + OLA_INFO << "Non-0 start code packet received, ignoring"; + return; + } + + unsigned int offset = NetworkToHost(packet.offset) % DMX_UNIVERSE_SIZE; + unsigned int universe = NetworkToHost(packet.offset) / DMX_UNIVERSE_SIZE; + const uint8_t *dmx_data = packet.data; + unsigned int data_size = std::min( + NetworkToHost(packet.channel_count), + (uint16_t) (size - sizeof(pathport_pdu_data))); + + while (data_size > 0 && universe <= MAX_UNIVERSES) { + unsigned int channels_for_this_universe = + std::min(data_size, DMX_UNIVERSE_SIZE - offset); + + universe_handlers::iterator iter = m_handlers.find(universe); + if (iter != m_handlers.end()) { + iter->second.buffer->SetRange(offset, + dmx_data, + channels_for_this_universe); + iter->second.closure->Run(); + } + data_size -= channels_for_this_universe; + dmx_data += channels_for_this_universe; + offset = 0; + universe++; + } +} + + +/* + * @param destination the destination to target + */ +bool PathportNode::SendArpRequest(uint32_t destination) { + if (!m_running) + return false; + + pathport_packet_s packet; + PopulateHeader(&packet.header, destination); + packet.d.pdu.head.type = HostToNetwork((uint16_t) PATHPORT_ARP_REQUEST); + packet.d.pdu.head.len = 0; + + unsigned int length = sizeof(pathport_packet_header) + + sizeof(pathport_pdu_header); + return SendPacket(packet, length, m_status_addr); +} + + +/* + * Send a packet + */ +bool PathportNode::SendPacket(const pathport_packet_s &packet, + unsigned int size, + struct in_addr dest) { + struct sockaddr_in destination; + destination.sin_family = AF_INET; + destination.sin_port = HostToNetwork(PATHPORT_PORT); + destination.sin_addr = dest; + + ssize_t bytes_sent = m_socket.SendTo( + reinterpret_cast(&packet), + size, + destination); + + if (bytes_sent != static_cast(size)) { + OLA_WARN << "Only sent " << bytes_sent << " of " << size; + return false; + } + return true; +} +} // pothport +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.h b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.h new file mode 100644 index 0000000..601c51d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportNode.h @@ -0,0 +1,140 @@ +/* + * 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 Library 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. + * + * PathportNode.h + * Header file for the PathportNode class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_PATHPORT_PATHPORTNODE_H_ +#define PLUGINS_PATHPORT_PATHPORTNODE_H_ + +#include +#include +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/Socket.h" +#include "plugins/pathport/PathportPackets.h" + +namespace ola { +namespace plugin { +namespace pathport { + +using ola::network::UdpSocket; + +class PathportNode { + public: + explicit PathportNode(const string &preferred_ip, uint32_t device_id, + uint8_t dscp); + ~PathportNode(); + + bool Start(); + bool Stop(); + const ola::network::Interface &GetInterface() const { + return m_interface; + } + UdpSocket *GetSocket() { return &m_socket; } + void SocketReady(UdpSocket *socket); + + bool SetHandler(uint8_t universe, + DmxBuffer *buffer, + Closure *closure); + bool RemoveHandler(uint8_t universe); + + bool SendArpReply(); + bool SendDMX(unsigned int universe, const DmxBuffer &buffer); + + // apparently pathport supports up to 128 universes, the spec only says 64 + static const uint8_t MAX_UNIVERSES = 127; + + private: + + typedef struct { + DmxBuffer *buffer; + Closure *closure; + } universe_handler; + + enum { + XDMX_DATA_FLAT = 0x0101, + XDMX_DATA_RELEASE = 0x0103 + }; + + enum { + NODE_MANUF_PATHWAY_CONNECTIVITY = 0, + NODE_MANUF_INTERACTIVE_TECH = 0x10, + NODE_MANUF_ENTERTAINMENT_TECH = 0x11, + NODE_MANUF_MA_LIGHTING = 0x12, + NODE_MANUF_HIGH_END_SYSTEMS = 0x13, + NODE_MANUF_CRESTRON_ELECTRONICS = 0x14, + NODE_MANUF_LEVITON = 0x15, + NODE_MANUF_FLYING_PIG = 0x16, + NODE_MANUF_HORIZON = 0x17, + NODE_MANUF_ZP_TECH = 0x28, // ola + }; + + enum { + NODE_CLASS_DMX_NODE = 0, + NODE_CLASS_MANAGER = 1, + NODE_CLASS_DIMMER = 2, + NODE_CLASS_CONTROLLER = 3, + NODE_CLASS_FIXTURE = 4, + NODE_CLASS_EFFECTS_UNIT = 5, + }; + + enum { + NODE_DEVICE_PATHPORT = 0, + NODE_DEVICE_DMX_MANAGER_PLUS = 1, + NODE_DEVICE_ONEPORT = 2, + }; + + typedef std::map universe_handlers; + + bool InitNetwork(); + void PopulateHeader(pathport_packet_header *header, uint32_t destination); + bool ValidateHeader(const pathport_packet_header &header); + void HandleDmxData(const pathport_pdu_data &packet, + unsigned int size); + bool SendArpRequest(uint32_t destination = PATHPORT_ID_BROADCAST); + bool SendPacket(const pathport_packet_s &packet, + unsigned int size, + struct in_addr dest); + + bool m_running; + uint8_t m_dscp; + string m_preferred_ip; + uint32_t m_device_id; // the pathport device id + uint16_t m_sequence_number; + + universe_handlers m_handlers; + ola::network::Interface m_interface; + UdpSocket m_socket; + struct in_addr m_config_addr; + struct in_addr m_status_addr; + struct in_addr m_data_addr; + + static const uint16_t PATHPORT_PORT = 0xed0; + static const uint16_t PATHPORT_PROTOCOL = 0xed01; + static const uint32_t PATHPORT_CONFIG_GROUP = 0xefffed02; + static const uint32_t PATHPORT_DATA_GROUP = 0xefffed01; + static const uint32_t PATHPORT_ID_BROADCAST = 0xffffffff; + static const uint32_t PATHPORT_STATUS_GROUP = 0xefffedff; + static const uint8_t MAJOR_VERSION = 2; + static const uint8_t MINOR_VERSION = 0; +}; +} // pathport +} // plugin +} // ola +#endif // PLUGINS_PATHPORT_PATHPORTNODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPackets.h b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPackets.h new file mode 100644 index 0000000..1e25391 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPackets.h @@ -0,0 +1,160 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * PathportPackets.h + * Datagram definitions for libpathport + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_PATHPORT_PATHPORTPACKETS_H_ +#define PLUGINS_PATHPORT_PATHPORTPACKETS_H_ + +#include +#include +#include + +namespace ola { +namespace plugin { +namespace pathport { + + +/* + * Pathport opcodes + */ +enum pathport_packet_type_e { + PATHPORT_DATA = 0x0100, + PATHPORT_PATCH = 0x0200, + PATHPORT_PATCHREP = 0x0210, + PATHPORT_GET = 0x0222, + PATHPORT_GET_REPLY = 0x0223, + PATHPORT_ARP_REQUEST = 0x0301, + PATHPORT_ARP_REPLY = 0x0302, + PATHPORT_SET = 0x0400, +}__attribute__((packed)); + +typedef enum pathport_packet_type_e pathport_packet_type_t; + + +/* + * Pathport xDmx + */ +struct pathport_pdu_data_s { + uint16_t type; + uint16_t channel_count; + uint8_t universe; // not used, set to 0 + uint8_t start_code; + uint16_t offset; + uint8_t data[0]; +}__attribute__((packed)); + +typedef struct pathport_pdu_data_s pathport_pdu_data; + + +/* + * Pathport get request + */ +struct pathport_pdu_get_s { + uint16_t params[0]; +} __attribute__((packed)); + +typedef struct pathport_pdu_get_s pathport_pdu_get; + + +/* + * Pathport get reply + */ +struct pathport_pdu_getrep_s { + uint8_t params[0]; +} __attribute__((packed)); + +typedef struct pathport_pdu_getrep_s pathport_pdu_getrep; + + +struct pathport_pdu_getrep_alv_s { + uint16_t type; + uint16_t len; + uint8_t val[0]; +}; +typedef struct pathport_pdu_getrep_alv_s pathport_pdu_getrep_alv; + + +/* + * Pathport arp reply + */ +struct pathport_pdu_arp_reply_s { + uint32_t id; + uint32_t ip; + uint8_t manufacturer_code; // manufacturer code + uint8_t device_class; // device class + uint8_t device_type; // device type + uint8_t component_count; // number of dmx components +}__attribute__((packed)); + +typedef struct pathport_pdu_arp_reply_s pathport_pdu_arp_reply; + + +struct pathport_pdu_header_s { + uint16_t type; // pdu type + uint16_t len; // length +}__attribute__((packed)); + +typedef struct pathport_pdu_header_s pathport_pdu_header; + +/* + * PDU Header + */ +struct pathport_packet_pdu_s { + pathport_pdu_header head; + union { + pathport_pdu_data data; + pathport_pdu_get get; + pathport_pdu_getrep getrep; + pathport_pdu_arp_reply arp_reply; + } d; // pdu data +}__attribute__((packed)); + +typedef struct pathport_packet_pdu_s pathport_packet_pdu; + + +/* + * A complete Pathport packet + */ +struct pathport_packet_header_s { + uint16_t protocol; + uint8_t version_major; + uint8_t version_minor; + uint16_t sequence; + uint8_t reserved[6]; // set to 0 + uint32_t source; // src id + uint32_t destination; // dst id +}__attribute__((packed)); + +typedef struct pathport_packet_header_s pathport_packet_header; + + +/* + * The complete pathport packet + */ +struct pathport_packet_s { + pathport_packet_header header; + union { + uint8_t data[1480]; // 1500 - header size + pathport_packet_pdu pdu; + } d; +}__attribute__((packed)); +} // pathport +} // plugin +} // ola +#endif // PLUGINS_PATHPORT_PATHPORTPACKETS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.cpp new file mode 100644 index 0000000..7e0d934 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.cpp @@ -0,0 +1,148 @@ +/* + * 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 Library 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. + * + * PathportPlugin.cpp + * The Pathport plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include "ola/StringUtils.h" +#include "ola/Logging.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/pathport/PathportDevice.h" +#include "plugins/pathport/PathportPlugin.h" + + +namespace ola { +namespace plugin { +namespace pathport { + +const char PathportPlugin::PLUGIN_NAME[] = "Pathport"; +const char PathportPlugin::PLUGIN_PREFIX[] = "pathport"; +const char PathportPlugin::DEFAULT_DSCP_VALUE[] = "0"; + + +/* + * Start the plugin + * For now we just have one device. + */ +bool PathportPlugin::StartHook() { + m_device = new PathportDevice(this, + m_preferences, + m_plugin_adaptor); + + if (!m_device) + return false; + + if (!m_device->Start()) { + delete m_device; + return false; + } + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool PathportPlugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin + */ +string PathportPlugin::Description() const { + return +"Pathway Pathport Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with 5 input and 5 output ports.\n" +"\n" +"The universe the port is patched to corresponds with the DMX channels used \n" +"in the PathPort protocol. For example universe 0 is xDMX channels 0 - 511, \n" +"universe 1 is xDMX channels 512 - 1023.\n" +"\n" +"--- Config file : ola-pathport.conf ---\n" +"\n" +"dscp = \n" +"Set the DSCP value for the packets. Range is 0-63\n" +"\n" +"ip = a.b.c.d\n" +"The ip address to bind to. If not specified it will use the first \n" +"non-loopback ip.\n" +"\n" +"name = ola-Pathport\n" +"The name of the node.\n" +"\n" +"node-id = \n" +"The pathport id of the node\n" +"\n"; +} + + +/* + * Load the plugin prefs and default to sensible values + */ +bool PathportPlugin::SetDefaultPreferences() { + bool save = false; + + if (!m_preferences) + return false; + + save |= m_preferences->SetDefaultValue(PathportDevice::K_DSCP_KEY, + IntValidator(0, 63), + DEFAULT_DSCP_VALUE); + save |= m_preferences->SetDefaultValue(PathportDevice::K_NODE_IP_KEY, + IPv4Validator(), ""); + save |= m_preferences->SetDefaultValue(PathportDevice::K_NODE_NAME_KEY, + StringValidator(), + PathportDevice::K_DEFAULT_NODE_NAME); + + // generate a new node id in case we need it + srand((unsigned)time(0) * getpid()); + uint32_t product_id = OLA_MANUFACTURER_CODE << 24; + product_id |= (rand() / (RAND_MAX / 0x100) << 16); + product_id |= (rand() / (RAND_MAX / 0x100) << 8); + product_id |= rand() / (RAND_MAX / 0x100); + + save |= m_preferences->SetDefaultValue(PathportDevice::K_NODE_ID_KEY, + IntValidator(0, UINT_MAX), + IntToString(product_id)); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue(PathportDevice::K_NODE_NAME_KEY).empty() || + m_preferences->GetValue(PathportDevice::K_NODE_ID_KEY).empty()) + return false; + + return true; +} +} // pathport +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.h new file mode 100644 index 0000000..e663425 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPlugin.h @@ -0,0 +1,60 @@ +/* + * 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 Library 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. + * + * PathportPlugin.h + * Interface for the pathport plugin class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_PATHPORT_PATHPORTPLUGIN_H_ +#define PLUGINS_PATHPORT_PATHPORTPLUGIN_H_ + +#include +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace pathport { + +class PathportPlugin: public ola::Plugin { + public: + explicit PathportPlugin(const class ola::PluginAdaptor *plugin_adaptor) + : Plugin(plugin_adaptor), + m_device(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_PATHPORT; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + class PathportDevice *m_device; + + static const char DEFAULT_DSCP_VALUE[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + // 0x28 is assigned to the OLA project + static const uint8_t OLA_MANUFACTURER_CODE = 0x28; +}; +} // pathport +} // plugin +} // ola +#endif // PLUGINS_PATHPORT_PATHPORTPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.cpp new file mode 100644 index 0000000..d91fed2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.cpp @@ -0,0 +1,87 @@ +/* + * 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 Library 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. + * + * + * SandNetPort.cpp + * The SandNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include "ola/Logging.h" +#include "ola/BaseTypes.h" + +#include "plugins/pathport/PathportPort.h" + +namespace ola { +namespace plugin { +namespace pathport { + + +string PathportPortHelper::Description(const Universe *universe) const { + if (!universe) + return ""; + + std::stringstream str; + str << "Pathport xDMX " << DMX_UNIVERSE_SIZE * universe->UniverseId() << + " - " << DMX_UNIVERSE_SIZE * (1 + universe->UniverseId()) - 1; + return str.str(); +} + + +/* + * Don't allow us to patch ports out of range + */ +bool PathportPortHelper::PreSetUniverse(Universe *new_universe) { + if (new_universe && + new_universe->UniverseId() > PathportNode::MAX_UNIVERSES) { + OLA_WARN << "Pathport universes need to be between 0 and " << + PathportNode::MAX_UNIVERSES; + return false; + } + return true; +} + + +void PathportInputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (old_universe) { + m_node->RemoveHandler(old_universe->UniverseId()); + } + + if (new_universe) { + m_node->SetHandler( + new_universe->UniverseId(), + &m_buffer, + NewClosure(this, + &PathportInputPort::DmxChanged)); + } +} + + +/* + * Write operation + */ +bool PathportOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + if (GetUniverse()) + return m_node->SendDMX(GetUniverse()->UniverseId(), buffer); + return true; + (void) priority; +} +} // pathport +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.h b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.h new file mode 100644 index 0000000..dda5545 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/pathport/PathportPort.h @@ -0,0 +1,90 @@ +/* + * 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 Library 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. + * + * PathportPort.h + * The Pathport plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_PATHPORT_PATHPORTPORT_H_ +#define PLUGINS_PATHPORT_PATHPORTPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "olad/Port.h" +#include "plugins/pathport/PathportDevice.h" + +namespace ola { +namespace plugin { +namespace pathport { + +class PathportPortHelper { + public: + PathportPortHelper() {} + string Description(const Universe *universe) const; + bool PreSetUniverse(Universe *new_universe); +}; + + +class PathportInputPort: public BasicInputPort { + public: + PathportInputPort(PathportDevice *parent, + unsigned int id, + const TimeStamp *wake_time, + PathportNode *node): + BasicInputPort(parent, id, wake_time), + m_node(node) {} + ~PathportInputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + const DmxBuffer &ReadDMX() const { return m_buffer; } + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(new_universe); + (void) old_universe; + } + + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + + private: + PathportPortHelper m_helper; + PathportNode *m_node; + DmxBuffer m_buffer; +}; + + +class PathportOutputPort: public BasicOutputPort { + public: + PathportOutputPort(PathportDevice *parent, + unsigned int id, + PathportNode *node): + BasicOutputPort(parent, id), + m_node(node) {} + ~PathportOutputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(new_universe); + (void) old_universe; + } + + private: + PathportPortHelper m_helper; + PathportNode *m_node; +}; +} // pathport +} // plugin +} // ola +#endif // PLUGINS_PATHPORT_PATHPORTPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.am new file mode 100644 index 0000000..d761151 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) + +EXTRA_DIST = SandNetPlugin.h SandNetDevice.h SandNetPort.h SandNetNode.h \ + SandNetCommon.h SandNetPackets.h + +lib_LTLIBRARIES = libolasandnet.la +libolasandnet_la_SOURCES = SandNetPlugin.cpp SandNetDevice.cpp \ + SandNetPort.cpp SandNetNode.cpp +libolasandnet_la_LIBADD = @LIBS@ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.in new file mode 100644 index 0000000..f0087c5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/Makefile.in @@ -0,0 +1,501 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/sandnet +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolasandnet_la_DEPENDENCIES = +am_libolasandnet_la_OBJECTS = SandNetPlugin.lo SandNetDevice.lo \ + SandNetPort.lo SandNetNode.lo +libolasandnet_la_OBJECTS = $(am_libolasandnet_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolasandnet_la_SOURCES) +DIST_SOURCES = $(libolasandnet_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = SandNetPlugin.h SandNetDevice.h SandNetPort.h SandNetNode.h \ + SandNetCommon.h SandNetPackets.h + +lib_LTLIBRARIES = libolasandnet.la +libolasandnet_la_SOURCES = SandNetPlugin.cpp SandNetDevice.cpp \ + SandNetPort.cpp SandNetNode.cpp + +libolasandnet_la_LIBADD = @LIBS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/sandnet/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/sandnet/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolasandnet.la: $(libolasandnet_la_OBJECTS) $(libolasandnet_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolasandnet_la_OBJECTS) $(libolasandnet_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SandNetDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SandNetNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SandNetPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SandNetPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetCommon.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetCommon.h new file mode 100644 index 0000000..fc28bbf --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetCommon.h @@ -0,0 +1,27 @@ +/* + * 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 Library 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. + * + * + * SandNetCommon.h + * Constants for the sandnet plugin + * Copyright (C) 2005 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETCOMMON_H_ +#define PLUGINS_SANDNET_SANDNETCOMMON_H_ + +enum {SANDNET_MAX_PORTS = 2}; + +#endif // PLUGINS_SANDNET_SANDNETCOMMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.cpp new file mode 100644 index 0000000..0a16068 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.cpp @@ -0,0 +1,153 @@ +/* + * 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 Library 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. + * + * SandNetDevice.cpp + * SandNet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/sandnet/SandNetDevice.h" +#include "plugins/sandnet/SandNetPlugin.h" +#include "plugins/sandnet/SandNetPort.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +const char SandNetDevice::IP_KEY[] = "ip"; +const char SandNetDevice::NAME_KEY[] = "name"; +const char SandNetDevice::SANDNET_DEVICE_NAME[] = "SandNet"; + +/* + * Create a new device + */ +SandNetDevice::SandNetDevice(SandNetPlugin *owner, + Preferences *prefs, + const PluginAdaptor *plugin_adaptor): + Device(owner, SANDNET_DEVICE_NAME), + m_preferences(prefs), + m_plugin_adaptor(plugin_adaptor), + m_node(NULL), + m_timeout_id(ola::network::INVALID_TIMEOUT) { +} + + +/* + * Start this device + */ +bool SandNetDevice::StartHook() { + vector sockets; + vector::iterator iter; + + m_node = new SandNetNode(m_preferences->GetValue(IP_KEY)); + m_node->SetName(m_preferences->GetValue(NAME_KEY)); + + // setup the output ports (ie INTO sandnet) + for (int i = 0; i < SANDNET_MAX_PORTS; i++) { + bool ret = m_node->SetPortParameters(i, + SandNetNode::SANDNET_PORT_MODE_IN, + 0, + i); + if (!ret) { + OLA_WARN << "SetPortParameters failed"; + DeleteAllPorts(); + delete m_node; + return false; + } + } + + if (!m_node->Start()) { + DeleteAllPorts(); + delete m_node; + return false; + } + + stringstream str; + str << SANDNET_DEVICE_NAME << " [" << + ola::network::AddressToString(m_node->GetInterface().ip_address) << "]"; + SetName(str.str()); + + + for (unsigned int i = 0; i < INPUT_PORTS; i++) { + SandNetInputPort *port = new SandNetInputPort( + this, + i, + m_plugin_adaptor->WakeUpTime(), + m_node); + AddPort(port); + } + for (unsigned int i = 0; i < SANDNET_MAX_PORTS ; i++) { + SandNetOutputPort *port = new SandNetOutputPort(this, i, m_node); + AddPort(port); + } + + sockets = m_node->GetSockets(); + for (iter = sockets.begin(); iter != sockets.end(); ++iter) + m_plugin_adaptor->AddSocket(*iter); + + m_timeout_id = m_plugin_adaptor->RegisterRepeatingTimeout( + ADVERTISTMENT_PERIOD_MS, + NewClosure(this, &SandNetDevice::SendAdvertisement)); + + return true; +} + + +/* + * Stop this device + */ +void SandNetDevice::PrePortStop() { + vector sockets = m_node->GetSockets(); + vector::iterator iter; + for (iter = sockets.begin(); iter != sockets.end(); ++iter) + m_plugin_adaptor->RemoveSocket(*iter); + + if (m_timeout_id != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_timeout_id); + m_timeout_id = ola::network::INVALID_TIMEOUT; + } +} + + +/* + * Stop this device + */ +void SandNetDevice::PostPortStop() { + m_node->Stop(); + delete m_node; + m_node = NULL; +} + + +/* + * Called periodically to send advertisements. + */ +bool SandNetDevice::SendAdvertisement() { + OLA_DEBUG << "Sending Sandnet advertisement"; + m_node->SendAdvertisement(); + return true; +} +} // sandnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.h new file mode 100644 index 0000000..233375e --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetDevice.h @@ -0,0 +1,69 @@ +/* + * 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 Library 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. + * + * SandNetDevice.h + * Interface for the sandnet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETDEVICE_H_ +#define PLUGINS_SANDNET_SANDNETDEVICE_H_ + +#include +#include "olad/Device.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "plugins/sandnet/SandNetCommon.h" +#include "plugins/sandnet/SandNetNode.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +class SandNetDevice: public ola::Device { + public: + SandNetDevice(class SandNetPlugin *owner, + class Preferences *prefs, + const class PluginAdaptor *plugin_adaptor); + + string DeviceId() const { return "1"; } + SandNetNode *GetNode() { return m_node; } + + bool SendAdvertisement(); + + static const char IP_KEY[]; + static const char NAME_KEY[]; + + protected: + bool StartHook(); + void PrePortStop(); + void PostPortStop(); + + private: + class Preferences *m_preferences; + const class PluginAdaptor *m_plugin_adaptor; + SandNetNode *m_node; + ola::network::timeout_id m_timeout_id; + + static const char SANDNET_DEVICE_NAME[]; + // the number of input ports to create + static const unsigned int INPUT_PORTS = 8; + // send an advertistment every 2s. + static const int ADVERTISTMENT_PERIOD_MS = 2000; +}; +} // sandnet +} // plugin +} // ola +#endif // PLUGINS_SANDNET_SANDNETDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.cpp b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.cpp new file mode 100644 index 0000000..49e5b81 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.cpp @@ -0,0 +1,462 @@ +/* + * 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 Library 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. + * + * SandNetNode.cpp + * A SandNet node + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/sandnet/SandNetNode.h" + + +namespace ola { +namespace plugin { +namespace sandnet { + +using std::string; +using std::map; +using std::vector; +using ola::network::HostToNetwork; +using ola::network::NetworkToHost; +using ola::network::StringToAddress; +using ola::network::UdpSocket; +using ola::Closure; + +const char SandNetNode::CONTROL_ADDRESS[] = "237.1.1.1"; +const char SandNetNode::DATA_ADDRESS[] = "237.1.2.1"; +const char SandNetNode::DEFAULT_NODE_NAME[] = "ola-SandNet"; + +/* + * Create a new node + * @param ip_address the IP address to prefer to listen on, if NULL we choose + * one. + */ +SandNetNode::SandNetNode(const string &ip_address) + : m_running(false), + m_node_name(DEFAULT_NODE_NAME), + m_preferred_ip(ip_address) { + for (unsigned int i = 0; i < SANDNET_MAX_PORTS; i++) { + m_ports[i].group = 0; + m_ports[i].universe = i; + } +} + + +/* + * Cleanup + */ +SandNetNode::~SandNetNode() { + Stop(); + + universe_handlers::iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) { + delete iter->second.closure; + } + m_handlers.clear(); +} + + +/* + * Start this node + */ +bool SandNetNode::Start() { + if (m_running) + return false; + + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&m_interface, m_preferred_ip)) { + delete picker; + OLA_INFO << "Failed to find an interface"; + return false; + } + delete picker; + + if (!StringToAddress(CONTROL_ADDRESS, m_control_addr) || + !StringToAddress(DATA_ADDRESS, m_data_addr)) { + OLA_WARN << "Could not convert " << CONTROL_ADDRESS << " or " << + DATA_ADDRESS; + return false; + } + + if (!InitNetwork()) + return false; + + m_running = true; + return true; +} + + +/* + * Stop this node + */ +bool SandNetNode::Stop() { + if (!m_running) + return false; + + m_data_socket.Close(); + m_control_socket.Close(); + + m_running = false; + return true; +} + + +/* + * Return a list of sockets in use + */ +vector SandNetNode::GetSockets() { + vector sockets; + sockets.push_back(&m_data_socket); + sockets.push_back(&m_control_socket); + return sockets; +} + + +/* + * Called when there is data on this socket + */ +void SandNetNode::SocketReady(UdpSocket *socket) { + sandnet_packet packet; + ssize_t packet_size = sizeof(packet); + struct sockaddr_in source; + socklen_t source_length = sizeof(source); + + if (!socket->RecvFrom(reinterpret_cast(&packet), + &packet_size, + source, + source_length)) + return; + + // skip packets sent by us + if (source.sin_addr.s_addr == m_interface.ip_address.s_addr) + return; + + if (packet_size < static_cast(sizeof(packet.opcode))) { + OLA_WARN << "Small sandnet packet received, discarding"; + return; + } + + switch (NetworkToHost(packet.opcode)) { + case SANDNET_DMX: + HandleDMX(packet.contents.dmx, packet_size - sizeof(packet.opcode)); + break; + case SANDNET_COMPRESSED_DMX: + HandleCompressedDMX(packet.contents.compressed_dmx, + packet_size - sizeof(packet.opcode)); + break; + case SANDNET_ADVERTISMENT: + break; + default: + OLA_INFO << "Skipping sandnet packet with unknown code: 0x" << + std::hex << NetworkToHost(packet.opcode); + } +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool SandNetNode::SetHandler(uint8_t group, uint8_t universe, + DmxBuffer *buffer, + Closure *closure) { + if (!closure) + return false; + + group_universe_pair key(group, universe); + universe_handlers::iterator iter = m_handlers.find(key); + + if (iter == m_handlers.end()) { + universe_handler handler; + handler.buffer = buffer; + handler.closure = closure; + m_handlers[key] = handler; + } else { + Closure *old_closure = iter->second.closure; + iter->second.closure = closure; + delete old_closure; + } + return true; +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool SandNetNode::RemoveHandler(uint8_t group, uint8_t universe) { + group_universe_pair key(group, universe); + universe_handlers::iterator iter = m_handlers.find(key); + + if (iter != m_handlers.end()) { + Closure *old_closure = iter->second.closure; + m_handlers.erase(iter); + delete old_closure; + return true; + } + return false; +} + + +/* + * Set the parameters for a port + */ +bool SandNetNode::SetPortParameters(uint8_t port_id, sandnet_port_type type, + uint8_t group, uint8_t universe) { + if (port_id >= SANDNET_MAX_PORTS) + return false; + + m_ports[port_id].group = group; + m_ports[port_id].universe = universe; + m_ports[port_id].type = type; + return true; +} + + +/* + * Send a Sandnet Advertisment. + */ +bool SandNetNode::SendAdvertisement() { + if (!m_running) + return false; + + sandnet_packet packet; + sandnet_advertisement *advertisement = &packet.contents.advertisement; + memset(&packet, 0, sizeof(packet)); + packet.opcode = HostToNetwork(static_cast(SANDNET_ADVERTISMENT)); + + memcpy(advertisement->mac, m_interface.hw_address, ola::network::MAC_LENGTH); + advertisement->firmware = HostToNetwork(FIRMWARE_VERSION); + + for (unsigned int i = 0; i < SANDNET_MAX_PORTS; i++) { + advertisement->ports[i].mode = m_ports[i].type; + advertisement->ports[i].protocol = SANDNET_SANDNET; + advertisement->ports[i].group = m_ports[i].group; + advertisement->ports[i].universe = m_ports[i].universe; + } + + advertisement->nlen = std::min(m_node_name.size(), + static_cast(SANDNET_NAME_LENGTH)); + strncpy(advertisement->name, m_node_name.data(), advertisement->nlen); + + advertisement->magic3[0] = 0xc0; + advertisement->magic3[1] = 0xa8; + advertisement->magic3[2] = 0x01; + advertisement->magic3[3] = 0xa0; + advertisement->magic3[4] = 0x00; + advertisement->magic3[5] = 0xff; + advertisement->magic3[6] = 0xff; + advertisement->magic3[7] = 0xff; + advertisement->magic3[8] = 0x00; + advertisement->magic4 = 0x01; + + return SendPacket(packet, + sizeof(packet.opcode) + sizeof(sandnet_advertisement), + true); +} + + +/* + * Send some DMX data + * @param buffer the DMX data + * @return true if it was send successfully, false otherwise + */ +bool SandNetNode::SendDMX(uint8_t port_id, const DmxBuffer &buffer) { + if (!m_running || port_id >= SANDNET_MAX_PORTS) + return false; + + // Sandnet doesn't seem to understand compressed DMX + return SendUncompressedDMX(port_id, buffer); +} + + +/* + * Setup the networking compoents. + */ +bool SandNetNode::InitNetwork() { + if (!m_control_socket.Init()) { + OLA_WARN << "Socket init failed"; + return false; + } + + if (!m_data_socket.Init()) { + OLA_WARN << "Socket init failed"; + m_control_socket.Close(); + return false; + } + + if (!m_control_socket.Bind(CONTROL_PORT)) { + OLA_WARN << "Failed to bind to:" << CONTROL_PORT; + m_data_socket.Close(); + m_control_socket.Close(); + return false; + } + + if (!m_data_socket.Bind(DATA_PORT)) { + OLA_WARN << "Failed to bind to:" << DATA_PORT; + m_data_socket.Close(); + m_control_socket.Close(); + return false; + } + + if (!m_control_socket.JoinMulticast(m_interface.ip_address, + m_control_addr)) { + OLA_WARN << "Failed to join multicast to: " << CONTROL_ADDRESS; + m_data_socket.Close(); + m_control_socket.Close(); + return false; + } + + if (!m_data_socket.JoinMulticast(m_interface.ip_address, + m_data_addr)) { + OLA_WARN << "Failed to join multicast to: " << DATA_ADDRESS; + m_data_socket.Close(); + m_control_socket.Close(); + return false; + } + + m_control_socket.SetOnData( + NewClosure(this, &SandNetNode::SocketReady, &m_control_socket)); + m_data_socket.SetOnData( + NewClosure(this, &SandNetNode::SocketReady, &m_data_socket)); + return true; +} + + +/* + * Handle a compressed DMX packet + */ +bool SandNetNode::HandleCompressedDMX(const sandnet_compressed_dmx &dmx_packet, + unsigned int size) { + unsigned int header_size = sizeof(dmx_packet) - sizeof(dmx_packet.dmx); + + if (size <= header_size) { + OLA_WARN << "Sandnet data size too small, expected at least " << + header_size << ", got " << size; + return false; + } + + group_universe_pair key(dmx_packet.group, dmx_packet.universe); + universe_handlers::iterator iter = m_handlers.find(key); + + if (iter == m_handlers.end()) + return false; + + unsigned int data_size = size - header_size; + bool r = m_encoder.Decode(iter->second.buffer, 0, dmx_packet.dmx, + data_size); + if (!r) { + OLA_WARN << "Failed to decode Sandnet Data"; + return false; + } + + iter->second.closure->Run(); + return true; +} + + +/* + * Handle a uncompressed DMX packet + */ +bool SandNetNode::HandleDMX(const sandnet_dmx &dmx_packet, + unsigned int size) { + unsigned int header_size = sizeof(dmx_packet) - sizeof(dmx_packet.dmx); + if (size <= header_size) { + OLA_WARN << "Sandnet data size too small, expected at least " << + header_size << ", got " << size; + return false; + } + + group_universe_pair key(dmx_packet.group, dmx_packet.universe); + universe_handlers::iterator iter = m_handlers.find(key); + + if (iter == m_handlers.end()) + return false; + + unsigned int data_size = size - header_size; + iter->second.buffer->Set(dmx_packet.dmx, data_size); + iter->second.closure->Run(); + return true; +} + + +/* + * Send an uncompressed DMX packet + */ +bool SandNetNode::SendUncompressedDMX(uint8_t port_id, + const DmxBuffer &buffer) { + sandnet_packet packet; + sandnet_dmx *dmx_packet = &packet.contents.dmx; + + packet.opcode = HostToNetwork(static_cast(SANDNET_DMX)); + dmx_packet->group = m_ports[port_id].group; + dmx_packet->universe = m_ports[port_id].universe; + dmx_packet->port = port_id; + + unsigned int length = DMX_UNIVERSE_SIZE; + buffer.Get(dmx_packet->dmx, &length); + + unsigned int header_size = sizeof(sandnet_dmx) - sizeof(dmx_packet->dmx); + return SendPacket(packet, sizeof(packet.opcode) + header_size + length); +} + + + +/* + * Send a packet + */ +bool SandNetNode::SendPacket(const sandnet_packet &packet, + unsigned int size, + bool is_control) { + struct sockaddr_in destination; + destination.sin_family = AF_INET; + + UdpSocket *socket; + + if (is_control) { + destination.sin_port = HostToNetwork(CONTROL_PORT); + destination.sin_addr = m_control_addr; + socket = &m_control_socket; + } else { + destination.sin_port = HostToNetwork(DATA_PORT); + destination.sin_addr = m_data_addr; + socket = &m_data_socket; + } + + ssize_t bytes_sent = socket->SendTo( + reinterpret_cast(&packet), + size, + destination); + + if (bytes_sent != static_cast(size)) { + OLA_WARN << "Only sent " << bytes_sent << " of " << size; + return false; + } + return true; +} +} // sandnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.h new file mode 100644 index 0000000..9515fb1 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetNode.h @@ -0,0 +1,126 @@ +/* + * 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 Library 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. + * + * SandNetNode.h + * Header file for the SandNetNode class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETNODE_H_ +#define PLUGINS_SANDNET_SANDNETNODE_H_ + +#include +#include +#include +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/Socket.h" +#include "ola/RunLengthEncoder.h" +#include "plugins/sandnet/SandNetPackets.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +using ola::network::UdpSocket; + +class SandNetNode { + public: + typedef enum { + SANDNET_PORT_MODE_DISABLED, + SANDNET_PORT_MODE_OUT, + SANDNET_PORT_MODE_IN, + SANDNET_PORT_MODE_MOUT, + SANDNET_PORT_MODE_MIN + } sandnet_port_type; + + explicit SandNetNode(const string &preferred_ip); + ~SandNetNode(); + + const ola::network::Interface &GetInterface() const { + return m_interface; + } + + void SetName(const string &name) { + m_node_name = name; + } + bool Start(); + bool Stop(); + std::vector GetSockets(); + void SocketReady(UdpSocket *socket); + + bool SetHandler(uint8_t group, + uint8_t universe, + DmxBuffer *buffer, + Closure *closure); + bool RemoveHandler(uint8_t group, uint8_t universe); + + bool SetPortParameters(uint8_t port_id, sandnet_port_type type, + uint8_t group, uint8_t universe); + bool SendAdvertisement(); + bool SendDMX(uint8_t port_id, const DmxBuffer &buffer); + + private: + typedef struct { + uint8_t group; + uint8_t universe; + sandnet_port_type type; + } sandnet_port; + + typedef struct { + DmxBuffer *buffer; + Closure *closure; + } universe_handler; + + typedef std::pair group_universe_pair; + typedef std::map universe_handlers; + + bool InitNetwork(); + + bool HandleCompressedDMX(const sandnet_compressed_dmx &dmx_packet, + unsigned int size); + + bool HandleDMX(const sandnet_dmx &dmx_packet, + unsigned int size); + bool SendUncompressedDMX(uint8_t port_id, const DmxBuffer &buffer); + bool SendPacket(const sandnet_packet &packet, + unsigned int size, + bool is_control = false); + + bool m_running; + string m_node_name; + string m_preferred_ip; + + sandnet_port m_ports[SANDNET_MAX_PORTS]; + universe_handlers m_handlers; + ola::network::Interface m_interface; + UdpSocket m_control_socket; + UdpSocket m_data_socket; + RunLengthEncoder m_encoder; + struct in_addr m_data_addr; + struct in_addr m_control_addr; + + static const uint16_t CONTROL_PORT = 37895; + static const uint16_t DATA_PORT = 37900; + static const char CONTROL_ADDRESS[]; + static const char DATA_ADDRESS[]; + static const char DEFAULT_NODE_NAME[]; + static const uint32_t FIRMWARE_VERSION = 0x00050501; +}; +} // sandnet +} // plugin +} // ola +#endif // PLUGINS_SANDNET_SANDNETNODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPackets.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPackets.h new file mode 100644 index 0000000..c4a2784 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPackets.h @@ -0,0 +1,203 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * SandnetPackets.h + * Datagram definitions for Sandnet + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETPACKETS_H_ +#define PLUGINS_SANDNET_SANDNETPACKETS_H_ + +#include +#include +#include + +#include // MAC_LENGTH +#include +#include "plugins/sandnet/SandNetCommon.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +using ola::network::MAC_LENGTH; + +enum { SANDNET_NAME_LENGTH = 31}; + +/* + * Sandnet opcodes. + * These are transmitted as little-endian which why they appear strange. + */ +enum packet_type_e { + SANDNET_ADVERTISMENT = 0x0100, + SANDNET_CONTROL = 0x0200, + SANDNET_DMX = 0x0300, + SANDNET_NAME = 0x0400, + SANDNET_IDENTIFY = 0x0500, + SANDNET_PROG = 0x0600, + SANDNET_LED = 0x0700, + SANDNET_COMPRESSED_DMX = 0x0a00, +}__attribute__((packed)); + +typedef enum packet_type_e packet_type_t; + +enum protocol_id_e { + SANDNET_SANDNET = 0x02, + SANDNET_ARTNET = 0x04, + SANDNET_COMPULIGHT = 0x06, + SANDNET_SHOWNET = 0x09, + SANDNET_IPX = 0x0d, + SANDNET_ACN = 0x0e, +}__attribute__((packed)); + +typedef enum protocol_id_e protocol_id_t; + +struct sandnet_packet_advertisement_port_s { + protocol_id_t protocol; // protocol + uint8_t mode; // mode + uint8_t term; // terminate + uint8_t b; // ?? + uint8_t group; // group + uint8_t universe; // universe + uint8_t crap[53]; // ?? +}__attribute__((packed)); + + +/* + * A Sandnet Advertisment + */ +struct sandnet_advertisement_s { + uint8_t mac[ola::network::MAC_LENGTH]; // mac address + uint32_t firmware; // firmware version + struct sandnet_packet_advertisement_port_s ports[SANDNET_MAX_PORTS]; // ports + uint8_t nlen; // length of the name field + char name[SANDNET_NAME_LENGTH]; // name field (null terminated) + uint8_t magic3[9]; // magic numbers + uint8_t led; // flash the led + uint8_t magic4; // ?? + uint8_t zero4[64]; // null +}__attribute__((packed)); + +typedef struct sandnet_advertisement_s sandnet_advertisement; + + +/* + * The first of the DMX packets + */ +struct sandnet_dmx_s { + uint8_t group; // group + uint8_t universe; // universe + uint8_t port; // physical port number + uint8_t dmx[DMX_UNIVERSE_SIZE]; // dmx buffer +}__attribute__((packed)); + +typedef struct sandnet_dmx_s sandnet_dmx; + + +/* + * Changes the port attributes + */ +struct sandnet_port_control_s { + uint8_t mac[MAC_LENGTH]; // mac address + uint8_t magic[4]; // ?? seems to change + struct sandnet_packet_advertisement_port_s ports[SANDNET_MAX_PORTS]; // ports +}__attribute__((packed)); + +typedef struct sandnet_port_control_s sandnet_port_control; + + +/* + * Sets the name of the sandnet node + */ +struct sandnet_name_s { + uint8_t mac[MAC_LENGTH]; // mac address + uint8_t name_length; // length of the name field + uint8_t name[SANDNET_NAME_LENGTH]; // name field +}__attribute__((packed)); + +typedef struct sandnet_name_s sandnet_name; + + +/* + * identify packet + * (presumably this flashes the leds or something) + */ +struct sandnet_identify_s { + uint8_t mac[MAC_LENGTH]; // mac address +}__attribute__((packed)); + +typedef struct sandnet_identify_s sandnet_identify; + + +/* + * ip program packet + * sets the node's networking parameters + */ +struct sandnet_program_s { + uint8_t mac[MAC_LENGTH]; // mac address + uint8_t ip[4]; + uint8_t dhcp; + uint8_t netmask[4]; +}__attribute__((packed)); + +typedef struct sandnet_program_s sandnet_program; + + +/* + * Turns the led on and off + */ +struct sandnet_led_s { + uint8_t mac[MAC_LENGTH]; // mac address + uint8_t led; // 0x00 off, 0xff on +}__attribute__((packed)); + +typedef struct sandnet_led_s sandnet_led; + + +/* + * DMX data + */ +struct sandnet_compressed_dmx_s { + uint8_t group; // group + uint8_t universe; // universe + uint8_t port; // physical port number + uint8_t zero1[4]; // could be the offset + uint8_t two; // 0x02 + uint16_t length; // length of data + uint8_t dmx[DMX_UNIVERSE_SIZE]; +} __attribute__((packed)); + +typedef struct sandnet_compressed_dmx_s sandnet_compressed_dmx; + + +// A generic Sandnet packet containing the union of all possible packets +struct sandnet_packet { + uint16_t opcode; + union { + sandnet_advertisement advertisement; + sandnet_port_control port_control; + sandnet_dmx dmx; + sandnet_name name; + sandnet_identify id; + sandnet_program program; + sandnet_led led; + sandnet_compressed_dmx compressed_dmx; + } contents; +} __attribute__((packed)); +} // sandnet +} // plugin +} // ola +#endif // PLUGINS_SANDNET_SANDNETPACKETS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.cpp new file mode 100644 index 0000000..f3de017 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.cpp @@ -0,0 +1,127 @@ +/* + * 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 Library 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. + * + * SandNetPlugin.cpp + * The SandNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include "olad/Preferences.h" +#include "plugins/sandnet/SandNetDevice.h" +#include "plugins/sandnet/SandNetPlugin.h" + + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create( + const ola::PluginAdaptor *plugin_adaptor) { + return new ola::plugin::sandnet::SandNetPlugin(plugin_adaptor); +} + + +namespace ola { +namespace plugin { +namespace sandnet { + +const char SandNetPlugin::SANDNET_NODE_NAME[] = "ola-SandNet"; +const char SandNetPlugin::PLUGIN_NAME[] = "SandNet"; +const char SandNetPlugin::PLUGIN_PREFIX[] = "sandnet"; + + +/* + * Start the plugin + */ +bool SandNetPlugin::StartHook() { + m_device = new SandNetDevice(this, + m_preferences, + m_plugin_adaptor); + + if (!m_device) + return false; + + if (!m_device->Start()) { + delete m_device; + return false; + } + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool SandNetPlugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * Return the description for this plugin + */ +string SandNetPlugin::Description() const { + return +"SandNet Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with 2 output and 8 input ports.\n" +"\n" +"The universe bindings are offset by one from those displayed in sandnet.\n" +"For example, SandNet universe 1 is OLA universe 0\n" +"\n" +"--- Config file : ola-sandnet.conf ---\n" +"\n" +"ip = a.b.c.d\n" +"The ip to listen for sandnet traffic on. If not specified it will use the " +"first non-loopback ip.\n" +"\n" +"name = ola-SandNet\n" +"The name of the node.\n"; +} + + +/* + * Assign default values + */ +bool SandNetPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + save |= m_preferences->SetDefaultValue(SandNetDevice::IP_KEY, + IPv4Validator(), ""); + save |= m_preferences->SetDefaultValue(SandNetDevice::NAME_KEY, + StringValidator(), SANDNET_NODE_NAME); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue(SandNetDevice::NAME_KEY).empty()) + return false; + return true; +} +} // sandnet +} // plugin +} // ola + diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.h new file mode 100644 index 0000000..9c7e00a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPlugin.h @@ -0,0 +1,58 @@ +/* + * 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 Library 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. + * + * SandNetPlugin.h + * Interface for the sandnet plugin class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETPLUGIN_H_ +#define PLUGINS_SANDNET_SANDNETPLUGIN_H_ + +#include +#include "ola/plugin_id.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +class SandNetPlugin: public ola::Plugin { + public: + explicit SandNetPlugin(const ola::PluginAdaptor *plugin_adaptor) + : Plugin(plugin_adaptor), + m_device(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_SANDNET; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + class SandNetDevice *m_device; // only have one device + + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + static const char SANDNET_NODE_NAME[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; +}; +} // sandnet +} // plugin +} // ola +#endif // PLUGINS_SANDNET_SANDNETPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.cpp new file mode 100644 index 0000000..7fbcd98 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.cpp @@ -0,0 +1,132 @@ +/* + * 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 Library 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. + * + * + * SandNetPort.cpp + * The SandNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "olad/Universe.h" + +#include "plugins/sandnet/SandNetPort.h" +#include "plugins/sandnet/SandNetDevice.h" +#include "plugins/sandnet/SandNetCommon.h" + +namespace ola { +namespace plugin { +namespace sandnet { + + +/* + * We override the set universe method to update the universe -> port hash + */ +bool SandNetPortHelper::PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (new_universe && !new_universe->UniverseId()) { + OLA_WARN << "Can't use universe 0 with Sandnet!"; + return false; + } + (void) old_universe; + return true; +} + + +string SandNetPortHelper::Description(const Universe *universe) const { + std::stringstream str; + if (universe) { + str << "Sandnet group " << static_cast(SandnetGroup(universe)) << + ", universe " << 1 + SandnetUniverse(universe); + } + return str.str(); +} + + +/* + * Return the sandnet group that corresponds to a OLA Universe. + * @param universe the OLA universe + * @returns the sandnet group number + */ +uint8_t SandNetPortHelper::SandnetGroup(const Universe *universe) const { + if (universe) + return (uint8_t) ((universe->UniverseId() - 1) >> 8); + return 0; +} + + +/* + * Return the sandnet group that corresponds to a OLA Universe. Sandnet + * Universes range from 0 to 255 (represented as 1 to 256 in the packets). + * @param universe the OLA universe + * @returns the sandnet universe number + */ +uint8_t SandNetPortHelper::SandnetUniverse(const Universe *universe) const { + if (universe) + return universe->UniverseId() - 1; + return 0; +} + + + +void SandNetInputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (old_universe) + m_node->RemoveHandler(m_helper.SandnetGroup(old_universe), + m_helper.SandnetUniverse(old_universe)); + + if (new_universe) { + m_node->SetHandler( + m_helper.SandnetGroup(new_universe), + m_helper.SandnetUniverse(new_universe), + &m_buffer, + NewClosure(this, + &SandNetInputPort::DmxChanged)); + } +} + + +/* + * Write operation + */ +bool SandNetOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + (void) priority; + if (!GetUniverse()) + return false; + + if (!m_node->SendDMX(PortId(), buffer)) + return false; + return true; +} + + +void SandNetOutputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (new_universe) + m_node->SetPortParameters(PortId(), + SandNetNode::SANDNET_PORT_MODE_IN, + m_helper.SandnetGroup(new_universe), + m_helper.SandnetUniverse(new_universe)); + (void) old_universe; +} +} // sandnet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.h b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.h new file mode 100644 index 0000000..b8c9b30 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/sandnet/SandNetPort.h @@ -0,0 +1,91 @@ +/* + * 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 Library 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. + * + * + * SandNetPort.h + * The SandNet plugin for ola + * Copyright (C) 2005-2006 Simon Newton + */ + +#ifndef PLUGINS_SANDNET_SANDNETPORT_H_ +#define PLUGINS_SANDNET_SANDNETPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "olad/Port.h" +#include "plugins/sandnet/SandNetDevice.h" + +namespace ola { +namespace plugin { +namespace sandnet { + +class SandNetPortHelper { + public: + SandNetPortHelper() {} + bool PreSetUniverse(Universe *old_universe, Universe *new_universe); + string Description(const Universe *universe) const; + uint8_t SandnetGroup(const Universe* universe) const; + uint8_t SandnetUniverse(const Universe *universe) const; +}; + + +class SandNetInputPort: public BasicInputPort { + public: + SandNetInputPort(SandNetDevice *parent, + unsigned int id, + const TimeStamp *wake_time, + SandNetNode *node): + BasicInputPort(parent, id, wake_time), + m_node(node) {} + ~SandNetInputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + const DmxBuffer &ReadDMX() const { return m_buffer; } + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(old_universe, new_universe); + } + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + + private: + SandNetPortHelper m_helper; + SandNetNode *m_node; + DmxBuffer m_buffer; +}; + + +class SandNetOutputPort: public BasicOutputPort { + public: + SandNetOutputPort(SandNetDevice *parent, + unsigned int id, + SandNetNode *node): + BasicOutputPort(parent, id), + m_node(node) {} + ~SandNetOutputPort() {} + + string Description() const { return m_helper.Description(GetUniverse()); } + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + bool PreSetUniverse(Universe *old_universe, Universe *new_universe) { + return m_helper.PreSetUniverse(old_universe, new_universe); + } + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + + private: + SandNetPortHelper m_helper; + SandNetNode *m_node; +}; +} // sandnet +} // plugin +} // ola +#endif // PLUGINS_SANDNET_SANDNETPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.am new file mode 100644 index 0000000..658aec4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.am @@ -0,0 +1,20 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) + +EXTRA_DIST = ShowNetPlugin.h ShowNetDevice.h ShowNetPort.h ShowNetPackets.h \ + ShowNetNode.h + +lib_LTLIBRARIES = libolashownet.la +libolashownet_la_SOURCES = ShowNetPlugin.cpp ShowNetDevice.cpp ShowNetPort.cpp\ + ShowNetNode.cpp +libolashownet_la_LIBADD = @LIBS@ + +# Test Programs +TESTS = ShowNetTester +check_PROGRAMS = $(TESTS) +ShowNetTester_SOURCES = ShowNetTester.cpp \ + ShowNetNode.cpp ShowNetNodeTest.cpp +ShowNetTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +ShowNetTester_LDFLAGS = $(CPPUNIT_LIBS) +ShowNetTester_LDADD = @LIBS@ -lprotobuf ../../common/libolacommon.la diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.in new file mode 100644 index 0000000..c964000 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/Makefile.in @@ -0,0 +1,649 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +TESTS = ShowNetTester$(EXEEXT) +check_PROGRAMS = $(am__EXEEXT_1) +subdir = plugins/shownet +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolashownet_la_DEPENDENCIES = +am_libolashownet_la_OBJECTS = ShowNetPlugin.lo ShowNetDevice.lo \ + ShowNetPort.lo ShowNetNode.lo +libolashownet_la_OBJECTS = $(am_libolashownet_la_OBJECTS) +am__EXEEXT_1 = ShowNetTester$(EXEEXT) +am_ShowNetTester_OBJECTS = ShowNetTester-ShowNetTester.$(OBJEXT) \ + ShowNetTester-ShowNetNode.$(OBJEXT) \ + ShowNetTester-ShowNetNodeTest.$(OBJEXT) +ShowNetTester_OBJECTS = $(am_ShowNetTester_OBJECTS) +ShowNetTester_DEPENDENCIES = ../../common/libolacommon.la +ShowNetTester_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(ShowNetTester_CXXFLAGS) \ + $(CXXFLAGS) $(ShowNetTester_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolashownet_la_SOURCES) $(ShowNetTester_SOURCES) +DIST_SOURCES = $(libolashownet_la_SOURCES) $(ShowNetTester_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = ShowNetPlugin.h ShowNetDevice.h ShowNetPort.h ShowNetPackets.h \ + ShowNetNode.h + +lib_LTLIBRARIES = libolashownet.la +libolashownet_la_SOURCES = ShowNetPlugin.cpp ShowNetDevice.cpp ShowNetPort.cpp\ + ShowNetNode.cpp + +libolashownet_la_LIBADD = @LIBS@ +ShowNetTester_SOURCES = ShowNetTester.cpp \ + ShowNetNode.cpp ShowNetNodeTest.cpp + +ShowNetTester_CXXFLAGS = $(CPPUNIT_CFLAGS) +ShowNetTester_LDFLAGS = $(CPPUNIT_LIBS) +ShowNetTester_LDADD = @LIBS@ -lprotobuf ../../common/libolacommon.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/shownet/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/shownet/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolashownet.la: $(libolashownet_la_OBJECTS) $(libolashownet_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolashownet_la_OBJECTS) $(libolashownet_la_LIBADD) $(LIBS) + +clean-checkPROGRAMS: + @list='$(check_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +ShowNetTester$(EXEEXT): $(ShowNetTester_OBJECTS) $(ShowNetTester_DEPENDENCIES) + @rm -f ShowNetTester$(EXEEXT) + $(ShowNetTester_LINK) $(ShowNetTester_OBJECTS) $(ShowNetTester_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetTester-ShowNetNode.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetTester-ShowNetNodeTest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShowNetTester-ShowNetTester.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +ShowNetTester-ShowNetTester.o: ShowNetTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetTester.o -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetTester.Tpo -c -o ShowNetTester-ShowNetTester.o `test -f 'ShowNetTester.cpp' || echo '$(srcdir)/'`ShowNetTester.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetTester.Tpo $(DEPDIR)/ShowNetTester-ShowNetTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetTester.cpp' object='ShowNetTester-ShowNetTester.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetTester.o `test -f 'ShowNetTester.cpp' || echo '$(srcdir)/'`ShowNetTester.cpp + +ShowNetTester-ShowNetTester.obj: ShowNetTester.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetTester.obj -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetTester.Tpo -c -o ShowNetTester-ShowNetTester.obj `if test -f 'ShowNetTester.cpp'; then $(CYGPATH_W) 'ShowNetTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetTester.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetTester.Tpo $(DEPDIR)/ShowNetTester-ShowNetTester.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetTester.cpp' object='ShowNetTester-ShowNetTester.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetTester.obj `if test -f 'ShowNetTester.cpp'; then $(CYGPATH_W) 'ShowNetTester.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetTester.cpp'; fi` + +ShowNetTester-ShowNetNode.o: ShowNetNode.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetNode.o -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetNode.Tpo -c -o ShowNetTester-ShowNetNode.o `test -f 'ShowNetNode.cpp' || echo '$(srcdir)/'`ShowNetNode.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetNode.Tpo $(DEPDIR)/ShowNetTester-ShowNetNode.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetNode.cpp' object='ShowNetTester-ShowNetNode.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetNode.o `test -f 'ShowNetNode.cpp' || echo '$(srcdir)/'`ShowNetNode.cpp + +ShowNetTester-ShowNetNode.obj: ShowNetNode.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetNode.obj -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetNode.Tpo -c -o ShowNetTester-ShowNetNode.obj `if test -f 'ShowNetNode.cpp'; then $(CYGPATH_W) 'ShowNetNode.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetNode.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetNode.Tpo $(DEPDIR)/ShowNetTester-ShowNetNode.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetNode.cpp' object='ShowNetTester-ShowNetNode.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetNode.obj `if test -f 'ShowNetNode.cpp'; then $(CYGPATH_W) 'ShowNetNode.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetNode.cpp'; fi` + +ShowNetTester-ShowNetNodeTest.o: ShowNetNodeTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetNodeTest.o -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Tpo -c -o ShowNetTester-ShowNetNodeTest.o `test -f 'ShowNetNodeTest.cpp' || echo '$(srcdir)/'`ShowNetNodeTest.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Tpo $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetNodeTest.cpp' object='ShowNetTester-ShowNetNodeTest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetNodeTest.o `test -f 'ShowNetNodeTest.cpp' || echo '$(srcdir)/'`ShowNetNodeTest.cpp + +ShowNetTester-ShowNetNodeTest.obj: ShowNetNodeTest.cpp +@am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -MT ShowNetTester-ShowNetNodeTest.obj -MD -MP -MF $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Tpo -c -o ShowNetTester-ShowNetNodeTest.obj `if test -f 'ShowNetNodeTest.cpp'; then $(CYGPATH_W) 'ShowNetNodeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetNodeTest.cpp'; fi` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Tpo $(DEPDIR)/ShowNetTester-ShowNetNodeTest.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShowNetNodeTest.cpp' object='ShowNetTester-ShowNetNodeTest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ShowNetTester_CXXFLAGS) $(CXXFLAGS) -c -o ShowNetTester-ShowNetNodeTest.obj `if test -f 'ShowNetNodeTest.cpp'; then $(CYGPATH_W) 'ShowNetNodeTest.cpp'; else $(CYGPATH_W) '$(srcdir)/ShowNetNodeTest.cpp'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.cpp new file mode 100644 index 0000000..685bcef --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.cpp @@ -0,0 +1,107 @@ +/* + * 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 Library 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. + * + * ShowNetDevice.cpp + * ShowNet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/Plugin.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/shownet/ShowNetDevice.h" +#include "plugins/shownet/ShowNetNode.h" +#include "plugins/shownet/ShowNetPort.h" + +namespace ola { +namespace plugin { +namespace shownet { + +const char ShowNetDevice::SHOWNET_DEVICE_NAME[] = "ShowNet"; +const char ShowNetDevice::IP_KEY[] = "ip"; + + +/* + * Create a new device + */ +ShowNetDevice::ShowNetDevice(ola::Plugin *owner, + Preferences *preferences, + const PluginAdaptor *plugin_adaptor): + Device(owner, SHOWNET_DEVICE_NAME), + m_preferences(preferences), + m_plugin_adaptor(plugin_adaptor), + m_node(NULL) {} + + +/* + * Start this device + */ +bool ShowNetDevice::StartHook() { + m_node = new ShowNetNode(m_preferences->GetValue(IP_KEY)); + m_node->SetName(m_preferences->GetValue("name")); + + if (!m_node->Start()) { + delete m_node; + m_node = NULL; + DeleteAllPorts(); + return false; + } + + stringstream str; + str << SHOWNET_DEVICE_NAME << " [" << + ola::network::AddressToString(m_node->GetInterface().ip_address) << "]"; + SetName(str.str()); + + + for (unsigned int i = 0; i < ShowNetNode::SHOWNET_MAX_UNIVERSES; i++) { + ShowNetInputPort *input_port = new ShowNetInputPort( + this, + i, + m_plugin_adaptor->WakeUpTime(), + m_node); + AddPort(input_port); + ShowNetOutputPort *output_port = new ShowNetOutputPort(this, i, m_node); + AddPort(output_port); + } + + m_plugin_adaptor->AddSocket(m_node->GetSocket()); + return true; +} + + +/* + * Stop this device + */ +void ShowNetDevice::PrePortStop() { + m_plugin_adaptor->RemoveSocket(m_node->GetSocket()); +} + + +/* + * Stop this device + */ +void ShowNetDevice::PostPortStop() { + m_node->Stop(); + delete m_node; + m_node = NULL; +} +} // shownet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.h new file mode 100644 index 0000000..a214340 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetDevice.h @@ -0,0 +1,61 @@ +/* + * 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 Library 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. + * + * ShowNetDevice.h + * Interface for the ShowNet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SHOWNET_SHOWNETDEVICE_H_ +#define PLUGINS_SHOWNET_SHOWNETDEVICE_H_ + +#include +#include "olad/Device.h" +#include "olad/Plugin.h" + +namespace ola { +namespace plugin { +namespace shownet { + +using ola::Plugin; + +class ShowNetDevice: public ola::Device { + public: + ShowNetDevice(Plugin *owner, + class Preferences *preferences, + const class PluginAdaptor *plugin_adaptor); + ~ShowNetDevice() {} + + bool AllowMultiPortPatching() const { return true; } + string DeviceId() const { return "1"; } + + static const char IP_KEY[]; + + protected: + bool StartHook(); + void PrePortStop(); + void PostPortStop(); + + private: + class Preferences *m_preferences; + const class PluginAdaptor *m_plugin_adaptor; + class ShowNetNode *m_node; + + static const char SHOWNET_DEVICE_NAME[]; +}; +} // shownet +} // plugin +} // ola +#endif // PLUGINS_SHOWNET_SHOWNETDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.cpp new file mode 100644 index 0000000..5d1fe2f --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.cpp @@ -0,0 +1,360 @@ +/* + * 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 Library 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. + * + * ShowNetNode.cpp + * A ShowNet node + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/shownet/ShowNetNode.h" + + +namespace ola { +namespace plugin { +namespace shownet { + +using std::string; +using std::map; +using ola::network::UdpSocket; +using ola::network::HostToNetwork; +using ola::Closure; + + +/* + * Create a new node + * @param ip_address the IP address to prefer to listen on, if NULL we choose + * one. + */ +ShowNetNode::ShowNetNode(const string &ip_address) + : m_running(false), + m_packet_count(0), + m_node_name(), + m_preferred_ip(ip_address) { + memset(&m_destination, 0, sizeof(m_destination)); +} + + +/* + * Cleanup + */ +ShowNetNode::~ShowNetNode() { + Stop(); + + std::map::iterator iter; + for (iter = m_handlers.begin(); iter != m_handlers.end(); ++iter) { + delete iter->second.closure; + } + m_handlers.clear(); +} + + +/* + * Start this node + */ +bool ShowNetNode::Start() { + if (m_running) + return false; + + ola::network::InterfacePicker *picker = + ola::network::InterfacePicker::NewPicker(); + if (!picker->ChooseInterface(&m_interface, m_preferred_ip)) { + delete picker; + OLA_INFO << "Failed to find an interface"; + return false; + } + delete picker; + + if (!InitNetwork()) + return false; + + m_destination.sin_family = AF_INET; + m_destination.sin_port = HostToNetwork(SHOWNET_PORT); + m_destination.sin_addr = m_interface.bcast_address; + m_running = true; + return true; +} + + +/* + * Stop this node + */ +bool ShowNetNode::Stop() { + if (!m_running) + return false; + + if (m_socket) { + delete m_socket; + m_socket = NULL; + } + + m_running = false; + return true; +} + + +/* + * Set the node name + * @param name the new node name + */ +void ShowNetNode::SetName(const string &name) { + m_node_name = name; +} + + +/* + * Send some DMX data + * @param universe the id of the universe to send + * @param buffer the DMX data + * @return true if it was send successfully, false otherwise + */ +bool ShowNetNode::SendDMX(unsigned int universe, + const ola::DmxBuffer &buffer) { + if (!m_running) + return false; + + if (universe >= SHOWNET_MAX_UNIVERSES) { + OLA_WARN << "Universe index out of bounds, should be between 0 and" << + SHOWNET_MAX_UNIVERSES << "), was " << universe; + return false; + } + + shownet_data_packet packet; + unsigned int size = PopulatePacket(&packet, universe, buffer); + unsigned int bytes_sent = m_socket->SendTo( + reinterpret_cast(&packet), + size, + m_destination); + + if (bytes_sent != size) { + OLA_WARN << "Only sent " << bytes_sent << " of " << size; + return false; + } + + m_packet_count++; + return true; +} + + +/* + * Set the closure to be called when we receive data for this universe. + * @param universe the universe to register the handler for + * @param handler the Closure to call when there is data for this universe. + * Ownership of the closure is transferred to the node. + */ +bool ShowNetNode::SetHandler(unsigned int universe, + DmxBuffer *buffer, + Closure *closure) { + if (!closure) + return false; + + map::iterator iter = + m_handlers.find(universe); + + if (iter == m_handlers.end()) { + universe_handler handler; + handler.buffer = buffer; + handler.closure = closure; + m_handlers[universe] = handler; + } else { + Closure *old_closure = iter->second.closure; + iter->second.closure = closure; + delete old_closure; + } + return true; +} + + +/* + * Remove the handler for this universe + * @param universe the universe handler to remove + * @param true if removed, false if it didn't exist + */ +bool ShowNetNode::RemoveHandler(unsigned int universe) { + map::iterator iter = + m_handlers.find(universe); + + if (iter != m_handlers.end()) { + Closure *old_closure = iter->second.closure; + m_handlers.erase(iter); + delete old_closure; + return true; + } + return false; +} + + +/* + * Called when there is data on this socket + */ +void ShowNetNode::SocketReady() { + shownet_data_packet packet; + ssize_t packet_size = sizeof(packet); + struct sockaddr_in source; + socklen_t source_length = sizeof(source); + + if (!m_socket->RecvFrom(reinterpret_cast(&packet), + &packet_size, + source, + source_length)) + return; + + // skip packets sent by us + if (source.sin_addr.s_addr != m_interface.ip_address.s_addr) + HandlePacket(packet, packet_size); +} + + +/* + * Handle a shownet packet + */ +bool ShowNetNode::HandlePacket(const shownet_data_packet &packet, + unsigned int packet_size) { + unsigned int header_size = sizeof(packet) - sizeof(packet.data); + + if (packet_size <= header_size) { + OLA_WARN << "Skipping small shownet packet received, size=" << packet_size; + return false; + } + + if (packet.sigHi != SHOWNET_ID_HIGH || packet.sigLo != SHOWNET_ID_LOW) { + OLA_INFO << "Skipping a packet that isn't shownet"; + return false; + } + + if (packet.indexBlock[0] < MAGIC_INDEX_OFFSET) { + OLA_WARN << "Strange ShowNet packet, indexBlock[0] is " << + packet.indexBlock[0] << ", please contact the developers!"; + return false; + } + + // We only handle data from the first slot + // enc_length is the size of the received (optionally encoded) DMX data + int enc_len = packet.indexBlock[1] - packet.indexBlock[0]; + if (enc_len < 1 || packet.netSlot[0] == 0) { + OLA_WARN << "Invalid shownet packet, enc_len=" << enc_len << ", netSlot=" + << packet.netSlot[0]; + return false; + } + + // the offset into packet.data of the actual data + unsigned int data_offset = packet.indexBlock[0] - MAGIC_INDEX_OFFSET; + unsigned int received_data_size = packet_size - header_size; + + if (data_offset + enc_len > received_data_size) { + OLA_WARN << "Not enough shownet data: offset=" << data_offset << + ", enc_len=" << enc_len << ", received_bytes=" << received_data_size; + return false; + } + + if (!packet.slotSize[0]) { + OLA_WARN << "Malformed shownet packet, slotSize=" << packet.slotSize[0]; + return false; + } + + unsigned int start_channel = (packet.netSlot[0] - 1) % DMX_UNIVERSE_SIZE; + unsigned int universe_id = (packet.netSlot[0] - 1) / DMX_UNIVERSE_SIZE; + map::iterator iter = + m_handlers.find(universe_id); + + if (iter == m_handlers.end()) { + OLA_DEBUG << "Not interested in universe " << universe_id << + ", skipping "; + return false; + } + + if (packet.slotSize[0] != enc_len) { + m_encoder.Decode(iter->second.buffer, + start_channel, + packet.data + data_offset, + enc_len); + } else { + iter->second.buffer->SetRange(start_channel, + packet.data + data_offset, + enc_len); + } + iter->second.closure->Run(); + return true; +} + + +/* + * Populate a shownet data packet + */ +unsigned int ShowNetNode::PopulatePacket(shownet_data_packet *packet, + unsigned int universe, + const DmxBuffer &buffer) { + memset(packet, 0, sizeof(*packet)); + + // setup the fields in the shownet packet + packet->sigHi = SHOWNET_ID_HIGH; + packet->sigLo = SHOWNET_ID_LOW; + memcpy(packet->ip, &m_interface.ip_address, sizeof(packet->ip)); + + packet->netSlot[0] = (universe * DMX_UNIVERSE_SIZE) + 1; + packet->slotSize[0] = buffer.Size(); + + unsigned int enc_len = sizeof(packet->data); + if (!m_encoder.Encode(buffer, packet->data, enc_len)) + OLA_WARN << "Failed to encode all data (used " << enc_len << " bytes"; + + packet->indexBlock[0] = MAGIC_INDEX_OFFSET; + packet->indexBlock[1] = MAGIC_INDEX_OFFSET + enc_len; + + packet->packetCountHi = ShortGetHigh(m_packet_count); + packet->packetCountLo = ShortGetLow(m_packet_count); + + strncpy(reinterpret_cast(packet->name), m_node_name.data(), + SHOWNET_NAME_LENGTH); + return sizeof(*packet) - sizeof(packet->data) + enc_len; +} + + +/* + * Setup the networking compoents. + */ +bool ShowNetNode::InitNetwork() { + m_socket = new UdpSocket(); + + if (!m_socket->Init()) { + OLA_WARN << "Socket init failed"; + delete m_socket; + return false; + } + + if (!m_socket->Bind(SHOWNET_PORT)) { + OLA_WARN << "Failed to bind to:" << SHOWNET_PORT; + delete m_socket; + return false; + } + + if (!m_socket->EnableBroadcast()) { + OLA_WARN << "Failed to enable broadcasting"; + delete m_socket; + return false; + } + + m_socket->SetOnData(NewClosure(this, &ShowNetNode::SocketReady)); + return true; +} +} // shownet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.h b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.h new file mode 100644 index 0000000..09b0d28 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNode.h @@ -0,0 +1,97 @@ +/* + * 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 Library 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. + * + * ShowNetNode.h + * Header file for the ShowNetNode class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SHOWNET_SHOWNETNODE_H_ +#define PLUGINS_SHOWNET_SHOWNETNODE_H_ + +#include +#include +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "ola/RunLengthEncoder.h" +#include "ola/network/InterfacePicker.h" +#include "ola/network/Socket.h" +#include "plugins/shownet/ShowNetPackets.h" + +namespace ola { +namespace plugin { +namespace shownet { + +class ShowNetNode { + public: + explicit ShowNetNode(const std::string &ip_address); + virtual ~ShowNetNode(); + + bool Start(); + bool Stop(); + void SetName(const std::string &name); + + bool SendDMX(unsigned int universe, const ola::DmxBuffer &buffer); + bool SetHandler(unsigned int universe, + DmxBuffer *buffer, + ola::Closure *handler); + bool RemoveHandler(unsigned int universe); + + const ola::network::Interface &GetInterface() const { + return m_interface; + } + + ola::network::UdpSocket* GetSocket() { return m_socket; } + void SocketReady(); + + static const uint16_t SHOWNET_MAX_UNIVERSES = 8; + + friend class ShowNetNodeTest; + + private: + typedef struct { + DmxBuffer *buffer; + Closure *closure; + } universe_handler; + + bool m_running; + uint16_t m_packet_count; + std::string m_node_name; + std::string m_preferred_ip; + std::map m_handlers; + ola::network::Interface m_interface; + ola::RunLengthEncoder m_encoder; + ola::network::UdpSocket *m_socket; + struct sockaddr_in m_destination; + + ShowNetNode(const ShowNetNode&); + ShowNetNode& operator=(const ShowNetNode&); + bool HandlePacket(const shownet_data_packet &packet, unsigned int size); + unsigned int PopulatePacket(shownet_data_packet *packet, + unsigned int universe, + const DmxBuffer &buffer); + bool InitNetwork(); + inline uint8_t ShortGetHigh(uint16_t x) const { return (0xff00 & x) >> 8; } + inline uint8_t ShortGetLow(uint16_t x) const { return 0x00ff & x; } + + static const uint16_t SHOWNET_PORT = 2501; + static const uint8_t SHOWNET_ID_HIGH = 0x80; + static const uint8_t SHOWNET_ID_LOW = 0x8f; + static const int MAGIC_INDEX_OFFSET = 11; +}; +} // shownet +} // plugin +} // ola +#endif // PLUGINS_SHOWNET_SHOWNETNODE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNodeTest.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNodeTest.cpp new file mode 100644 index 0000000..534a516 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetNodeTest.cpp @@ -0,0 +1,306 @@ +/* + * 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 Library 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. + * + * ShowNetNodeTest.cpp + * Test fixture for the ShowNetNode class + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/DmxBuffer.h" +#include "plugins/shownet/ShowNetNode.h" + +namespace ola { +namespace plugin { +namespace shownet { + +using ola::DmxBuffer; +using std::map; + +class ShowNetNodeTest: public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(ShowNetNodeTest); + CPPUNIT_TEST(testHandlePacket); + CPPUNIT_TEST(testPopulatePacket); + CPPUNIT_TEST(testSendAndReceive); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void testHandlePacket(); + void testPopulatePacket(); + void testSendAndReceive(); + void UpdateData(unsigned int universe); + void SendAndReceiveForUniverse(unsigned int universe); + private: + bool m_hander_called; + ShowNetNode *m_node; +}; + + +CPPUNIT_TEST_SUITE_REGISTRATION(ShowNetNodeTest); + + +void ShowNetNodeTest::setUp() { + m_node = new ShowNetNode(""); + m_hander_called = false; +} + + +/* + * clean up + */ +void ShowNetNodeTest::tearDown() { + delete m_node; +} + + +/* + * Called when there is new data + */ +void ShowNetNodeTest::UpdateData(unsigned int universe) { + m_hander_called = true; + (void) universe; +} + + +/* + * Test the packet handling code + */ +void ShowNetNodeTest::testHandlePacket() { + unsigned int universe = 0; + shownet_data_packet packet; + unsigned int header_size = sizeof(packet) - sizeof(packet.data); + const uint8_t ENCODED_DATA[] = {4, 1, 2, 4, 3}; + const uint8_t EXPECTED_DATA[] = {1, 2, 4, 3}; + DmxBuffer expected_dmx(EXPECTED_DATA, sizeof(EXPECTED_DATA)); + memset(&packet, 0, sizeof(packet)); + memcpy(packet.data, ENCODED_DATA, sizeof(ENCODED_DATA)); + DmxBuffer received_data; + + m_node->SetHandler(universe, + &received_data, + ola::NewClosure(this, &ShowNetNodeTest::UpdateData, + universe)); + + // short packets + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, 0)); + CPPUNIT_ASSERT(!m_hander_called); + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, 5)); + CPPUNIT_ASSERT(!m_hander_called); + + // invalid header + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, sizeof(packet))); + CPPUNIT_ASSERT(!m_hander_called); + + // add a header + packet.sigHi = ShowNetNode::SHOWNET_ID_HIGH; + packet.sigLo = ShowNetNode::SHOWNET_ID_LOW; + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, sizeof(packet))); + CPPUNIT_ASSERT(!m_hander_called); + + // add invalid indexBlocks + packet.indexBlock[0] = 4; + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, sizeof(packet))); + CPPUNIT_ASSERT(!m_hander_called); + + // invalid block length + packet.indexBlock[0] = ShowNetNode::MAGIC_INDEX_OFFSET; + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, sizeof(packet))); + CPPUNIT_ASSERT(!m_hander_called); + + // add a valid netslot + packet.netSlot[0] = 1; // universe 0 + CPPUNIT_ASSERT_EQUAL(false, m_node->HandlePacket(packet, sizeof(packet))); + CPPUNIT_ASSERT(!m_hander_called); + + // valid block length, but not enough data + packet.indexBlock[1] = ShowNetNode::MAGIC_INDEX_OFFSET; + CPPUNIT_ASSERT_EQUAL(false, + m_node->HandlePacket(packet, + header_size + sizeof(ENCODED_DATA))); + CPPUNIT_ASSERT(!m_hander_called); + + // now do a block length larger than the packet + packet.indexBlock[1] = 100 + ShowNetNode::MAGIC_INDEX_OFFSET; + CPPUNIT_ASSERT_EQUAL( + false, + m_node->HandlePacket(packet, header_size + sizeof(ENCODED_DATA))); + CPPUNIT_ASSERT(!m_hander_called); + + // test invalid slot size + packet.indexBlock[1] = (ShowNetNode::MAGIC_INDEX_OFFSET + + sizeof(ENCODED_DATA)); + + CPPUNIT_ASSERT_EQUAL( + false, + m_node->HandlePacket(packet, header_size + sizeof(ENCODED_DATA))); + CPPUNIT_ASSERT(!m_hander_called); + + // check a valid packet, but different universe + packet.netSlot[0] = 513; // universe 1 + packet.slotSize[0] = sizeof(EXPECTED_DATA); + CPPUNIT_ASSERT_EQUAL( + false, + m_node->HandlePacket(packet, header_size + sizeof(ENCODED_DATA))); + CPPUNIT_ASSERT(!m_hander_called); + + // now check with the correct universe + packet.netSlot[0] = 1; // universe 0 + CPPUNIT_ASSERT_EQUAL( + true, + m_node->HandlePacket(packet, header_size + sizeof(ENCODED_DATA))); + CPPUNIT_ASSERT(m_hander_called); + CPPUNIT_ASSERT_EQUAL( + 0, + memcmp(expected_dmx.GetRaw(), received_data.GetRaw(), + expected_dmx.Size())); +} + + +/* + * Check the packet construction code + */ +void ShowNetNodeTest::testPopulatePacket() { + const string NAME = "foobarbaz"; + const string DMX_DATA = "abc"; + + DmxBuffer buffer(DMX_DATA); + shownet_data_packet packet; + shownet_data_packet expected_packet; + memset(&expected_packet, 0, sizeof(expected_packet)); + unsigned int universe = 0; + unsigned int header_size = sizeof(packet) - sizeof(packet.data); + unsigned int encoded_data_size = sizeof(expected_packet.data); + ola::RunLengthEncoder encoder; + encoder.Encode(buffer, expected_packet.data, encoded_data_size); + + m_node->SetName(NAME); + unsigned int size = m_node->PopulatePacket(&packet, universe, buffer); + CPPUNIT_ASSERT_EQUAL(header_size + encoded_data_size, size); + + expected_packet.sigHi = ShowNetNode::SHOWNET_ID_HIGH; + expected_packet.sigLo = ShowNetNode::SHOWNET_ID_LOW; + + CPPUNIT_ASSERT_EQUAL(expected_packet.sigHi, packet.sigHi); + CPPUNIT_ASSERT_EQUAL(expected_packet.sigLo, packet.sigLo); + CPPUNIT_ASSERT(!memcmp(expected_packet.ip, packet.ip, sizeof(packet.ip))); + + expected_packet.netSlot[0] = 1; + expected_packet.slotSize[0] = DMX_DATA.length(); + expected_packet.indexBlock[0] = ShowNetNode::MAGIC_INDEX_OFFSET; + expected_packet.indexBlock[1] = (encoded_data_size + + ShowNetNode::MAGIC_INDEX_OFFSET); + + CPPUNIT_ASSERT(!memcmp(expected_packet.netSlot, + packet.netSlot, + sizeof(packet.netSlot))); + CPPUNIT_ASSERT(!memcmp(expected_packet.slotSize, + packet.slotSize, + sizeof(packet.slotSize))); + CPPUNIT_ASSERT(!memcmp(expected_packet.indexBlock, + packet.indexBlock, + sizeof(packet.indexBlock))); + + CPPUNIT_ASSERT_EQUAL(expected_packet.packetCountHi, packet.packetCountHi); + CPPUNIT_ASSERT_EQUAL(expected_packet.packetCountLo, packet.packetCountLo); + + CPPUNIT_ASSERT(!memcmp(expected_packet.block, + packet.block, + sizeof(packet.block))); + memcpy(expected_packet.name, NAME.data(), sizeof(expected_packet.name)); + CPPUNIT_ASSERT(!memcmp(expected_packet.name, + packet.name, + sizeof(packet.name))); + + CPPUNIT_ASSERT(!memcmp(expected_packet.data, + packet.data, + encoded_data_size)); + CPPUNIT_ASSERT(!memcmp(&expected_packet, &packet, size)); + + // now send for a different universe + universe = 1; + size = m_node->PopulatePacket(&packet, universe, buffer); + expected_packet.netSlot[0] = 513; + CPPUNIT_ASSERT(!memcmp(&expected_packet, &packet, size)); +} + + +/* + * Check that we can decode the packets we send. + */ +void ShowNetNodeTest::testSendAndReceive() { + SendAndReceiveForUniverse(0); + SendAndReceiveForUniverse(1); + SendAndReceiveForUniverse(2); +} + + +/* + * Send and receive some packets on this universe. + */ +void ShowNetNodeTest::SendAndReceiveForUniverse(unsigned int universe) { + const uint8_t TEST_DATA[] = {1, 2, 2, 3, 0, 0, 0, 1, 3, 3, 3, 1, 2}; + const uint8_t TEST_DATA2[] = {0, 0, 0, 0, 6, 5, 4, 3, 3, 3}; + + DmxBuffer zero_buffer; + zero_buffer.Blackout(); + DmxBuffer buffer1(TEST_DATA, sizeof(TEST_DATA)); + DmxBuffer buffer2(TEST_DATA2, sizeof(TEST_DATA2)); + unsigned int size; + shownet_data_packet packet; + DmxBuffer received_data; + + m_node->SetHandler( + universe, + &received_data, + ola::NewClosure(this, &ShowNetNodeTest::UpdateData, universe)); + + // zero first + size = m_node->PopulatePacket(&packet, universe, zero_buffer); + m_node->HandlePacket(packet, size); + CPPUNIT_ASSERT(received_data == zero_buffer); + + // send a test packet + size = m_node->PopulatePacket(&packet, universe, buffer1); + m_node->HandlePacket(packet, size); + CPPUNIT_ASSERT_EQUAL( + 0, + memcmp(buffer1.GetRaw(), received_data.GetRaw(), buffer1.Size())); + + // send another test packet + size = m_node->PopulatePacket(&packet, universe, buffer2); + m_node->HandlePacket(packet, size); + CPPUNIT_ASSERT_EQUAL( + 0, + memcmp(buffer2.GetRaw(), received_data.GetRaw(), buffer2.Size())); + + // check that we don't mix up universes + size = m_node->PopulatePacket(&packet, universe + 1, buffer1); + m_node->HandlePacket(packet, size); + CPPUNIT_ASSERT_EQUAL( + 0, + memcmp(buffer2.GetRaw(), received_data.GetRaw(), buffer2.Size())); +} +} // shownet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPackets.h b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPackets.h new file mode 100644 index 0000000..c51364c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPackets.h @@ -0,0 +1,46 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ShowNetPackets.h + * Datagram definitions for libshownet + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SHOWNET_SHOWNETPACKETS_H_ +#define PLUGINS_SHOWNET_SHOWNETPACKETS_H_ + +#include "ola/BaseTypes.h" + +enum { SHOWNET_MAC_LENGTH = 6 }; +enum { SHOWNET_NAME_LENGTH = 9 }; + +struct shownet_data_s { + uint8_t sigHi; // 0x80 + uint8_t sigLo; // 0x8f + uint8_t ip[4]; // ip of sender + uint16_t netSlot[4]; // start channel of each slot + uint16_t slotSize[4]; // size of each slot + uint16_t indexBlock[5]; // index into data of each slot + uint8_t packetCountHi; // sequence number + uint8_t packetCountLo; // sequence number + uint8_t block[4]; // the last 2 items here have something to do with + // the channels that have passwords are. + uint8_t name[SHOWNET_NAME_LENGTH]; // name of console + uint8_t data[DMX_UNIVERSE_SIZE]; // data +} __attribute__((packed)); + +typedef struct shownet_data_s shownet_data_packet; + +#endif // PLUGINS_SHOWNET_SHOWNETPACKETS_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.cpp new file mode 100644 index 0000000..7288a35 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.cpp @@ -0,0 +1,126 @@ +/* + * 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 Library 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. + * + * ShowNetPlugin.cpp + * The ShowNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/shownet/ShowNetDevice.h" +#include "plugins/shownet/ShowNetPlugin.h" + + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create(const ola::PluginAdaptor *adaptor) { + return new ola::plugin::shownet::ShowNetPlugin(adaptor); +} + + +namespace ola { +namespace plugin { +namespace shownet { + + +const char ShowNetPlugin::SHOWNET_NODE_NAME[] = "ola-ShowNet"; +const char ShowNetPlugin::PLUGIN_NAME[] = "ShowNet"; +const char ShowNetPlugin::PLUGIN_PREFIX[] = "shownet"; +const char ShowNetPlugin::SHOWNET_NAME_KEY[] = "name"; + +/* + * Start the plugin + */ +bool ShowNetPlugin::StartHook() { + m_device = new ShowNetDevice(this, m_preferences, m_plugin_adaptor); + + if (!m_device->Start()) { + delete m_device; + return false; + } + + m_plugin_adaptor->RegisterDevice(m_device); + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool ShowNetPlugin::StopHook() { + if (m_device) { + m_plugin_adaptor->UnregisterDevice(m_device); + bool ret = m_device->Stop(); + delete m_device; + return ret; + } + return true; +} + + +/* + * return the description for this plugin + * + */ +string ShowNetPlugin::Description() const { + return +"Strand ShowNet Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates a single device with 8 input and 8 output ports.\n" +"\n" +"The ports correspond to the DMX channels used in the shownet protocol.\n" +"For example the first input and output port 0 is channels 1 - 512 and\n" +"the second input and output ports are channels 513 - 1024.\n" +"\n" +"--- Config file : ola-shownet.conf ---\n" +"\n" +"ip = a.b.c.d\n" +"The ip address to bind to. If not specified it will use the first " +"non-loopback ip.\n" +"\n" +"name = ola-ShowNet\n" +"The name of the node.\n"; +} + + +/* + * Set default preferences + */ +bool ShowNetPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + + save |= m_preferences->SetDefaultValue(ShowNetDevice::IP_KEY, + IPv4Validator(), ""); + save |= m_preferences->SetDefaultValue(SHOWNET_NAME_KEY, StringValidator(), + SHOWNET_NODE_NAME); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue(SHOWNET_NAME_KEY).empty()) + return false; + return true; +} +} // shownet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.h new file mode 100644 index 0000000..ed32203 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPlugin.h @@ -0,0 +1,64 @@ +/* + * 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 Library 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. + * + * ShowNetPlugin.h + * Interface for the ShowNet plugin class + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SHOWNET_SHOWNETPLUGIN_H_ +#define PLUGINS_SHOWNET_SHOWNETPLUGIN_H_ + +#include +#include "olad/Plugin.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace shownet { + +using ola::Plugin; +using ola::PluginAdaptor; +using std::string; + +class ShowNetDevice; + +class ShowNetPlugin: public Plugin { + public: + explicit ShowNetPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_device(NULL) {} + ~ShowNetPlugin() {} + + string Name() const { return PLUGIN_NAME; } + ola_plugin_id Id() const { return OLA_PLUGIN_SHOWNET; } + string Description() const; + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + + ShowNetDevice *m_device; + static const char SHOWNET_NODE_NAME[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char SHOWNET_NAME_KEY[]; +}; +} // shownet +} // plugin +} // ola +#endif // PLUGINS_SHOWNET_SHOWNETPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.cpp new file mode 100644 index 0000000..c1d38e8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.cpp @@ -0,0 +1,107 @@ +/* + * 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 Library 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. + * + * ShowNetPort.cpp + * The ShowNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "plugins/shownet/ShowNetDevice.h" +#include "plugins/shownet/ShowNetPort.h" + +namespace ola { +namespace plugin { +namespace shownet { + +string ShowNetInputPort::Description() const { + std::stringstream str; + str << "ShowNet " << PortId() * DMX_UNIVERSE_SIZE + 1 << "-" << + (PortId() + 1) * DMX_UNIVERSE_SIZE; + return str.str(); +} + + +/* + * Check for loops. + */ +bool ShowNetInputPort::PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + AbstractDevice *device = GetDevice(); + OutputPort *output_port = device->GetOutputPort(PortId()); + if (output_port && output_port->GetUniverse()) { + OLA_WARN << "Avoiding possible shownet loop on " << Description(); + return false; + } + return true; +} + + +/* + * We intecept this to setup/remove the dmx handler + */ +void ShowNetInputPort::PostSetUniverse(Universe *old_universe, + Universe *new_universe) { + if (old_universe) + m_node->RemoveHandler(PortId()); + + if (new_universe) + m_node->SetHandler( + PortId(), + &m_buffer, + ola::NewClosure(this, + &ShowNetInputPort::DmxChanged)); +} + + +string ShowNetOutputPort::Description() const { + std::stringstream str; + str << "ShowNet " << PortId() * DMX_UNIVERSE_SIZE + 1 << "-" << + (PortId() + 1) * DMX_UNIVERSE_SIZE; + return str.str(); +} + + +/* + * Check for loops. + */ +bool ShowNetOutputPort::PreSetUniverse(Universe *old_universe, + Universe *new_universe) { + (void) old_universe; + (void) new_universe; + AbstractDevice *device = GetDevice(); + InputPort *input_port = device->GetInputPort(PortId()); + if (input_port && input_port->GetUniverse()) { + OLA_WARN << "Avoiding possible shownet loop on " << Description(); + return false; + } + return true; +} + + +bool ShowNetOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + return !m_node->SendDMX(PortId(), buffer); + (void) priority; +} +} // shownet +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.h b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.h new file mode 100644 index 0000000..cff65fa --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetPort.h @@ -0,0 +1,75 @@ +/* + * 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 Library 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. + * + * ShowNetPort.h + * The ShowNet plugin for ola + * Copyright (C) 2005-2009 Simon Newton + */ + +#ifndef PLUGINS_SHOWNET_SHOWNETPORT_H_ +#define PLUGINS_SHOWNET_SHOWNETPORT_H_ + +#include +#include "olad/Port.h" +#include "plugins/shownet/ShowNetDevice.h" +#include "plugins/shownet/ShowNetNode.h" + +namespace ola { +namespace plugin { +namespace shownet { + +using ola::DmxBuffer; + +class ShowNetInputPort: public BasicInputPort { + public: + ShowNetInputPort(ShowNetDevice *parent, + unsigned int id, + const TimeStamp *wake_time, + ShowNetNode *node): + BasicInputPort(parent, id, wake_time), + m_node(node) {} + ~ShowNetInputPort() {} + + string Description() const; + const DmxBuffer &ReadDMX() const { return m_buffer; } + bool PreSetUniverse(Universe *old_universe, Universe *new_universe); + void PostSetUniverse(Universe *old_universe, Universe *new_universe); + + private : + DmxBuffer m_buffer; + ShowNetNode *m_node; +}; + + +class ShowNetOutputPort: public BasicOutputPort { + public: + ShowNetOutputPort(ShowNetDevice *parent, + unsigned int id, + ShowNetNode *node): + BasicOutputPort(parent, id), + m_node(node) {} + ~ShowNetOutputPort() {} + + bool PreSetUniverse(Universe *old_universe, Universe *new_universe); + string Description() const; + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + + private: + ShowNetNode *m_node; +}; +} // shownet +} // plugin +} // ola +#endif // PLUGINS_SHOWNET_SHOWNETPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetTester.cpp b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetTester.cpp new file mode 100644 index 0000000..7ed56a8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/shownet/ShowNetTester.cpp @@ -0,0 +1,35 @@ +/* + * 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 Library 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. + * + * ShowNetTester.cpp + * Runs all the ShowNet tests + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include + +int main(int argc, char* argv[]) { + CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); + CppUnit::TextUi::TestRunner runner; + runner.addTest(suite); + runner.setOutputter( + new CppUnit::CompilerOutputter(&runner.result(), std::cerr)); + bool wasSucessful = runner.run(); + return wasSucessful ? 0 : 1; + (void) argc; + (void) argv; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.am new file mode 100644 index 0000000..2f39e00 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.am @@ -0,0 +1,12 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) + +EXTRA_DIST = StageProfiPlugin.h StageProfiDevice.h StageProfiPort.h \ + StageProfiWidget.h StageProfiWidgetLan.h StageProfiWidgetUsb.h + +lib_LTLIBRARIES = libolastageprofi.la +libolastageprofi_la_SOURCES = StageProfiPlugin.cpp StageProfiDevice.cpp \ + StageProfiPort.cpp StageProfiWidget.cpp \ + StageProfiWidgetLan.cpp StageProfiWidgetUsb.cpp + diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.in new file mode 100644 index 0000000..436d815 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/Makefile.in @@ -0,0 +1,504 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/stageprofi +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolastageprofi_la_LIBADD = +am_libolastageprofi_la_OBJECTS = StageProfiPlugin.lo \ + StageProfiDevice.lo StageProfiPort.lo StageProfiWidget.lo \ + StageProfiWidgetLan.lo StageProfiWidgetUsb.lo +libolastageprofi_la_OBJECTS = $(am_libolastageprofi_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolastageprofi_la_SOURCES) +DIST_SOURCES = $(libolastageprofi_la_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = StageProfiPlugin.h StageProfiDevice.h StageProfiPort.h \ + StageProfiWidget.h StageProfiWidgetLan.h StageProfiWidgetUsb.h + +lib_LTLIBRARIES = libolastageprofi.la +libolastageprofi_la_SOURCES = StageProfiPlugin.cpp StageProfiDevice.cpp \ + StageProfiPort.cpp StageProfiWidget.cpp \ + StageProfiWidgetLan.cpp StageProfiWidgetUsb.cpp + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/stageprofi/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/stageprofi/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolastageprofi.la: $(libolastageprofi_la_OBJECTS) $(libolastageprofi_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolastageprofi_la_OBJECTS) $(libolastageprofi_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiWidget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiWidgetLan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StageProfiWidgetUsb.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.cpp new file mode 100644 index 0000000..e364f8c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.cpp @@ -0,0 +1,111 @@ +/* + * 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 Library 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. + * + * StageProfiDevice.cpp + * StageProfi device + * Copyright (C) 2006-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/Preferences.h" +#include "olad/Universe.h" +#include "plugins/stageprofi/StageProfiDevice.h" +#include "plugins/stageprofi/StageProfiPort.h" +#include "plugins/stageprofi/StageProfiWidgetLan.h" +#include "plugins/stageprofi/StageProfiWidgetUsb.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +using ola::AbstractPlugin; + +/* + * Create a new device + * + * @param owner the plugin that owns this device + * @param name the device name + * @param dev_path path to the pro widget + */ +StageProfiDevice::StageProfiDevice(AbstractPlugin *owner, + const string &name, + const string &dev_path): + Device(owner, name), + m_path(dev_path), + m_widget(NULL) { + if (dev_path.at(0) == '/') { + m_widget = new StageProfiWidgetUsb(); + } else { + m_widget = new StageProfiWidgetLan(); + } +} + + +/* + * Destroy this device + */ +StageProfiDevice::~StageProfiDevice() { + if (m_widget) + delete m_widget; +} + + +/* + * Start this device + */ +bool StageProfiDevice::StartHook() { + if (!m_widget) + return false; + + if (!m_widget->Connect(m_path)) { + OLA_WARN << "StageProfiPlugin: failed to connect to " << m_path; + return false; + } + + if (!m_widget->DetectDevice()) { + OLA_WARN << "StageProfiPlugin: no device found at " << m_path; + return false; + } + + StageProfiOutputPort *port = new StageProfiOutputPort(this, 0, m_widget); + AddPort(port); + return true; +} + + +/* + * Stop this device + */ +void StageProfiDevice::PrePortStop() { + // disconnect from widget + m_widget->Disconnect(); +} + + +/* + * return the sd for this device + */ +ConnectedSocket *StageProfiDevice::GetSocket() const { + return m_widget->GetSocket(); +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.h new file mode 100644 index 0000000..a3bb3cf --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiDevice.h @@ -0,0 +1,62 @@ +/* + * 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 Library 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. + * + * StageProfiDevice.h + * Interface for the stageprofi device + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIDEVICE_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIDEVICE_H_ + +#include +#include "ola/DmxBuffer.h" +#include "ola/network/Socket.h" +#include "olad/Device.h" + +namespace ola { + +class AbstractPlugin; + +namespace plugin { +namespace stageprofi { + +using ola::Device; +using ola::network::Socket; + +class StageProfiDevice: public Device { + public: + StageProfiDevice(AbstractPlugin *owner, + const string &name, + const string &dev_path); + ~StageProfiDevice(); + + // I don't think this get us full stickiness because USB devices may + // appear as different devices. + string DeviceId() const { return m_path; } + ola::network::ConnectedSocket *GetSocket() const; + + protected: + bool StartHook(); + void PrePortStop(); + + private: + string m_path; + class StageProfiWidget *m_widget; +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.cpp new file mode 100644 index 0000000..54b900c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.cpp @@ -0,0 +1,173 @@ +/* + * 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 Library 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. + * + * StageProfiPlugin.cpp + * The StageProfi plugin for ola + * Copyright (C) 2006-2008 Simon Newton + */ + +#include +#include +#include +#include + +#include "ola/Logging.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "plugins/stageprofi/StageProfiDevice.h" +#include "plugins/stageprofi/StageProfiPlugin.h" + +/* + * Entry point to this plugin + */ +extern "C" ola::AbstractPlugin* create( + const ola::PluginAdaptor *plugin_adaptor) { + return new ola::plugin::stageprofi::StageProfiPlugin(plugin_adaptor); +} + + +namespace ola { +namespace plugin { +namespace stageprofi { + +using std::string; + +const char StageProfiPlugin::STAGEPROFI_DEVICE_PATH[] = "/dev/ttyUSB0"; +const char StageProfiPlugin::STAGEPROFI_DEVICE_NAME[] = "StageProfi Device"; +const char StageProfiPlugin::PLUGIN_NAME[] = "StageProfi"; +const char StageProfiPlugin::PLUGIN_PREFIX[] = "stageprofi"; +const char StageProfiPlugin::DEVICE_KEY[] = "device"; + +/* + * Start the plugin + * + * Multiple devices now supported + */ +bool StageProfiPlugin::StartHook() { + vector device_names; + vector::iterator it; + StageProfiDevice *device; + + // fetch device listing + device_names = m_preferences->GetMultipleValue(DEVICE_KEY); + + for (it = device_names.begin(); it != device_names.end(); ++it) { + if (it->empty()) + continue; + + device = new StageProfiDevice(this, STAGEPROFI_DEVICE_NAME, *it); + + if (!device->Start()) { + delete device; + continue; + } + + m_plugin_adaptor->AddSocket(device->GetSocket()); + m_plugin_adaptor->RegisterDevice(device); + m_devices.insert(m_devices.end(), device); + } + return true; +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool StageProfiPlugin::StopHook() { + vector::iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) { + m_plugin_adaptor->RemoveSocket((*iter)->GetSocket()); + DeleteDevice(*iter); + } + m_devices.clear(); + return true; +} + + +/* + * Return the description for this plugin + */ +string StageProfiPlugin::Description() const { + return +"StageProfi Plugin\n" +"----------------------------\n" +"\n" +"This plugin creates devices with one output port.\n" +"\n" +"--- Config file : ola-stageprofi.conf ---\n" +"\n" +"device = /dev/ttyUSB0\n" +"device = 192.168.1.250\n" +"The device to use either as a path for the USB version or an IP address\n" +"for the LAN version. Multiple devices are supported.\n"; +} + + +/* + * Called when the file descriptor is closed. + */ +int StageProfiPlugin::SocketClosed(ConnectedSocket *socket) { + vector::iterator iter; + + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) { + if ((*iter)->GetSocket() == socket) + break; + } + + if (iter == m_devices.end()) { + OLA_WARN << "unknown fd"; + return -1; + } + + DeleteDevice(*iter); + m_devices.erase(iter); + return 0; +} + + +/* + * load the plugin prefs and default to sensible values + * + */ +bool StageProfiPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + + save |= m_preferences->SetDefaultValue(DEVICE_KEY, StringValidator(), + STAGEPROFI_DEVICE_PATH); + + if (save) + m_preferences->Save(); + + if (m_preferences->GetValue(DEVICE_KEY).empty()) + return false; + return true; +} + + +/* + * Cleanup a single device + */ +void StageProfiPlugin::DeleteDevice(StageProfiDevice *device) { + m_plugin_adaptor->UnregisterDevice(device); + device->Stop(); + delete device; +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.h new file mode 100644 index 0000000..f594cf7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPlugin.h @@ -0,0 +1,68 @@ +/* + * 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 Library 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. + * + * StageProfiPlugin.h + * Interface for the stageprofi plugin class + * Copyright (C) 2006-2008 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_ + +#include +#include +#include "olad/Plugin.h" +#include "ola/network/Socket.h" +#include "ola/plugin_id.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +using ola::network::ConnectedSocket; +using std::string; + +class StageProfiDevice; + +class StageProfiPlugin: public Plugin { + public: + explicit StageProfiPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor) {} + ~StageProfiPlugin() {} + + string Name() const { return PLUGIN_NAME; } + ola_plugin_id Id() const { return OLA_PLUGIN_STAGEPROFI; } + string Description() const; + int SocketClosed(ConnectedSocket *socket); + string PluginPrefix() const { return PLUGIN_PREFIX; } + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + void DeleteDevice(StageProfiDevice *device); + + vector m_devices; // list of our devices + + static const char STAGEPROFI_DEVICE_PATH[]; + static const char STAGEPROFI_DEVICE_NAME[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char DEVICE_KEY[]; +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.cpp new file mode 100644 index 0000000..844d299 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.cpp @@ -0,0 +1,41 @@ +/* + * 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 Library 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. + * + * StageProfiPort.cpp + * The StageProfi plugin for ola + * Copyright (C) 2006-2009 Simon Newton + */ + +#include +#include "plugins/stageprofi/StageProfiPort.h" +#include "plugins/stageprofi/StageProfiDevice.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +/* + * Write operation + * @param the buffer to write + * @return true on success, false on failure + */ +bool StageProfiOutputPort::WriteDMX(const DmxBuffer &buffer, + uint8_t priority) { + return m_widget->SendDmx(buffer); + (void) priority; +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.h new file mode 100644 index 0000000..3ac9684 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiPort.h @@ -0,0 +1,51 @@ +/* + * 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 Library 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. + * + * StageProfiPort.h + * The StageProfi plugin for ola + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIPORT_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIPORT_H_ + +#include +#include "ola/DmxBuffer.h" +#include "olad/Port.h" +#include "plugins/stageprofi/StageProfiDevice.h" +#include "plugins/stageprofi/StageProfiWidget.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +class StageProfiOutputPort: public BasicOutputPort { + public: + StageProfiOutputPort(StageProfiDevice *parent, + unsigned int id, + StageProfiWidget *widget) + : BasicOutputPort(parent, id), + m_widget(widget) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return ""; } + + private: + StageProfiWidget *m_widget; +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.cpp new file mode 100644 index 0000000..0174401 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.cpp @@ -0,0 +1,177 @@ +/* + * 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 Library 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. + * + * StageprofiWidget.cpp + * This is the base widget class + * Copyright (C) 2006-2009 Simon Newton + */ + +#include +#include +#include "ola/Closure.h" +#include "plugins/stageprofi/StageProfiWidget.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + + +enum stageprofi_packet_type_e { + ID_GETDMX = 0xFE, + ID_SETDMX = 0xFF, + ID_SETLO = 0xE0, + ID_SETHI = 0xE1, +}; + +typedef enum stageprofi_packet_type_e stageprofi_packet_type; + + +/* + * New widget + */ +StageProfiWidget::~StageProfiWidget() { + if (m_socket) { + m_socket->Close(); + delete m_socket; + } +} + + +/* + * Disconnect from the widget + */ +int StageProfiWidget::Disconnect() { + m_socket->Close(); + return 0; +} + + +/* + * Send a dmx msg. + * This has the nasty property of blocking if we remove the device + * TODO: fix this + */ +bool StageProfiWidget::SendDmx(const DmxBuffer &buffer) const { + unsigned int index = 0; + while (index < buffer.Size()) { + unsigned int size = std::min((unsigned int) DMX_MSG_LEN, + buffer.Size() - index); + Send255(index, buffer.GetRaw() + index, size); + index += size; + } + return true; +} + + +/* + * Called when there is adata to read + */ +void StageProfiWidget::SocketReady() { + while (m_socket->DataRemaining() > 0) { + DoRecv(); + } +} + + +void StageProfiWidget::Timeout() { + if (m_ss) + m_ss->Terminate(); +} + +/* + * Check if this is actually a StageProfi device + * @return true if this is a stageprofi, false otherwise + */ +bool StageProfiWidget::DetectDevice() { + if (m_ss) + delete m_ss; + + m_got_response = false; + m_ss = new SelectServer(); + m_ss->AddSocket(m_socket, NULL); + m_ss->RegisterSingleTimeout( + 100, + ola::NewSingleClosure(this, &StageProfiWidget::Timeout)); + + // try a command, we should get a response + SetChannel(0, 0); + + m_ss->Run(); + delete m_ss; + m_ss = NULL; + if (m_got_response) + return true; + + m_socket->Close(); + return false; +} + + +//----------------------------------------------------------------------------- +// Private methods used for communicating with the widget + +/* + * Set a single channel + */ +int StageProfiWidget::SetChannel(unsigned int chan, uint8_t val) const { + uint8_t msg[3]; + + msg[0] = chan > DMX_MSG_LEN ? ID_SETHI : ID_SETLO; + msg[1] = chan & 0xFF; + msg[2] = val; + return m_socket->Send(msg, sizeof(msg)); +} + + +/* + * Send 255 channels worth of data + * @param start the start channel for the data + * @param buf a pointer to the data + * @param len the length of the data + */ +int StageProfiWidget::Send255(unsigned int start, const uint8_t *buf, + unsigned int length) const { + uint8_t msg[DMX_MSG_LEN + DMX_HEADER_SIZE]; + unsigned int len = std::min((unsigned int) DMX_MSG_LEN, length); + + msg[0] = ID_SETDMX; + msg[1] = start & 0xFF; + msg[2] = (start>>8) & 0xFF; + msg[3] = len; + memcpy(msg + DMX_HEADER_SIZE, buf, len); + return m_socket->Send(msg, len + DMX_HEADER_SIZE); +} + + +/* + * + */ +int StageProfiWidget::DoRecv() { + uint8_t byte = 0x00; + unsigned int data_read; + + while (byte != 'G') { + int ret = m_socket->Receive(&byte, 1, data_read); + + if (ret == -1 || data_read != 1) { + return -1; + } + } + m_got_response = true; + return 0; +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.h new file mode 100644 index 0000000..8d2aad4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidget.h @@ -0,0 +1,73 @@ +/* + * 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 Library 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. + * + * stageprofidevice.h + * Interface for the stageprofi device + * Copyright (C) 2006-2007 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIWIDGET_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIWIDGET_H_ + +#include +#include "ola/network/Socket.h" +#include "ola/network/SelectServer.h" +#include "ola/DmxBuffer.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +using ola::network::ConnectedSocket; +using ola::network::SelectServer; + +class StageProfiWidget { + public: + StageProfiWidget(): + m_enabled(false), + m_got_response(false), + m_socket(NULL), + m_ss(NULL) {} + virtual ~StageProfiWidget(); + + // these methods are for communicating with the device + virtual bool Connect(const string &path) = 0; + int Disconnect(); + ConnectedSocket *GetSocket() { return m_socket; } + bool SendDmx(const DmxBuffer &buffer) const; + bool DetectDevice(); + void SocketReady(); + void Timeout(); + + protected: + int Send255(unsigned int start, const uint8_t *buf, unsigned int len) const; + int SetChannel(unsigned int chan, uint8_t val) const; + + // instance variables + bool m_enabled; + bool m_got_response; + ConnectedSocket *m_socket; + SelectServer *m_ss; + + enum { DMX_MSG_LEN = 255 }; + enum { DMX_HEADER_SIZE = 4}; + + private: + int DoRecv(); +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIWIDGET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.cpp new file mode 100644 index 0000000..1249470 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.cpp @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * StageProfiWidgetLan.cpp + * StageProfi Lan Widget + * Copyright (C) 2006-2009 Simon Newton + * + * The StageProfi LAN Widget. + */ + +#include +#include "ola/Closure.h" +#include "ola/network/Socket.h" +#include "plugins/stageprofi/StageProfiWidgetLan.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +using ola::network::TcpSocket; + +/* + * Connect to the widget + * @returns true on success, false on failure + */ +bool StageProfiWidgetLan::Connect(const std::string &ip) { + m_socket = TcpSocket::Connect(ip, STAGEPROFI_PORT); + + if (m_socket) + m_socket->SetOnData( + NewClosure(this, + &StageProfiWidget::SocketReady)); + return m_socket; +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.h new file mode 100644 index 0000000..ae660be --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetLan.h @@ -0,0 +1,43 @@ +/* + * 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 Library 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. + * + * StageProfiWidgetLan.h + * Interface for the StageProfi LAN device + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIWIDGETLAN_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIWIDGETLAN_H_ + +#include +#include "plugins/stageprofi/StageProfiWidget.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +class StageProfiWidgetLan: public StageProfiWidget { + public: + StageProfiWidgetLan(): StageProfiWidget() {} + ~StageProfiWidgetLan() {} + + bool Connect(const std::string &ip); + private: + static const uint16_t STAGEPROFI_PORT = 10001; +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIWIDGETLAN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.cpp b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.cpp new file mode 100644 index 0000000..d543d49 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.cpp @@ -0,0 +1,57 @@ +/* + * 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 Library 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. + * + * StageProfiWidgetUsb.cpp + * The StageProfi Usb Widget. + * Copyright (C) 2006-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "ola/Closure.h" +#include "ola/network/Socket.h" +#include "plugins/stageprofi/StageProfiWidgetUsb.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +/* + * Connect to the widget + */ +bool StageProfiWidgetUsb::Connect(const std::string &path) { + struct termios newtio; + + int fd = open(path.data(), O_RDWR | O_NONBLOCK | O_NOCTTY); + + if (fd == -1) + return false; + + memset(&newtio, 0, sizeof(newtio)); // clear struct for new port settings + tcgetattr(fd, &newtio); + cfsetospeed(&newtio, B38400); + tcsetattr(fd, TCSANOW, &newtio); + m_socket = new ola::network::DeviceSocket(fd); + m_socket->SetOnData( + NewClosure(this, &StageProfiWidget::SocketReady)); + return true; +} +} // stageprofi +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.h b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.h new file mode 100644 index 0000000..693f494 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/stageprofi/StageProfiWidgetUsb.h @@ -0,0 +1,41 @@ +/* + * 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 Library 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. + * + * StageProfiWidgetUsb.h + * Interface for the StageProfi USB device + * Copyright (C) 2006-2009 Simon Newton + */ + +#ifndef PLUGINS_STAGEPROFI_STAGEPROFIWIDGETUSB_H_ +#define PLUGINS_STAGEPROFI_STAGEPROFIWIDGETUSB_H_ + +#include +#include "plugins/stageprofi/StageProfiWidget.h" + +namespace ola { +namespace plugin { +namespace stageprofi { + +class StageProfiWidgetUsb: public StageProfiWidget { + public: + StageProfiWidgetUsb(): StageProfiWidget() {} + ~StageProfiWidgetUsb() {} + + bool Connect(const std::string &ip); +}; +} // stageprofi +} // plugin +} // ola +#endif // PLUGINS_STAGEPROFI_STAGEPROFIWIDGETUSB_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.cpp new file mode 100644 index 0000000..311a162 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.cpp @@ -0,0 +1,60 @@ +/* + * This dmxgram 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * AnymaDevice.cpp + * The Anyma usb driver + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/AnymaDevice.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + + +/* + * Start this device. + */ +bool AnymaDevice::StartHook() { + m_output_port = new AnymaOutputPort(this, 0, m_usb_device); + if (!m_output_port->Start()) { + delete m_output_port; + m_output_port = NULL; + return false; + } + AddPort(m_output_port); + return true; +} + + +/* + * Get the device id + */ +string AnymaDevice::DeviceId() const { + if (m_output_port) { + return "anyma-" + m_output_port->SerialNumber(); + } else { + return ""; + } +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.h new file mode 100644 index 0000000..909c9fe --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaDevice.h @@ -0,0 +1,55 @@ +/* + * 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * AnymaDevice.h + * Interface for the Anyma device + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_ANYMADEVICE_H_ +#define PLUGINS_USBDMX_ANYMADEVICE_H_ + +#include +#include +#include "plugins/usbdmx/UsbDevice.h" +#include "plugins/usbdmx/AnymaOutputPort.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +/* + * A Anyma device + */ +class AnymaDevice: public UsbDevice { + public: + AnymaDevice(ola::AbstractPlugin *owner, + libusb_device *usb_device): + UsbDevice(owner, "Anyma USB Device", usb_device), + m_output_port(NULL) { + } + + string DeviceId() const; + + protected: + bool StartHook(); + + private: + AnymaOutputPort *m_output_port; +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_ANYMADEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.cpp new file mode 100644 index 0000000..145d2f9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.cpp @@ -0,0 +1,238 @@ +/* + * 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 Library 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. + * + * AnymaOutputPort.cpp + * Thread for the Anyma Output Port + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/AnymaOutputPort.h" +#include "plugins/usbdmx/AnymaDevice.h" + + +namespace ola { +namespace plugin { +namespace usbdmx { + +using std::string; + + +const char AnymaOutputPort::EXPECTED_MANUFACTURER[] = "www.anyma.ch"; +const char AnymaOutputPort::EXPECTED_PRODUCT[] = "uDMX"; + +/* + * Create a new AnymaOutputPort object + */ +AnymaOutputPort::AnymaOutputPort(AnymaDevice *parent, + unsigned int id, + libusb_device *usb_device) + : BasicOutputPort(parent, id), + m_term(false), + m_serial(""), + m_usb_device(usb_device), + m_usb_handle(NULL) { + pthread_mutex_init(&m_data_mutex, NULL); + pthread_mutex_init(&m_term_mutex, NULL); +} + + +/* + * Cleanup + */ +AnymaOutputPort::~AnymaOutputPort() { + pthread_mutex_lock(&m_term_mutex); + m_term = true; + pthread_mutex_unlock(&m_term_mutex); + Join(); + + pthread_mutex_destroy(&m_term_mutex); + pthread_mutex_destroy(&m_data_mutex); +} + + +/* + * Start this thread + */ +bool AnymaOutputPort::Start() { + libusb_device_handle *usb_handle; + struct libusb_device_descriptor device_descriptor; + libusb_get_device_descriptor(m_usb_device, &device_descriptor); + + if (libusb_open(m_usb_device, &usb_handle)) { + OLA_WARN << "Failed to open Anyma usb device"; + return false; + } + + // this device only has one configuration + /* + if (libusb_set_configuration(usb_handle, CONFIGURATION)) { + OLA_WARN << "Anyma set config failed"; + libusb_close(usb_handle); + return false; + } +*/ + string data; + if (!GetDescriptorString(usb_handle, device_descriptor.iManufacturer, + &data)) { + OLA_INFO << "Failed to get manufactuer name"; + libusb_close(usb_handle); + return false; + } + + if (data != EXPECTED_MANUFACTURER) { + OLA_INFO << "Manufacturer mismatch: " << EXPECTED_MANUFACTURER << " != " << + data; + libusb_close(usb_handle); + return false; + } + + if (!GetDescriptorString(usb_handle, device_descriptor.iProduct, &data)) { + OLA_INFO << "Failed to get product name"; + libusb_close(usb_handle); + return false; + } + + if (data != EXPECTED_PRODUCT) { + OLA_INFO << "Product mismatch: " << EXPECTED_PRODUCT << " != " << data; + libusb_close(usb_handle); + return false; + } + + if (!GetDescriptorString(usb_handle, device_descriptor.iSerialNumber, + &data)) { + OLA_INFO << "Failed to get serial number"; + libusb_close(usb_handle); + return false; + } + + m_serial = data; + + if (libusb_claim_interface(usb_handle, 0)) { + OLA_WARN << "Failed to claim Anyma usb device"; + libusb_close(usb_handle); + return false; + } + + m_usb_handle = usb_handle; + bool ret = OlaThread::Start(); + if (!ret) { + OLA_WARN << "pthread create failed"; + libusb_release_interface(m_usb_handle, 0); + libusb_close(usb_handle); + return false; + } + return true; +} + + +/* + * Run this thread + */ +void *AnymaOutputPort::Run() { + DmxBuffer buffer; + if (!m_usb_handle) + return NULL; + + while (1) { + pthread_mutex_lock(&m_term_mutex); + if (m_term) { + pthread_mutex_unlock(&m_term_mutex); + break; + } + pthread_mutex_unlock(&m_term_mutex); + + pthread_mutex_lock(&m_data_mutex); + buffer.Set(m_buffer); + pthread_mutex_unlock(&m_data_mutex); + + if (buffer.Size()) { + if (!SendDMX(buffer)) { + OLA_WARN << "Send failed, stopping thread..."; + break; + } + } else { + // sleep for a bit + usleep(40000); + } + } + libusb_release_interface(m_usb_handle, 0); + libusb_close(m_usb_handle); + return NULL; +} + + +/* + * Store the data in the shared buffer + */ +bool AnymaOutputPort::WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + pthread_mutex_lock(&m_data_mutex); + m_buffer.Set(buffer); + pthread_mutex_unlock(&m_data_mutex); + return true; +} + + +/* + * Send the dmx out the widget + * @return true on success, false on failure + */ +bool AnymaOutputPort::SendDMX(const DmxBuffer &buffer) { + int r = libusb_control_transfer(m_usb_handle, + LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | + LIBUSB_ENDPOINT_OUT, + UDMX_SET_CHANNEL_RANGE, + buffer.Size(), + 0, + // the suck + const_cast(buffer.GetRaw()), + buffer.Size(), + URB_TIMEOUT_MS); + // Sometimes we get PIPE errors here, those are non-fatal + return r > 0 || r == LIBUSB_ERROR_PIPE; +} + + +/* + * Return a string descriptor + * @param usb_handle the usb handle to the device + * @param desc_index the index of the descriptor + * @param data where to store the output string + * @returns true if we got the value, false otherwise + */ +bool AnymaOutputPort::GetDescriptorString(libusb_device_handle *usb_handle, + uint8_t desc_index, + string *data) { + enum { buffer_size = 32 }; // static arrays FTW! + unsigned char buffer[buffer_size]; + int r = libusb_get_string_descriptor_ascii( + usb_handle, + desc_index, + buffer, + buffer_size); + + if (r <= 0) { + return false; + } + data->assign(reinterpret_cast(buffer)); + return true; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.h new file mode 100644 index 0000000..09f8970 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/AnymaOutputPort.h @@ -0,0 +1,76 @@ +/* + * 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 Library 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. + * + * AnymaOutputPort.h + * The output port for a Anyma device. + * Copyright (C) 2010 Simon Newton + * + * It takes around 21ms to send one universe of data. so we do this in a + * separate thread. + */ + +#ifndef PLUGINS_USBDMX_ANYMAOUTPUTPORT_H_ +#define PLUGINS_USBDMX_ANYMAOUTPUTPORT_H_ + +#include +#include +#include +#include "ola/DmxBuffer.h" +#include "ola/OlaThread.h" +#include "olad/Port.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +class AnymaDevice; + +class AnymaOutputPort: public BasicOutputPort, OlaThread { + public: + AnymaOutputPort(AnymaDevice *parent, + unsigned int id, + libusb_device *usb_device); + ~AnymaOutputPort(); + string SerialNumber() const { return m_serial; } + + bool Start(); + void *Run(); + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return ""; } + + private: + static const unsigned int URB_TIMEOUT_MS = 500; + static const unsigned int UDMX_SET_CHANNEL_RANGE = 0x0002; + static const char EXPECTED_MANUFACTURER[]; + static const char EXPECTED_PRODUCT[]; + + bool m_term; + string m_serial; + libusb_device *m_usb_device; + libusb_device_handle *m_usb_handle; + DmxBuffer m_buffer; + pthread_mutex_t m_data_mutex; + pthread_mutex_t m_term_mutex; + + bool SendDMX(const DmxBuffer &buffer_old); + bool GetDescriptorString(libusb_device_handle *usb_handle, + uint8_t desc_index, + string *data); +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_ANYMAOUTPUTPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/FirmwareLoader.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/FirmwareLoader.h new file mode 100644 index 0000000..396771c --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/FirmwareLoader.h @@ -0,0 +1,38 @@ +/* + * 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 Library 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. + * + * FirmwareLoader.h + * The base class for FirmwareLoaders. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_FIRMWARELOADER_H_ +#define PLUGINS_USBDMX_FIRMWARELOADER_H_ + +namespace ola { +namespace plugin { +namespace usbdmx { + +class FirmwareLoader { + public: + FirmwareLoader() {} + virtual ~FirmwareLoader() {} + + virtual bool LoadFirmware() = 0; +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_FIRMWARELOADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.am new file mode 100644 index 0000000..d63e856 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.am @@ -0,0 +1,18 @@ +libdir = $(plugindir) +EXTRA_DIST = AnymaDevice.h AnymaOutputPort.h FirmwareLoader.h SunliteDevice.h \ + SunliteFirmware.h SunliteFirmwareLoader.h SunliteOutputPort.h \ + UsbDmxPlugin.h UsbDevice.h VellemanDevice.h VellemanOutputPort.h + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include +AM_CXXFLAGS = -Wall -Wformat -W + +if HAVE_LIBUSB + lib_LTLIBRARIES = libolausbdmx.la + libolausbdmx_la_SOURCES = AnymaDevice.cpp AnymaOutputPort.cpp \ + SunliteDevice.cpp SunliteFirmwareLoader.cpp \ + SunliteOutputPort.cpp \ + UsbDmxPlugin.cpp VellemanDevice.cpp \ + VellemanOutputPort.cpp + libolausbdmx_la_CXXFLAGS = $(libusb_CFLAGS) + libolausbdmx_la_LIBADD = $(libusb_LIBS) +endif diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.in new file mode 100644 index 0000000..2621697 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/Makefile.in @@ -0,0 +1,584 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plugins/usbdmx +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +@HAVE_LIBUSB_TRUE@libolausbdmx_la_DEPENDENCIES = \ +@HAVE_LIBUSB_TRUE@ $(am__DEPENDENCIES_1) +am__libolausbdmx_la_SOURCES_DIST = AnymaDevice.cpp AnymaOutputPort.cpp \ + SunliteDevice.cpp SunliteFirmwareLoader.cpp \ + SunliteOutputPort.cpp UsbDmxPlugin.cpp VellemanDevice.cpp \ + VellemanOutputPort.cpp +@HAVE_LIBUSB_TRUE@am_libolausbdmx_la_OBJECTS = \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-AnymaDevice.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-AnymaOutputPort.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-SunliteDevice.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-SunliteFirmwareLoader.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-SunliteOutputPort.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-UsbDmxPlugin.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-VellemanDevice.lo \ +@HAVE_LIBUSB_TRUE@ libolausbdmx_la-VellemanOutputPort.lo +libolausbdmx_la_OBJECTS = $(am_libolausbdmx_la_OBJECTS) +libolausbdmx_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +@HAVE_LIBUSB_TRUE@am_libolausbdmx_la_rpath = -rpath $(libdir) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolausbdmx_la_SOURCES) +DIST_SOURCES = $(am__libolausbdmx_la_SOURCES_DIST) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +EXTRA_DIST = AnymaDevice.h AnymaOutputPort.h FirmwareLoader.h SunliteDevice.h \ + SunliteFirmware.h SunliteFirmwareLoader.h SunliteOutputPort.h \ + UsbDmxPlugin.h UsbDevice.h VellemanDevice.h VellemanOutputPort.h + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include +AM_CXXFLAGS = -Wall -Wformat -W +@HAVE_LIBUSB_TRUE@lib_LTLIBRARIES = libolausbdmx.la +@HAVE_LIBUSB_TRUE@libolausbdmx_la_SOURCES = AnymaDevice.cpp AnymaOutputPort.cpp \ +@HAVE_LIBUSB_TRUE@ SunliteDevice.cpp SunliteFirmwareLoader.cpp \ +@HAVE_LIBUSB_TRUE@ SunliteOutputPort.cpp \ +@HAVE_LIBUSB_TRUE@ UsbDmxPlugin.cpp VellemanDevice.cpp \ +@HAVE_LIBUSB_TRUE@ VellemanOutputPort.cpp + +@HAVE_LIBUSB_TRUE@libolausbdmx_la_CXXFLAGS = $(libusb_CFLAGS) +@HAVE_LIBUSB_TRUE@libolausbdmx_la_LIBADD = $(libusb_LIBS) +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/usbdmx/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/usbdmx/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolausbdmx.la: $(libolausbdmx_la_OBJECTS) $(libolausbdmx_la_DEPENDENCIES) + $(libolausbdmx_la_LINK) $(am_libolausbdmx_la_rpath) $(libolausbdmx_la_OBJECTS) $(libolausbdmx_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-AnymaDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-AnymaOutputPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-SunliteDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-SunliteFirmwareLoader.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-SunliteOutputPort.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-UsbDmxPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-VellemanDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libolausbdmx_la-VellemanOutputPort.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +libolausbdmx_la-AnymaDevice.lo: AnymaDevice.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-AnymaDevice.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-AnymaDevice.Tpo -c -o libolausbdmx_la-AnymaDevice.lo `test -f 'AnymaDevice.cpp' || echo '$(srcdir)/'`AnymaDevice.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-AnymaDevice.Tpo $(DEPDIR)/libolausbdmx_la-AnymaDevice.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AnymaDevice.cpp' object='libolausbdmx_la-AnymaDevice.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-AnymaDevice.lo `test -f 'AnymaDevice.cpp' || echo '$(srcdir)/'`AnymaDevice.cpp + +libolausbdmx_la-AnymaOutputPort.lo: AnymaOutputPort.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-AnymaOutputPort.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-AnymaOutputPort.Tpo -c -o libolausbdmx_la-AnymaOutputPort.lo `test -f 'AnymaOutputPort.cpp' || echo '$(srcdir)/'`AnymaOutputPort.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-AnymaOutputPort.Tpo $(DEPDIR)/libolausbdmx_la-AnymaOutputPort.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AnymaOutputPort.cpp' object='libolausbdmx_la-AnymaOutputPort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-AnymaOutputPort.lo `test -f 'AnymaOutputPort.cpp' || echo '$(srcdir)/'`AnymaOutputPort.cpp + +libolausbdmx_la-SunliteDevice.lo: SunliteDevice.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-SunliteDevice.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-SunliteDevice.Tpo -c -o libolausbdmx_la-SunliteDevice.lo `test -f 'SunliteDevice.cpp' || echo '$(srcdir)/'`SunliteDevice.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-SunliteDevice.Tpo $(DEPDIR)/libolausbdmx_la-SunliteDevice.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SunliteDevice.cpp' object='libolausbdmx_la-SunliteDevice.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-SunliteDevice.lo `test -f 'SunliteDevice.cpp' || echo '$(srcdir)/'`SunliteDevice.cpp + +libolausbdmx_la-SunliteFirmwareLoader.lo: SunliteFirmwareLoader.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-SunliteFirmwareLoader.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-SunliteFirmwareLoader.Tpo -c -o libolausbdmx_la-SunliteFirmwareLoader.lo `test -f 'SunliteFirmwareLoader.cpp' || echo '$(srcdir)/'`SunliteFirmwareLoader.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-SunliteFirmwareLoader.Tpo $(DEPDIR)/libolausbdmx_la-SunliteFirmwareLoader.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SunliteFirmwareLoader.cpp' object='libolausbdmx_la-SunliteFirmwareLoader.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-SunliteFirmwareLoader.lo `test -f 'SunliteFirmwareLoader.cpp' || echo '$(srcdir)/'`SunliteFirmwareLoader.cpp + +libolausbdmx_la-SunliteOutputPort.lo: SunliteOutputPort.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-SunliteOutputPort.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-SunliteOutputPort.Tpo -c -o libolausbdmx_la-SunliteOutputPort.lo `test -f 'SunliteOutputPort.cpp' || echo '$(srcdir)/'`SunliteOutputPort.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-SunliteOutputPort.Tpo $(DEPDIR)/libolausbdmx_la-SunliteOutputPort.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='SunliteOutputPort.cpp' object='libolausbdmx_la-SunliteOutputPort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-SunliteOutputPort.lo `test -f 'SunliteOutputPort.cpp' || echo '$(srcdir)/'`SunliteOutputPort.cpp + +libolausbdmx_la-UsbDmxPlugin.lo: UsbDmxPlugin.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-UsbDmxPlugin.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-UsbDmxPlugin.Tpo -c -o libolausbdmx_la-UsbDmxPlugin.lo `test -f 'UsbDmxPlugin.cpp' || echo '$(srcdir)/'`UsbDmxPlugin.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-UsbDmxPlugin.Tpo $(DEPDIR)/libolausbdmx_la-UsbDmxPlugin.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UsbDmxPlugin.cpp' object='libolausbdmx_la-UsbDmxPlugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-UsbDmxPlugin.lo `test -f 'UsbDmxPlugin.cpp' || echo '$(srcdir)/'`UsbDmxPlugin.cpp + +libolausbdmx_la-VellemanDevice.lo: VellemanDevice.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-VellemanDevice.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-VellemanDevice.Tpo -c -o libolausbdmx_la-VellemanDevice.lo `test -f 'VellemanDevice.cpp' || echo '$(srcdir)/'`VellemanDevice.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-VellemanDevice.Tpo $(DEPDIR)/libolausbdmx_la-VellemanDevice.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='VellemanDevice.cpp' object='libolausbdmx_la-VellemanDevice.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-VellemanDevice.lo `test -f 'VellemanDevice.cpp' || echo '$(srcdir)/'`VellemanDevice.cpp + +libolausbdmx_la-VellemanOutputPort.lo: VellemanOutputPort.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -MT libolausbdmx_la-VellemanOutputPort.lo -MD -MP -MF $(DEPDIR)/libolausbdmx_la-VellemanOutputPort.Tpo -c -o libolausbdmx_la-VellemanOutputPort.lo `test -f 'VellemanOutputPort.cpp' || echo '$(srcdir)/'`VellemanOutputPort.cpp +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libolausbdmx_la-VellemanOutputPort.Tpo $(DEPDIR)/libolausbdmx_la-VellemanOutputPort.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='VellemanOutputPort.cpp' object='libolausbdmx_la-VellemanOutputPort.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libolausbdmx_la_CXXFLAGS) $(CXXFLAGS) -c -o libolausbdmx_la-VellemanOutputPort.lo `test -f 'VellemanOutputPort.cpp' || echo '$(srcdir)/'`VellemanOutputPort.cpp + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.cpp new file mode 100644 index 0000000..31436f8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.cpp @@ -0,0 +1,49 @@ +/* + * This dmxgram 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * SunliteDevice.cpp + * The USBDMX2 device + * Copyright (C) 2010 Simon Newton + */ + +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/SunliteDevice.h" +#include "plugins/usbdmx/SunliteOutputPort.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + + +/* + * Start this device. + */ +bool SunliteDevice::StartHook() { + SunliteOutputPort *output_port = new SunliteOutputPort(this, + 0, + m_usb_device); + if (!output_port->Start()) { + delete output_port; + return false; + } + AddPort(output_port); + return true; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.h new file mode 100644 index 0000000..ae22288 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteDevice.h @@ -0,0 +1,50 @@ +/* + * 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * SunliteDevice.h + * Interface for the Sunlite device + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_SUNLITEDEVICE_H_ +#define PLUGINS_USBDMX_SUNLITEDEVICE_H_ + +#include +#include +#include "plugins/usbdmx/UsbDevice.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +/* + * A Sunlite device + */ +class SunliteDevice: public UsbDevice { + public: + SunliteDevice(ola::AbstractPlugin *owner, + libusb_device *usb_device): + UsbDevice(owner, "Sunlite USB Device", usb_device) { + } + + string DeviceId() const { return "usbdmx2"; } + + protected: + bool StartHook(); +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_SUNLITEDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmware.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmware.h new file mode 100644 index 0000000..74adcab --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmware.h @@ -0,0 +1,842 @@ +/* + * Copyright (C) Michael Stickel + * + * 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. + * + * Imported into the OLA Project by Simon Newton, 2/4/2010. + */ + +#ifndef PLUGINS_USBDMX_SUNLITEFIRMWARE_H_ +#define PLUGINS_USBDMX_SUNLITEFIRMWARE_H_ + +#include + +struct sunlite_hex_record { + uint16_t address; + uint8_t data_size; + uint8_t data[16]; +}; + +static const uint16_t SUNLITE_END_OF_FIRMWARE = 0xffff; + + +static const struct sunlite_hex_record sunlite_firmware[] = { + { 32658, 1, { 0x1 } }, /* reset=1 */ + { 32658, 1, { 0x1 } }, /* reset=1 */ + { 5228, 16, { 0xc2, 0x00, 0x90, 0x7f, 0xa5, 0xe0, 0x54, 0x18, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0x44, 0x50 } }, + { 5244, 16, { 0xf5, 0x1c, 0x13, 0x92, 0x01, 0xd2, 0xe8, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9 } }, + { 5260, 16, { 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0x95, 0xe0, 0x44, 0xc0, 0xf0, 0x90 } }, + { 5276, 16, { 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x05, 0xf0, 0xd2, 0xaf, 0x12 } }, + { 5292, 13, { 0x17, 0x5f, 0x30, 0x00, 0xfd, 0x12, 0x11, 0x00, 0xc2, 0x00, 0x80, 0xf6, 0x22 } }, + { 4352, 16, { 0x90, 0x7f, 0xe9, 0xe0, 0x24, 0x5d, 0x60, 0x0d, 0x14, 0x70, 0x03, 0x02, 0x12, 0x44, 0x24, 0x02 } }, + { 4368, 16, { 0x60, 0x03, 0x02, 0x12, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0x75, 0x08, 0x00, 0xf5, 0x09, 0xa3, 0xe0 } }, + { 4384, 16, { 0xfe, 0xe4, 0x25, 0x09, 0xf5, 0x09, 0xee, 0x35, 0x08, 0xf5, 0x08, 0x90, 0x7f, 0xee, 0xe0, 0x75 } }, + { 4400, 16, { 0xa, 0x00, 0xf5, 0x0b, 0xa3, 0xe0, 0xfe, 0xe4, 0x25, 0x0b, 0xf5, 0x0b, 0xee, 0x35, 0x0a, 0xf5 } }, + { 4416, 16, { 0xa, 0x90, 0x7f, 0xe8, 0xe0, 0x64, 0xc0, 0x60, 0x03, 0x02, 0x11, 0xd4, 0xe5, 0x0b, 0x45, 0x0a } }, + { 4432, 16, { 0x70, 0x03, 0x02, 0x12, 0x4a, 0xc3, 0xe5, 0x0b, 0x94, 0x40, 0xe5, 0x0a, 0x94, 0x00, 0x50, 0x08 } }, + { 4448, 16, { 0x85, 0x0a, 0x0c, 0x85, 0x0b, 0x0d, 0x80, 0x06, 0x75, 0x0c, 0x00, 0x75, 0x0d, 0x40, 0x90, 0x7f } }, + { 4464, 16, { 0xe9, 0xe0, 0xb4, 0xa3, 0x25, 0xae, 0x0c, 0xaf, 0x0d, 0xaa, 0x08, 0xa9, 0x09, 0x7b, 0x01, 0xc0 } }, + { 4480, 16, { 0x3, 0xc0, 0x02, 0xc0, 0x01, 0x7a, 0x7f, 0x79, 0x00, 0x78, 0x00, 0x7c, 0x7f, 0xad, 0x03, 0xd0 } }, + { 4496, 16, { 0x1, 0xd0, 0x02, 0xd0, 0x03, 0x12, 0x13, 0x56, 0x80, 0x0f, 0xaf, 0x09, 0xae, 0x08, 0xad, 0x0d } }, + { 4512, 16, { 0x7a, 0x7f, 0x79, 0x00, 0x7b, 0x00, 0x12, 0x15, 0xa4, 0x90, 0x7f, 0xb5, 0xe5, 0x0d, 0xf0, 0xe5 } }, + { 4528, 16, { 0xd, 0x25, 0x09, 0xf5, 0x09, 0xe5, 0x0c, 0x35, 0x08, 0xf5, 0x08, 0xc3, 0xe5, 0x0b, 0x95, 0x0d } }, + { 4544, 16, { 0xf5, 0x0b, 0xe5, 0x0a, 0x95, 0x0c, 0xf5, 0x0a, 0x90, 0x7f, 0xb4, 0xe0, 0x20, 0xe2, 0x03, 0x02 } }, + { 4560, 16, { 0x11, 0x4c, 0x80, 0xf4, 0x90, 0x7f, 0xe8, 0xe0, 0x64, 0x40, 0x70, 0x6e, 0xe5, 0x0b, 0x45, 0x0a } }, + { 4576, 16, { 0x60, 0x68, 0xe4, 0x90, 0x7f, 0xc5, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x20, 0xe3, 0xf9, 0x90, 0x7f } }, + { 4592, 16, { 0xc5, 0xe0, 0x75, 0x0c, 0x00, 0xf5, 0x0d, 0x90, 0x7f, 0xe9, 0xe0, 0xb4, 0xa3, 0x15, 0xae, 0x0c } }, + { 4608, 16, { 0xaf, 0x0d, 0xa8, 0x09, 0xac, 0x08, 0x7d, 0x01, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0xc0, 0x12, 0x13 } }, + { 4624, 16, { 0x56, 0x80, 0x0f, 0xaf, 0x09, 0xae, 0x08, 0xad, 0x0d, 0x7a, 0x7f, 0x79, 0x00, 0x7b, 0x00, 0x12 } }, + { 4640, 16, { 0x14, 0xb9, 0xe5, 0x0d, 0x25, 0x09, 0xf5, 0x09, 0xe5, 0x0c, 0x35, 0x08, 0xf5, 0x08, 0xc3, 0xe5 } }, + { 4656, 16, { 0xb, 0x95, 0x0d, 0xf5, 0x0b, 0xe5, 0x0a, 0x95, 0x0c, 0xf5, 0x0a, 0x90, 0x7f, 0xb4, 0xe0, 0x44 } }, + { 4672, 10, { 0x2, 0xf0, 0x80, 0x98, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x1c } }, + { 4682, 1, { 0x22 } }, + { 5464, 6, { 0xab, 0x07, 0xaa, 0x06, 0xac, 0x05 } }, + { 5470, 16, { 0xe4, 0xfd, 0x30, 0x01, 0x11, 0xea, 0xff, 0xae, 0x05, 0x0d, 0xee, 0x24, 0x00, 0xf5, 0x82, 0xe4 } }, + { 5486, 16, { 0x34, 0xe0, 0xf5, 0x83, 0xef, 0xf0, 0xeb, 0xae, 0x05, 0x0d, 0x74, 0x00, 0x2e, 0xf5, 0x82, 0xe4 } }, + { 5502, 16, { 0x34, 0xe0, 0xf5, 0x83, 0xeb, 0xf0, 0xaf, 0x05, 0x0d, 0x74, 0x00, 0x2f, 0xf5, 0x82, 0xe4, 0x34 } }, + { 5518, 16, { 0xe0, 0xf5, 0x83, 0xec, 0xf0, 0xaf, 0x1c, 0x7a, 0xe0, 0x7b, 0x00, 0x12, 0x17, 0x20, 0x7f, 0x0a } }, + { 5534, 5, { 0x7e, 0x00, 0x12, 0x17, 0x3c } }, + { 5539, 1, { 0x22 } }, + { 5305, 10, { 0x8e, 0x0e, 0x8f, 0x0f, 0x8d, 0x10, 0x8a, 0x11, 0x8b, 0x12 } }, + { 5315, 16, { 0xe4, 0xf5, 0x13, 0xe5, 0x13, 0xc3, 0x95, 0x10, 0x50, 0x20, 0x05, 0x0f, 0xe5, 0x0f, 0xae, 0x0e } }, + { 5331, 16, { 0x70, 0x02, 0x05, 0x0e, 0x14, 0xff, 0xe5, 0x12, 0x25, 0x13, 0xf5, 0x82, 0xe4, 0x35, 0x11, 0xf5 } }, + { 5347, 10, { 0x83, 0xe0, 0xfd, 0x12, 0x15, 0x58, 0x05, 0x13, 0x80, 0xd9 } }, + { 5357, 1, { 0x22 } }, + { 5540, 10, { 0x8e, 0x0e, 0x8f, 0x0f, 0x8d, 0x10, 0x8a, 0x11, 0x8b, 0x12 } }, + { 5550, 16, { 0xe4, 0xfd, 0x30, 0x01, 0x12, 0xe5, 0x0e, 0xff, 0xae, 0x05, 0x0d, 0xee, 0x24, 0x03, 0xf5, 0x82 } }, + { 5566, 16, { 0xe4, 0x34, 0xe0, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x0f, 0xae, 0x05, 0x0d, 0x74, 0x03, 0x2e, 0xf5 } }, + { 5582, 16, { 0x82, 0xe4, 0x34, 0xe0, 0xf5, 0x83, 0xe5, 0x0f, 0xf0, 0xaf, 0x1c, 0x7a, 0xe0, 0x7b, 0x03, 0x12 } }, + { 5598, 13, { 0x17, 0x20, 0xaf, 0x1c, 0xad, 0x10, 0xab, 0x12, 0xaa, 0x11, 0x12, 0x17, 0x04 } }, + { 5611, 1, { 0x22 } }, + { 5742, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2 } }, + { 5758, 16, { 0x0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85 } }, + { 5774, 7, { 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5700, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90 } }, + { 5716, 16, { 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0 } }, + { 5732, 10, { 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5781, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 5797, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x02, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 5813, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5818, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 5834, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x10, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 5850, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5375, 1, { 0x32 } }, + { 5855, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 5871, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 5887, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5991, 1, { 0x32 } }, + { 5992, 1, { 0x32 } }, + { 5993, 1, { 0x32 } }, + { 5994, 1, { 0x32 } }, + { 5995, 1, { 0x32 } }, + { 5996, 1, { 0x32 } }, + { 5997, 1, { 0x32 } }, + { 5998, 1, { 0x32 } }, + { 5999, 1, { 0x32 } }, + { 6000, 1, { 0x32 } }, + { 6001, 1, { 0x32 } }, + { 6002, 1, { 0x32 } }, + { 6003, 1, { 0x32 } }, + { 6004, 1, { 0x32 } }, + { 6005, 1, { 0x32 } }, + { 6006, 1, { 0x32 } }, + { 67, 3, { 0x2, 0x15, 0x00 } }, + { 5376, 16, { 0x2, 0x16, 0x6e, 0x00, 0x02, 0x16, 0x95, 0x00, 0x02, 0x16, 0x44, 0x00, 0x02, 0x16, 0xdf, 0x00 } }, + { 5392, 16, { 0x2, 0x16, 0xba, 0x00, 0x02, 0x14, 0xff, 0x00, 0x02, 0x17, 0x67, 0x00, 0x02, 0x17, 0x68, 0x00 } }, + { 5408, 16, { 0x2, 0x17, 0x69, 0x00, 0x02, 0x17, 0x6a, 0x00, 0x02, 0x17, 0x6b, 0x00, 0x02, 0x17, 0x6c, 0x00 } }, + { 5424, 16, { 0x2, 0x17, 0x6d, 0x00, 0x02, 0x17, 0x6e, 0x00, 0x02, 0x17, 0x6f, 0x00, 0x02, 0x17, 0x70, 0x00 } }, + { 5440, 16, { 0x2, 0x17, 0x71, 0x00, 0x02, 0x17, 0x72, 0x00, 0x02, 0x17, 0x73, 0x00, 0x02, 0x17, 0x74, 0x00 } }, + { 5456, 8, { 0x2, 0x17, 0x75, 0x00, 0x02, 0x17, 0x76, 0x00 } }, + { 5948, 16, { 0x8e, 0x14, 0x8f, 0x15, 0xe5, 0x15, 0x15, 0x15, 0xae, 0x14, 0x70, 0x02, 0x15, 0x14, 0x4e, 0x60 } }, + { 5964, 7, { 0x5, 0x12, 0x14, 0xee, 0x80, 0xee, 0x22 } }, + { 5983, 8, { 0xe4, 0xf5, 0x1b, 0xd2, 0xe9, 0xd2, 0xaf, 0x22 } }, + { 5657, 16, { 0xa9, 0x07, 0xe5, 0x1b, 0x70, 0x23, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0xe9, 0x25, 0xe0 } }, + { 5673, 16, { 0x90, 0x7f, 0xa6, 0xf0, 0x8d, 0x16, 0xaf, 0x03, 0xa9, 0x07, 0x75, 0x17, 0x01, 0x8a, 0x18, 0x89 } }, + { 5689, 11, { 0x19, 0xe4, 0xf5, 0x1a, 0x75, 0x1b, 0x01, 0xd3, 0x22, 0xc3, 0x22 } }, + { 5612, 16, { 0xa9, 0x07, 0xe5, 0x1b, 0x70, 0x25, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0xe9, 0x25, 0xe0 } }, + { 5628, 16, { 0x44, 0x01, 0x90, 0x7f, 0xa6, 0xf0, 0x8d, 0x16, 0xaf, 0x03, 0xa9, 0x07, 0x75, 0x17, 0x01, 0x8a } }, + { 5644, 13, { 0x18, 0x89, 0x19, 0xe4, 0xf5, 0x1a, 0x75, 0x1b, 0x03, 0xd3, 0x22, 0xc3, 0x22 } }, + { 75, 3, { 0x2, 0x13, 0x7f } }, + { 4991, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0 } }, + { 5007, 16, { 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0xc0, 0x02, 0xc0, 0x03, 0xc0, 0x06, 0xc0, 0x07 } }, + { 5023, 16, { 0x90, 0x7f, 0xa5, 0xe0, 0x30, 0xe2, 0x06, 0x75, 0x1b, 0x06, 0x02, 0x14, 0x4e, 0x90, 0x7f, 0xa5 } }, + { 5039, 16, { 0xe0, 0x20, 0xe1, 0x0c, 0xe5, 0x1b, 0x64, 0x02, 0x60, 0x06, 0x75, 0x1b, 0x07, 0x02, 0x14, 0x4e } }, + { 5055, 16, { 0xaf, 0x1b, 0xef, 0x24, 0xfe, 0x60, 0x48, 0x14, 0x60, 0x2c, 0x24, 0xfe, 0x60, 0x77, 0x24, 0x04 } }, + { 5071, 16, { 0x60, 0x03, 0x02, 0x14, 0x4e, 0xab, 0x17, 0xaa, 0x18, 0xa9, 0x19, 0xaf, 0x1a, 0x05, 0x1a, 0x8f } }, + { 5087, 16, { 0x82, 0x75, 0x83, 0x00, 0x12, 0x12, 0x4b, 0x90, 0x7f, 0xa6, 0xf0, 0xe5, 0x1a, 0x65, 0x16, 0x70 } }, + { 5103, 16, { 0x5e, 0x75, 0x1b, 0x05, 0x80, 0x59, 0x90, 0x7f, 0xa6, 0xe0, 0xab, 0x17, 0xaa, 0x18, 0xa9, 0x19 } }, + { 5119, 16, { 0xae, 0x1a, 0x8e, 0x82, 0x75, 0x83, 0x00, 0x12, 0x12, 0x78, 0x75, 0x1b, 0x02, 0x80, 0x40, 0xe5 } }, + { 5135, 16, { 0x16, 0x24, 0xfe, 0xb5, 0x1a, 0x07, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x20, 0xf0, 0xe5, 0x16, 0x14 } }, + { 5151, 16, { 0xb5, 0x1a, 0x0a, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x75, 0x1b, 0x00, 0x90, 0x7f, 0xa6 } }, + { 5167, 16, { 0xe0, 0xab, 0x17, 0xaa, 0x18, 0xa9, 0x19, 0xae, 0x1a, 0x8e, 0x82, 0x75, 0x83, 0x00, 0x12, 0x12 } }, + { 5183, 16, { 0x78, 0x05, 0x1a, 0x80, 0x0a, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x40, 0xf0, 0x75, 0x1b, 0x00, 0x53 } }, + { 5199, 16, { 0x91, 0xdf, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0xd0, 0xd0 } }, + { 5215, 13, { 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 5892, 16, { 0x12, 0x15, 0xec, 0xe5, 0x1b, 0x24, 0xfa, 0x60, 0x0e, 0x14, 0x60, 0x06, 0x24, 0x07, 0x70, 0xf3 } }, + { 5908, 12, { 0xd3, 0x22, 0xe4, 0xf5, 0x1b, 0xd3, 0x22, 0xe4, 0xf5, 0x1b, 0xd3, 0x22 } }, + { 5920, 16, { 0x12, 0x16, 0x19, 0xe5, 0x1b, 0x24, 0xfa, 0x60, 0x0e, 0x14, 0x60, 0x06, 0x24, 0x07, 0x70, 0xf3 } }, + { 5936, 12, { 0xd3, 0x22, 0xe4, 0xf5, 0x1b, 0xd3, 0x22, 0xe4, 0xf5, 0x1b, 0xd3, 0x22 } }, + { 5358, 16, { 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9 } }, + { 5374, 1, { 0x22 } }, + { 0, 3, { 0x2, 0x17, 0x53 } }, + { 5971, 12, { 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x20, 0x02, 0x14, 0x6c } }, + { 4683, 16, { 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50 } }, + { 4699, 16, { 0x6, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22 } }, + { 4715, 13, { 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22 } }, + { 4728, 16, { 0xf8, 0xbb, 0x01, 0x0d, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe8, 0xf0 } }, + { 4744, 16, { 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xc8, 0xf6, 0x22, 0xbb, 0xfe, 0x05, 0xe9, 0x25, 0x82, 0xc8 } }, + { 4760, 2, { 0xf2, 0x22 } }, + { 4762, 16, { 0xe7, 0x09, 0xf6, 0x08, 0xdf, 0xfa, 0x80, 0x46, 0xe7, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x3e } }, + { 4778, 16, { 0x88, 0x82, 0x8c, 0x83, 0xe7, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x32, 0xe3, 0x09, 0xf6, 0x08 } }, + { 4794, 16, { 0xdf, 0xfa, 0x80, 0x6e, 0xe3, 0x09, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x66, 0x88, 0x82, 0x8c, 0x83 } }, + { 4810, 16, { 0xe3, 0x09, 0xf0, 0xa3, 0xdf, 0xfa, 0x80, 0x5a, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf6, 0x08 } }, + { 4826, 16, { 0xdf, 0xfa, 0x80, 0x4e, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0xa3, 0xf2, 0x08, 0xdf, 0xfa, 0x80, 0x42 } }, + { 4842, 16, { 0x80, 0xd2, 0x80, 0xfa, 0x80, 0xc6, 0x80, 0xd4, 0x80, 0x55, 0x80, 0xf2, 0x80, 0x29, 0x80, 0x10 } }, + { 4858, 16, { 0x80, 0xa6, 0x80, 0xea, 0x80, 0x9a, 0x80, 0xa8, 0x80, 0xda, 0x80, 0xe2, 0x80, 0xca, 0x80, 0x29 } }, + { 4874, 16, { 0x88, 0x84, 0x8c, 0x85, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0x05, 0x86, 0xf0, 0xa3, 0x05 } }, + { 4890, 16, { 0x86, 0xdf, 0xf5, 0xde, 0xf3, 0x80, 0x0b, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf6, 0x08 } }, + { 4906, 16, { 0xdf, 0xf9, 0xec, 0xfa, 0xa9, 0xf0, 0xed, 0xfb, 0x22, 0x88, 0x84, 0x8c, 0x85, 0x89, 0x82, 0x8a } }, + { 4922, 16, { 0x83, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf6, 0xde, 0xf4, 0x80, 0xe3, 0x89 } }, + { 4938, 16, { 0x82, 0x8a, 0x83, 0xe4, 0x93, 0xa3, 0xf2, 0x08, 0xdf, 0xf9, 0x80, 0xd6, 0x88, 0xf0, 0xed, 0x24 } }, + { 4954, 16, { 0x2, 0xb4, 0x04, 0x00, 0x50, 0xcc, 0xf5, 0x82, 0xeb, 0x24, 0x02, 0xb4, 0x04, 0x00, 0x50, 0xc2 } }, + { 4970, 16, { 0x23, 0x23, 0x45, 0x82, 0xf5, 0x82, 0xef, 0x4e, 0x60, 0xb8, 0xef, 0x60, 0x01, 0x0e, 0xe5, 0x82 } }, + { 4986, 5, { 0x23, 0x90, 0x12, 0xea, 0x73 } }, + { 32658, 1, { 0x0 } }, /* reset=0 */ + { 32658, 1, { 0x1 } }, /* reset=1 */ + { 1717, 16, { 0xd2, 0x00, 0x90, 0x7f, 0xa1, 0x74, 0x01, 0xf0, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x94 } }, + { 1733, 16, { 0xf0, 0x90, 0x7f, 0x95, 0x74, 0x03, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f } }, + { 1749, 16, { 0x9d, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xf2, 0xf0, 0x90, 0x7f, 0x96, 0x74, 0x20, 0xf0, 0x90, 0x7f } }, + { 1765, 16, { 0x98, 0x74, 0xf2, 0xf0, 0x12, 0x0a, 0x6a, 0x12, 0x0a, 0x86, 0x90, 0x7f, 0xde, 0xe0, 0x44, 0x02 } }, + { 1781, 16, { 0xf0, 0x90, 0x7f, 0xdf, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0xad, 0xe0, 0x44, 0x02, 0xf0, 0x90 } }, + { 1797, 16, { 0x7f, 0xac, 0xe0, 0x44, 0x02, 0xf0, 0x12, 0x09, 0x90, 0x90, 0x7f, 0xb7, 0x74, 0x20, 0xf0, 0x22 } }, + { 2879, 1, { 0x22 } }, + { 2867, 2, { 0xd3, 0x22 } }, + { 2869, 2, { 0xd3, 0x22 } }, + { 2871, 2, { 0xd3, 0x22 } }, + { 2847, 8, { 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x0f, 0xd3, 0x22 } }, + { 2796, 14, { 0x90, 0x7f, 0x00, 0xe5, 0x0f, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0xd3, 0x22 } }, + { 2855, 8, { 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x0e, 0xd3, 0x22 } }, + { 2810, 14, { 0x90, 0x7f, 0x00, 0xe5, 0x0e, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0xd3, 0x22 } }, + { 2873, 2, { 0xd3, 0x22 } }, + { 2875, 2, { 0xd3, 0x22 } }, + { 2877, 2, { 0xd3, 0x22 } }, + { 2598, 16, { 0x90, 0x7f, 0xe8, 0xe0, 0x30, 0xe6, 0x1a, 0xa3, 0xe0, 0x24, 0xf0, 0x70, 0x12, 0x7f, 0x06, 0x12 } }, + { 2614, 16, { 0x7, 0x15, 0x90, 0x7f, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x80, 0x02, 0xd3 } }, + { 2630, 3, { 0x22, 0xc3, 0x22 } }, + { 2370, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2 } }, + { 2386, 16, { 0x1, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85 } }, + { 2402, 7, { 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2487, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 2503, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 2519, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2524, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 2540, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x02, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 2556, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2561, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53 } }, + { 2577, 16, { 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x10, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82 } }, + { 2593, 5, { 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2880, 1, { 0x32 } }, + { 2409, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2 } }, + { 2425, 16, { 0x3, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85 } }, + { 2441, 7, { 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2881, 1, { 0x32 } }, + { 2882, 1, { 0x32 } }, + { 1903, 16, { 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86 } }, + { 1919, 16, { 0x0, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0xc0, 0x02, 0xc0, 0x03, 0xc0, 0x04 } }, + { 1935, 16, { 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x12, 0x09, 0x90, 0x90, 0x7f, 0xb7, 0x74, 0x20, 0xf0, 0x90 } }, + { 1951, 16, { 0x7f, 0xa9, 0x74, 0x02, 0xf0, 0x53, 0x91, 0xef, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04 } }, + { 1967, 16, { 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0, 0x00, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85 } }, + { 1983, 9, { 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32 } }, + { 1619, 16, { 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86 } }, + { 1635, 16, { 0x0, 0xc0, 0xd0, 0x75, 0xd0, 0x00, 0xc0, 0x00, 0xc0, 0x01, 0xc0, 0x02, 0xc0, 0x03, 0xc0, 0x04 } }, + { 1651, 16, { 0xc0, 0x05, 0xc0, 0x06, 0xc0, 0x07, 0x90, 0x7f, 0x9b, 0xe0, 0x64, 0x80, 0x90, 0x7f, 0x98, 0xf0 } }, + { 1667, 16, { 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaa, 0x74, 0x02, 0xf0, 0x12, 0x0b, 0x08, 0x90, 0x7f, 0xc7, 0xe4 } }, + { 1683, 16, { 0xf0, 0xd0, 0x07, 0xd0, 0x06, 0xd0, 0x05, 0xd0, 0x04, 0xd0, 0x03, 0xd0, 0x02, 0xd0, 0x01, 0xd0 } }, + { 1699, 16, { 0x0, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0 } }, + { 1715, 2, { 0xe0, 0x32 } }, + { 2883, 1, { 0x32 } }, + { 2884, 1, { 0x32 } }, + { 2885, 1, { 0x32 } }, + { 2886, 1, { 0x32 } }, + { 2887, 1, { 0x32 } }, + { 2888, 1, { 0x32 } }, + { 2889, 1, { 0x32 } }, + { 2890, 1, { 0x32 } }, + { 2891, 1, { 0x32 } }, + { 2892, 1, { 0x32 } }, + { 2893, 1, { 0x32 } }, + { 2894, 1, { 0x32 } }, + { 875, 16, { 0xe4, 0xf5, 0x31, 0xf5, 0x30, 0xf5, 0x2f, 0xf5, 0x2e, 0xc2, 0x03, 0xc2, 0x00, 0xc2, 0x02, 0xc2 } }, + { 891, 16, { 0x1, 0x12, 0x06, 0xb5, 0x7e, 0x05, 0x7f, 0x06, 0x8e, 0x08, 0x8f, 0x09, 0x75, 0x0a, 0x05, 0x75 } }, + { 907, 16, { 0xb, 0x18, 0x75, 0x0c, 0x05, 0x75, 0x0d, 0x38, 0xee, 0x54, 0xe0, 0x70, 0x03, 0x02, 0x04, 0x77 } }, + { 923, 16, { 0x75, 0x32, 0x00, 0x75, 0x33, 0x80, 0x8e, 0x34, 0x8f, 0x35, 0xc3, 0x74, 0x74, 0x9f, 0xff, 0x74 } }, + { 939, 16, { 0x5, 0x9e, 0xcf, 0x24, 0x02, 0xcf, 0x34, 0x00, 0xfe, 0xe4, 0x8f, 0x2d, 0x8e, 0x2c, 0xf5, 0x2b } }, + { 955, 16, { 0xf5, 0x2a, 0xf5, 0x29, 0xf5, 0x28, 0xf5, 0x27, 0xf5, 0x26, 0xaf, 0x2d, 0xae, 0x2c, 0xad, 0x2b } }, + { 971, 16, { 0xac, 0x2a, 0xab, 0x29, 0xaa, 0x28, 0xa9, 0x27, 0xa8, 0x26, 0xc3, 0x12, 0x08, 0x9e, 0x50, 0x26 } }, + { 987, 16, { 0xe5, 0x33, 0x25, 0x29, 0xf5, 0x82, 0xe5, 0x32, 0x35, 0x28, 0xf5, 0x83, 0x74, 0xcd, 0xf0, 0xe5 } }, + { 1003, 16, { 0x29, 0x24, 0x01, 0xf5, 0x29, 0xe4, 0x35, 0x28, 0xf5, 0x28, 0xe4, 0x35, 0x27, 0xf5, 0x27, 0xe4 } }, + { 1019, 16, { 0x35, 0x26, 0xf5, 0x26, 0x80, 0xc4, 0xe4, 0xf5, 0x29, 0xf5, 0x28, 0xf5, 0x27, 0xf5, 0x26, 0xaf } }, + { 1035, 16, { 0x2d, 0xae, 0x2c, 0xad, 0x2b, 0xac, 0x2a, 0xab, 0x29, 0xaa, 0x28, 0xa9, 0x27, 0xa8, 0x26, 0xc3 } }, + { 1051, 16, { 0x12, 0x08, 0x9e, 0x50, 0x31, 0xae, 0x28, 0xaf, 0x29, 0xe5, 0x35, 0x2f, 0xf5, 0x82, 0xe5, 0x34 } }, + { 1067, 16, { 0x3e, 0xf5, 0x83, 0xe0, 0xfd, 0xe5, 0x33, 0x2f, 0xf5, 0x82, 0xe5, 0x32, 0x3e, 0xf5, 0x83, 0xed } }, + { 1083, 16, { 0xf0, 0xef, 0x24, 0x01, 0xf5, 0x29, 0xe4, 0x3e, 0xf5, 0x28, 0xe4, 0x35, 0x27, 0xf5, 0x27, 0xe4 } }, + { 1099, 16, { 0x35, 0x26, 0xf5, 0x26, 0x80, 0xb9, 0x85, 0x32, 0x08, 0x85, 0x33, 0x09, 0x74, 0x06, 0x24, 0x80 } }, + { 1115, 16, { 0xff, 0x74, 0x05, 0x34, 0xff, 0xfe, 0xc3, 0xe5, 0x0b, 0x9f, 0xf5, 0x0b, 0xe5, 0x0a, 0x9e, 0xf5 } }, + { 1131, 16, { 0xa, 0xc3, 0xe5, 0x0d, 0x9f, 0xf5, 0x0d, 0xe5, 0x0c, 0x9e, 0xf5, 0x0c, 0xd2, 0xe8, 0x43, 0xd8 } }, + { 1147, 16, { 0x20, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f } }, + { 1163, 16, { 0xae, 0xe0, 0x44, 0x1d, 0xf0, 0xd2, 0xaf, 0x20, 0x01, 0x41, 0x20, 0x01, 0x05, 0xd2, 0x04, 0x12 } }, + { 1179, 16, { 0x8, 0xaf, 0xe4, 0xf5, 0x31, 0xf5, 0x30, 0xf5, 0x2f, 0xf5, 0x2e, 0x7f, 0x40, 0x7e, 0x92, 0x7d } }, + { 1195, 16, { 0x4, 0x7c, 0x00, 0xab, 0x31, 0xaa, 0x30, 0xa9, 0x2f, 0xa8, 0x2e, 0xc3, 0x12, 0x08, 0x9e, 0x50 } }, + { 1211, 16, { 0xd6, 0x20, 0x01, 0xd3, 0xe5, 0x31, 0x24, 0x01, 0xf5, 0x31, 0xe4, 0x35, 0x30, 0xf5, 0x30, 0xe4 } }, + { 1227, 16, { 0x35, 0x2f, 0xf5, 0x2f, 0xe4, 0x35, 0x2e, 0xf5, 0x2e, 0x80, 0xd0, 0x53, 0x8e, 0xf8, 0x12, 0x0b } }, + { 1243, 16, { 0x16, 0x30, 0x01, 0x05, 0x12, 0x00, 0x80, 0xc2, 0x01, 0x30, 0x03, 0x1a, 0x12, 0x0b, 0x33, 0x50 } }, + { 1259, 16, { 0x15, 0xc2, 0x03, 0x12, 0x0a, 0x49, 0x20, 0x00, 0x07, 0x90, 0x7f, 0xd6, 0xe0, 0x20, 0xe7, 0xf3 } }, + { 1275, 11, { 0x12, 0x0a, 0xa1, 0x12, 0x0b, 0x35, 0x12, 0x0b, 0x3f, 0x80, 0xd6 } }, + { 128, 16, { 0x90, 0x7f, 0xe9, 0xe0, 0x70, 0x03, 0x02, 0x02, 0x10, 0x14, 0x70, 0x03, 0x02, 0x02, 0x8c, 0x24 } }, + { 144, 16, { 0xfe, 0x70, 0x03, 0x02, 0x03, 0x03, 0x24, 0xfb, 0x70, 0x03, 0x02, 0x02, 0x0a, 0x14, 0x70, 0x03 } }, + { 160, 16, { 0x2, 0x02, 0x04, 0x14, 0x70, 0x03, 0x02, 0x01, 0xf8, 0x14, 0x70, 0x03, 0x02, 0x01, 0xfe, 0x24 } }, + { 176, 16, { 0x5, 0x60, 0x03, 0x02, 0x03, 0x57, 0x12, 0x0b, 0x37, 0x40, 0x03, 0x02, 0x03, 0x63, 0x90, 0x7f } }, + { 192, 16, { 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x45, 0x24, 0x02, 0x60, 0x03, 0x02, 0x01, 0xee } }, + { 208, 16, { 0xe5, 0x08, 0x90, 0x7f, 0xd4, 0xf0, 0xe5, 0x09, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x03, 0x63, 0x90 } }, + { 224, 16, { 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x09, 0x00, 0xaa, 0x06, 0xa9, 0x07, 0x7b, 0x01, 0x8b, 0x36, 0x8a } }, + { 240, 16, { 0x37, 0x89, 0x38, 0xea, 0x49, 0x60, 0x0d, 0xee, 0x90, 0x7f, 0xd4, 0xf0, 0xef, 0x90, 0x7f, 0xd5 } }, + { 256, 16, { 0xf0, 0x02, 0x03, 0x63, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x03, 0x63, 0x90, 0x7f } }, + { 272, 16, { 0xea, 0xe0, 0xff, 0x12, 0x07, 0xc8, 0xaa, 0x06, 0xa9, 0x07, 0x7b, 0x01, 0x8b, 0x36, 0x8a, 0x37 } }, + { 288, 9, { 0x89, 0x38, 0xea, 0x49, 0x70, 0x03, 0x02, 0x01, 0xe4 } }, + { 297, 16, { 0xab, 0x36, 0x8b, 0x3d, 0x8a, 0x3e, 0x89, 0x3f, 0x12, 0x08, 0x58, 0xf5, 0x40, 0x90, 0x7f, 0xee } }, + { 313, 16, { 0xe0, 0xff, 0xe5, 0x40, 0xd3, 0x9f, 0x40, 0x03, 0xe0, 0xf5, 0x40, 0xe5, 0x40, 0x70, 0x03, 0x02 } }, + { 329, 16, { 0x1, 0xd6, 0xe4, 0xf5, 0x3c, 0xf5, 0x3b, 0xf5, 0x3a, 0xf5, 0x39, 0xe5, 0x40, 0xc3, 0x94, 0x40 } }, + { 345, 16, { 0x50, 0x04, 0xaf, 0x40, 0x80, 0x02, 0x7f, 0x40, 0xe4, 0xfc, 0xfd, 0xfe, 0xab, 0x3c, 0xaa, 0x3b } }, + { 361, 16, { 0xa9, 0x3a, 0xa8, 0x39, 0xc3, 0x12, 0x08, 0x9e, 0x50, 0x32, 0xe5, 0x3f, 0x25, 0x3c, 0xf5, 0x82 } }, + { 377, 16, { 0xe5, 0x3e, 0x35, 0x3b, 0xf5, 0x83, 0xe0, 0xff, 0x74, 0x00, 0x25, 0x3c, 0xf5, 0x82, 0xe4, 0x34 } }, + { 393, 16, { 0x7f, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x3c, 0x24, 0x01, 0xf5, 0x3c, 0xe4, 0x35, 0x3b, 0xf5, 0x3b } }, + { 409, 16, { 0xe4, 0x35, 0x3a, 0xf5, 0x3a, 0xe4, 0x35, 0x39, 0xf5, 0x39, 0x80, 0xaf, 0xe5, 0x40, 0xc3, 0x94 } }, + { 425, 16, { 0x40, 0x50, 0x04, 0xaf, 0x40, 0x80, 0x02, 0x7f, 0x40, 0x90, 0x7f, 0xb5, 0xef, 0xf0, 0xe5, 0x40 } }, + { 441, 16, { 0xc3, 0x94, 0x40, 0x50, 0x04, 0xaf, 0x40, 0x80, 0x02, 0x7f, 0x40, 0xc3, 0xe5, 0x40, 0x9f, 0xf5 } }, + { 457, 16, { 0x40, 0x90, 0x7f, 0xb4, 0xe0, 0x20, 0xe2, 0x03, 0x02, 0x01, 0x44, 0x80, 0xf4, 0xe4, 0x90, 0x7f } }, + { 473, 8, { 0xb5, 0xf0, 0x90, 0x7f, 0xb4, 0x74, 0x02, 0xf0 } }, + { 481, 16, { 0x2, 0x03, 0x63, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x03, 0x63, 0x90, 0x7f, 0xb4 } }, + { 497, 16, { 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x03, 0x63, 0x12, 0x0a, 0xfa, 0x02, 0x03, 0x63, 0x12, 0x0b, 0x27 } }, + { 513, 16, { 0x2, 0x03, 0x63, 0x12, 0x0b, 0x1f, 0x02, 0x03, 0x63, 0x12, 0x0a, 0xec, 0x02, 0x03, 0x63, 0x12 } }, + { 529, 16, { 0xb, 0x39, 0x40, 0x03, 0x02, 0x03, 0x63, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14 } }, + { 545, 16, { 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x00, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x02 } }, + { 561, 16, { 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0 } }, + { 577, 16, { 0x2, 0x03, 0x63, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0 } }, + { 593, 16, { 0x2, 0x03, 0x63, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0 } }, + { 609, 16, { 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54 } }, + { 625, 16, { 0x1, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x03 } }, + { 641, 16, { 0x63, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x03, 0x63, 0x12, 0x0b, 0x3b, 0x40, 0x03 } }, + { 657, 16, { 0x2, 0x03, 0x63, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02 } }, + { 673, 16, { 0x3, 0x63, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x00, 0x02, 0x03, 0x63, 0x90, 0x7f } }, + { 689, 16, { 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x03, 0x63, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x3b, 0x90, 0x7f } }, + { 705, 16, { 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0 } }, + { 721, 16, { 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54 } }, + { 737, 16, { 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0 } }, + { 753, 3, { 0xe4, 0xf5, 0x3d } }, + { 756, 16, { 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x69, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x60, 0x12 } }, + { 772, 16, { 0xb, 0x3d, 0x50, 0x5b, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4f } }, + { 788, 16, { 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x00, 0x80, 0x44, 0x90, 0x7f, 0xb4, 0xe0, 0x44 } }, + { 804, 16, { 0x1, 0xf0, 0x80, 0x3b, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54 } }, + { 820, 16, { 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82 } }, + { 836, 16, { 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x15, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01 } }, + { 852, 16, { 0xf0, 0x80, 0x0c, 0x12, 0x0a, 0x26, 0x50, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90 } }, + { 868, 6, { 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0 } }, + { 874, 1, { 0x22 } }, + { 51, 3, { 0x2, 0x0b, 0x2f } }, + { 2863, 4, { 0x53, 0xd8, 0xef, 0x32 } }, + { 1286, 16, { 0x12, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x62, 0x09, 0x01, 0x20, 0x01, 0x00, 0x01, 0x02 } }, + { 1302, 16, { 0x0, 0x01, 0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x00, 0x09, 0x04, 0x00, 0x00, 0x02 } }, + { 1318, 16, { 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x20, 0x00, 0x00, 0x07, 0x05, 0x81, 0x02, 0x20 } }, + { 1334, 16, { 0x0, 0x00, 0x04, 0x03, 0x09, 0x04, 0x26, 0x03, 0x44, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00 } }, + { 1350, 16, { 0x74, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x72, 0x00, 0x74, 0x00, 0x20, 0x00 } }, + { 1366, 16, { 0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x12, 0x03, 0x53, 0x00 } }, + { 1382, 16, { 0x55, 0x00, 0x49, 0x00, 0x44, 0x00, 0x49, 0x00, 0x2d, 0x00, 0x45, 0x00, 0x43, 0x00, 0x00, 0x00 } }, + { 67, 3, { 0x2, 0x08, 0x00 } }, + { 2048, 16, { 0x2, 0x09, 0x42, 0x00, 0x02, 0x09, 0xdc, 0x00, 0x02, 0x09, 0xb7, 0x00, 0x02, 0x09, 0x69, 0x00 } }, + { 2064, 16, { 0x2, 0x0a, 0x01, 0x00, 0x02, 0x0b, 0x40, 0x00, 0x02, 0x0b, 0x41, 0x00, 0x02, 0x0b, 0x42, 0x00 } }, + { 2080, 16, { 0x2, 0x07, 0x6f, 0x00, 0x02, 0x06, 0x53, 0x00, 0x02, 0x0b, 0x43, 0x00, 0x02, 0x0b, 0x44, 0x00 } }, + { 2096, 16, { 0x2, 0x0b, 0x45, 0x00, 0x02, 0x0b, 0x46, 0x00, 0x02, 0x0b, 0x47, 0x00, 0x02, 0x0b, 0x48, 0x00 } }, + { 2112, 16, { 0x2, 0x0b, 0x49, 0x00, 0x02, 0x0b, 0x4a, 0x00, 0x02, 0x0b, 0x4b, 0x00, 0x02, 0x0b, 0x4c, 0x00 } }, + { 2128, 8, { 0x2, 0x0b, 0x4d, 0x00, 0x02, 0x0b, 0x4e, 0x00 } }, + { 2721, 16, { 0x90, 0x7f, 0xd6, 0xe0, 0x30, 0xe7, 0x12, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x14, 0x7e, 0x00, 0x12 } }, + { 2737, 10, { 0xa, 0xd5, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22 } }, + { 2633, 16, { 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22 } }, + { 2223, 7, { 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x08, 0xf0 } }, + { 2230, 3, { 0xe4, 0xf5, 0x36 } }, + { 2233, 4, { 0xe0, 0x54, 0xfb, 0xf0 } }, + { 2237, 3, { 0xe4, 0xf5, 0x36 } }, + { 2240, 16, { 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x04, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xdc, 0x7e, 0x05, 0x12 } }, + { 2256, 16, { 0xa, 0xd5, 0x90, 0x7f, 0x92, 0xe0, 0x30, 0xe3, 0x07, 0x7f, 0xdc, 0x7e, 0x05, 0x12, 0x0a, 0xd5 } }, + { 2272, 16, { 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91 } }, + { 2288, 8, { 0xef, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0 } }, + { 2296, 3, { 0xe4, 0xf5, 0x36 } }, + { 2299, 5, { 0xe0, 0x44, 0x04, 0xf0, 0x22 } }, + { 1992, 2, { 0xa9, 0x07 } }, + { 1994, 16, { 0xae, 0x0c, 0xaf, 0x0d, 0x8f, 0x82, 0x8e, 0x83, 0xa3, 0xe0, 0x64, 0x03, 0x70, 0x17, 0xad, 0x01 } }, + { 2010, 16, { 0x19, 0xed, 0x70, 0x01, 0x22, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0x7c, 0x00, 0x2f, 0xfd, 0xec, 0x3e } }, + { 2026, 9, { 0xfe, 0xaf, 0x05, 0x80, 0xdf, 0x7e, 0x00, 0x7f, 0x00 } }, + { 2035, 1, { 0x22 } }, + { 2304, 16, { 0xe4, 0xfe, 0xac, 0x0a, 0xad, 0x0b, 0x8d, 0x82, 0x8c, 0x83, 0xa3, 0xe0, 0x64, 0x02, 0x70, 0x2d } }, + { 2320, 16, { 0xab, 0x06, 0x0e, 0xeb, 0xb5, 0x07, 0x05, 0xaf, 0x05, 0xae, 0x04, 0x22, 0x8d, 0x82, 0x8c, 0x83 } }, + { 2336, 16, { 0xa3, 0xa3, 0xe0, 0xf5, 0x41, 0xa3, 0xe0, 0xf5, 0x42, 0x62, 0x41, 0xe5, 0x41, 0x62, 0x42, 0xe5 } }, + { 2352, 16, { 0x42, 0x62, 0x41, 0x2d, 0xfb, 0xe5, 0x41, 0x3c, 0xfc, 0xad, 0x03, 0x80, 0xc9, 0x7e, 0x00, 0x7f } }, + { 2368, 1, { 0x0 } }, + { 2369, 1, { 0x22 } }, + { 2773, 16, { 0x8e, 0x37, 0x8f, 0x38, 0xe5, 0x38, 0x15, 0x38, 0xae, 0x37, 0x70, 0x02, 0x15, 0x37, 0x4e, 0x60 } }, + { 2789, 7, { 0x5, 0x12, 0x0a, 0x59, 0x80, 0xee, 0x22 } }, + { 2649, 16, { 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9 } }, + { 2665, 1, { 0x22 } }, + { 2666, 16, { 0xe4, 0xff, 0xfe, 0x7e, 0x02, 0x7f, 0x00, 0x90, 0x0d, 0xff, 0xe4, 0xf0, 0xa3, 0xdf, 0xfc, 0xde } }, + { 2682, 11, { 0xfa, 0x7f, 0x06, 0x12, 0x07, 0x15, 0x90, 0x0f, 0xfe, 0xef, 0xf0 } }, + { 2693, 1, { 0x22 } }, + { 2694, 16, { 0xd2, 0x9f, 0xd2, 0x9e, 0xd2, 0x9d, 0xc2, 0x9c, 0xd2, 0x9b, 0xd2, 0xbc, 0xc2, 0xc9, 0xd2, 0xcc } }, + { 2710, 11, { 0xd2, 0xcd, 0x75, 0xcb, 0xff, 0x75, 0xca, 0xfd, 0xd2, 0xca, 0x22 } }, + { 2448, 16, { 0x90, 0x7f, 0x9b, 0xe0, 0xff, 0x25, 0xe0, 0x25, 0xe0, 0x54, 0x30, 0xff, 0x90, 0x7e, 0x40, 0xe0 } }, + { 2464, 16, { 0x54, 0x0f, 0x4f, 0x90, 0x7e, 0x80, 0xf0, 0x90, 0x7f, 0x9a, 0xe0, 0x90, 0x7e, 0x81, 0xf0, 0xa3 } }, + { 2480, 7, { 0x74, 0x01, 0xf0, 0xe4, 0xa3, 0xf0, 0x22 } }, + { 2838, 9, { 0xc2, 0x99, 0xc2, 0x98, 0xd2, 0xac, 0x02, 0x0a, 0xbb } }, + { 2747, 16, { 0x75, 0xcb, 0xff, 0x75, 0xca, 0xf8, 0x75, 0x10, 0x02, 0x75, 0x11, 0x59, 0xe4, 0xf5, 0x99, 0x90 } }, + { 2763, 10, { 0x7f, 0x9b, 0xe0, 0x64, 0x40, 0x90, 0x7f, 0x98, 0xf0, 0x22 } }, + { 35, 3, { 0x2, 0x05, 0x76 } }, + { 1398, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0 } }, + { 1414, 16, { 0xd0, 0xc2, 0x99, 0xc3, 0xe5, 0x10, 0x94, 0x02, 0x50, 0x19, 0x74, 0xff, 0x25, 0x11, 0xf5, 0x82 } }, + { 1430, 16, { 0x74, 0x0d, 0x35, 0x10, 0xf5, 0x83, 0xe0, 0xf5, 0x99, 0x05, 0x11, 0xe5, 0x11, 0x70, 0x32, 0x05 } }, + { 1446, 16, { 0x10, 0x80, 0x2e, 0xe4, 0xb5, 0x11, 0x0a, 0xe5, 0x10, 0xb4, 0x02, 0x05, 0x12, 0x0a, 0xbb, 0x80 } }, + { 1462, 16, { 0x20, 0xe5, 0x11, 0xb4, 0x59, 0x16, 0xe5, 0x10, 0xb4, 0x02, 0x11, 0x75, 0xcb, 0xff, 0x75, 0xca } }, + { 1478, 16, { 0xfd, 0x75, 0x10, 0x00, 0x75, 0x11, 0x00, 0x75, 0x99, 0x00, 0x80, 0x05, 0x30, 0x98, 0x02, 0xc2 } }, + { 1494, 16, { 0x98, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32 } }, + { 2824, 14, { 0x90, 0x7e, 0x40, 0xe0, 0x54, 0xf0, 0x24, 0x80, 0x70, 0x03, 0x12, 0x05, 0xe6, 0x22 } }, + { 1510, 16, { 0x75, 0x22, 0x01, 0x7a, 0x7e, 0x79, 0x41, 0x75, 0x23, 0x01, 0x75, 0x24, 0x7e, 0x75, 0x25, 0x41 } }, + { 1526, 16, { 0xab, 0x23, 0xaa, 0x24, 0xa9, 0x25, 0x12, 0x08, 0x58, 0x75, 0xf0, 0x02, 0xa4, 0xff, 0xae, 0xf0 } }, + { 1542, 16, { 0x90, 0x00, 0x01, 0x12, 0x08, 0x71, 0xf5, 0x21, 0x74, 0x02, 0x25, 0x25, 0xf5, 0x25, 0xe4, 0x35 } }, + { 1558, 16, { 0x24, 0xf5, 0x24, 0xe5, 0x21, 0x54, 0x0f, 0xfd, 0xed, 0x60, 0x29, 0xab, 0x23, 0xaa, 0x24, 0xa9 } }, + { 1574, 16, { 0x25, 0x12, 0x08, 0x58, 0xfc, 0x74, 0xff, 0x2f, 0xf5, 0x82, 0x74, 0x0d, 0x3e, 0xf5, 0x83, 0xec } }, + { 1590, 16, { 0xf0, 0x74, 0x01, 0x25, 0x25, 0xf5, 0x25, 0xe4, 0x35, 0x24, 0xf5, 0x24, 0x0f, 0xbf, 0x00, 0x01 } }, + { 1606, 12, { 0xe, 0x1d, 0x80, 0xd4, 0xe5, 0x21, 0x54, 0x80, 0xf5, 0x22, 0x70, 0xa4 } }, + { 1618, 1, { 0x22 } }, + { 1813, 16, { 0xae, 0xe8, 0xc2, 0xe9, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0x90, 0x7f, 0xa6, 0x74, 0xa0 } }, + { 1829, 16, { 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0x30, 0xe0, 0xf9, 0x90, 0x7f, 0xa6, 0xef, 0xf0, 0x90, 0x7f, 0xa5 } }, + { 1845, 16, { 0xe0, 0x30, 0xe0, 0xf9, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x80, 0xf0, 0x90, 0x7f, 0xa6, 0x74, 0xa1 } }, + { 1861, 16, { 0xf0, 0x90, 0x7f, 0xa5, 0xe0, 0x30, 0xe0, 0xf9, 0x90, 0x7f, 0xa5, 0xe0, 0x44, 0x20, 0xf0, 0x90 } }, + { 1877, 16, { 0x7f, 0xa6, 0xe0, 0xff, 0x90, 0x7f, 0xa5, 0xe0, 0x30, 0xe0, 0xf9, 0x90, 0x7f, 0xa5, 0xe0, 0x44 } }, + { 1893, 9, { 0x40, 0xf0, 0x90, 0x7f, 0xa6, 0xe0, 0xff, 0x8e, 0xe8 } }, + { 1902, 1, { 0x22 } }, + { 0, 3, { 0x2, 0x07, 0xf4 } }, + { 2036, 12, { 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x42, 0x02, 0x03, 0x6b } }, + { 2136, 16, { 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02 } }, + { 2152, 9, { 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22 } }, + { 2161, 16, { 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50 } }, + { 2177, 16, { 0x6, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22 } }, + { 2193, 13, { 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22 } }, + { 2206, 16, { 0xeb, 0x9f, 0xf5, 0xf0, 0xea, 0x9e, 0x42, 0xf0, 0xe9, 0x9d, 0x42, 0xf0, 0xe8, 0x9c, 0x45, 0xf0 } }, + { 2222, 1, { 0x22 } }, + { 32658, 1, { 0x1 } }, /* reset=1 */ + { 32658, 1, { 0x0 } }, /* reset=0 */ + { SUNLITE_END_OF_FIRMWARE, 0, {0x00}} +}; + + +static const struct sunlite_hex_record sunlite_firmware_in[] = { + {0x7f92, 0x1, {0x01}}, + {0x7f92, 0x1, {0x01}}, + {0x146c, 0x10, {0xC2, 0x00, 0x90, 0x7F, 0xA5, 0xE0, 0x54, 0x18, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0x44, 0x50}}, + {0x147c, 0x10, {0xF5, 0x1C, 0x13, 0x92, 0x01, 0xD2, 0xE8, 0x90, 0x7F, 0xAB, 0x74, 0xFF, 0xF0, 0x90, 0x7F, 0xA9}}, + {0x148c, 0x10, {0xF0, 0x90, 0x7F, 0xAA, 0xF0, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0x95, 0xE0, 0x44, 0xC0, 0xF0, 0x90}}, + {0x149c, 0x10, {0x7F, 0xAF, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x7F, 0xAE, 0xE0, 0x44, 0x05, 0xF0, 0xD2, 0xAF, 0x12}}, + {0x14ac, 0xd, {0x17, 0x5F, 0x30, 0x00, 0xFD, 0x12, 0x11, 0x00, 0xC2, 0x00, 0x80, 0xF6, 0x22}}, + {0x1100, 0x10, {0x90, 0x7F, 0xE9, 0xE0, 0x24, 0x5D, 0x60, 0x0D, 0x14, 0x70, 0x03, 0x02, 0x12, 0x44, 0x24, 0x02}}, + {0x1110, 0x10, {0x60, 0x03, 0x02, 0x12, 0x4A, 0x90, 0x7F, 0xEA, 0xE0, 0x75, 0x08, 0x00, 0xF5, 0x09, 0xA3, 0xE0}}, + {0x1120, 0x10, {0xFE, 0xE4, 0x25, 0x09, 0xF5, 0x09, 0xEE, 0x35, 0x08, 0xF5, 0x08, 0x90, 0x7F, 0xEE, 0xE0, 0x75}}, + {0x1130, 0x10, {0x0A, 0x00, 0xF5, 0x0B, 0xA3, 0xE0, 0xFE, 0xE4, 0x25, 0x0B, 0xF5, 0x0B, 0xEE, 0x35, 0x0A, 0xF5}}, + {0x1140, 0x10, {0x0A, 0x90, 0x7F, 0xE8, 0xE0, 0x64, 0xC0, 0x60, 0x03, 0x02, 0x11, 0xD4, 0xE5, 0x0B, 0x45, 0x0A}}, + {0x1150, 0x10, {0x70, 0x03, 0x02, 0x12, 0x4A, 0xC3, 0xE5, 0x0B, 0x94, 0x40, 0xE5, 0x0A, 0x94, 0x00, 0x50, 0x08}}, + {0x1160, 0x10, {0x85, 0x0A, 0x0C, 0x85, 0x0B, 0x0D, 0x80, 0x06, 0x75, 0x0C, 0x00, 0x75, 0x0D, 0x40, 0x90, 0x7F}}, + {0x1170, 0x10, {0xE9, 0xE0, 0xB4, 0xA3, 0x25, 0xAE, 0x0C, 0xAF, 0x0D, 0xAA, 0x08, 0xA9, 0x09, 0x7B, 0x01, 0xC0}}, + {0x1180, 0x10, {0x03, 0xC0, 0x02, 0xC0, 0x01, 0x7A, 0x7F, 0x79, 0x00, 0x78, 0x00, 0x7C, 0x7F, 0xAD, 0x03, 0xD0}}, + {0x1190, 0x10, {0x01, 0xD0, 0x02, 0xD0, 0x03, 0x12, 0x13, 0x56, 0x80, 0x0F, 0xAF, 0x09, 0xAE, 0x08, 0xAD, 0x0D}}, + {0x11a0, 0x10, {0x7A, 0x7F, 0x79, 0x00, 0x7B, 0x00, 0x12, 0x15, 0xA4, 0x90, 0x7F, 0xB5, 0xE5, 0x0D, 0xF0, 0xE5}}, + {0x11b0, 0x10, {0x0D, 0x25, 0x09, 0xF5, 0x09, 0xE5, 0x0C, 0x35, 0x08, 0xF5, 0x08, 0xC3, 0xE5, 0x0B, 0x95, 0x0D}}, + {0x11c0, 0x10, {0xF5, 0x0B, 0xE5, 0x0A, 0x95, 0x0C, 0xF5, 0x0A, 0x90, 0x7F, 0xB4, 0xE0, 0x20, 0xE2, 0x03, 0x02}}, + {0x11d0, 0x10, {0x11, 0x4C, 0x80, 0xF4, 0x90, 0x7F, 0xE8, 0xE0, 0x64, 0x40, 0x70, 0x6E, 0xE5, 0x0B, 0x45, 0x0A}}, + {0x11e0, 0x10, {0x60, 0x68, 0xE4, 0x90, 0x7F, 0xC5, 0xF0, 0x90, 0x7F, 0xB4, 0xE0, 0x20, 0xE3, 0xF9, 0x90, 0x7F}}, + {0x11f0, 0x10, {0xC5, 0xE0, 0x75, 0x0C, 0x00, 0xF5, 0x0D, 0x90, 0x7F, 0xE9, 0xE0, 0xB4, 0xA3, 0x15, 0xAE, 0x0C}}, + {0x1200, 0x10, {0xAF, 0x0D, 0xA8, 0x09, 0xAC, 0x08, 0x7D, 0x01, 0x7B, 0x01, 0x7A, 0x7E, 0x79, 0xC0, 0x12, 0x13}}, + {0x1210, 0x10, {0x56, 0x80, 0x0F, 0xAF, 0x09, 0xAE, 0x08, 0xAD, 0x0D, 0x7A, 0x7F, 0x79, 0x00, 0x7B, 0x00, 0x12}}, + {0x1220, 0x10, {0x14, 0xB9, 0xE5, 0x0D, 0x25, 0x09, 0xF5, 0x09, 0xE5, 0x0C, 0x35, 0x08, 0xF5, 0x08, 0xC3, 0xE5}}, + {0x1230, 0x10, {0x0B, 0x95, 0x0D, 0xF5, 0x0B, 0xE5, 0x0A, 0x95, 0x0C, 0xF5, 0x0A, 0x90, 0x7F, 0xB4, 0xE0, 0x44}}, + {0x1240, 0xa, {0x02, 0xF0, 0x80, 0x98, 0x90, 0x7F, 0xEA, 0xE0, 0xF5, 0x1C}}, + {0x124a, 0x1, {0x22}}, + {0x1558, 0x6, {0xAB, 0x07, 0xAA, 0x06, 0xAC, 0x05}}, + {0x155e, 0x10, {0xE4, 0xFD, 0x30, 0x01, 0x11, 0xEA, 0xFF, 0xAE, 0x05, 0x0D, 0xEE, 0x24, 0x00, 0xF5, 0x82, 0xE4}}, + {0x156e, 0x10, {0x34, 0xE0, 0xF5, 0x83, 0xEF, 0xF0, 0xEB, 0xAE, 0x05, 0x0D, 0x74, 0x00, 0x2E, 0xF5, 0x82, 0xE4}}, + {0x157e, 0x10, {0x34, 0xE0, 0xF5, 0x83, 0xEB, 0xF0, 0xAF, 0x05, 0x0D, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0xE4, 0x34}}, + {0x158e, 0x10, {0xE0, 0xF5, 0x83, 0xEC, 0xF0, 0xAF, 0x1C, 0x7A, 0xE0, 0x7B, 0x00, 0x12, 0x17, 0x20, 0x7F, 0x0A}}, + {0x159e, 0x5, {0x7E, 0x00, 0x12, 0x17, 0x3C}}, + {0x15a3, 0x1, {0x22}}, + {0x14b9, 0xa, {0x8E, 0x0E, 0x8F, 0x0F, 0x8D, 0x10, 0x8A, 0x11, 0x8B, 0x12}}, + {0x14c3, 0x10, {0xE4, 0xF5, 0x13, 0xE5, 0x13, 0xC3, 0x95, 0x10, 0x50, 0x20, 0x05, 0x0F, 0xE5, 0x0F, 0xAE, 0x0E}}, + {0x14d3, 0x10, {0x70, 0x02, 0x05, 0x0E, 0x14, 0xFF, 0xE5, 0x12, 0x25, 0x13, 0xF5, 0x82, 0xE4, 0x35, 0x11, 0xF5}}, + {0x14e3, 0xa, {0x83, 0xE0, 0xFD, 0x12, 0x15, 0x58, 0x05, 0x13, 0x80, 0xD9}}, + {0x14ed, 0x1, {0x22}}, + {0x15a4, 0xa, {0x8E, 0x0E, 0x8F, 0x0F, 0x8D, 0x10, 0x8A, 0x11, 0x8B, 0x12}}, + {0x15ae, 0x10, {0xE4, 0xFD, 0x30, 0x01, 0x12, 0xE5, 0x0E, 0xFF, 0xAE, 0x05, 0x0D, 0xEE, 0x24, 0x03, 0xF5, 0x82}}, + {0x15be, 0x10, {0xE4, 0x34, 0xE0, 0xF5, 0x83, 0xEF, 0xF0, 0xE5, 0x0F, 0xAE, 0x05, 0x0D, 0x74, 0x03, 0x2E, 0xF5}}, + {0x15ce, 0x10, {0x82, 0xE4, 0x34, 0xE0, 0xF5, 0x83, 0xE5, 0x0F, 0xF0, 0xAF, 0x1C, 0x7A, 0xE0, 0x7B, 0x03, 0x12}}, + {0x15de, 0xd, {0x17, 0x20, 0xAF, 0x1C, 0xAD, 0x10, 0xAB, 0x12, 0xAA, 0x11, 0x12, 0x17, 0x04}}, + {0x15eb, 0x1, {0x22}}, + {0x166e, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0xD2}}, + {0x167e, 0x10, {0x00, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x01, 0xF0, 0xD0, 0x86, 0xD0, 0x84, 0xD0, 0x85}}, + {0x168e, 0x7, {0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x1644, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0x90}}, + {0x1654, 0x10, {0x7F, 0xC4, 0xE4, 0xF0, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x04, 0xF0, 0xD0, 0x86, 0xD0}}, + {0x1664, 0xa, {0x84, 0xD0, 0x85, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x1695, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0x53}}, + {0x16a5, 0x10, {0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x02, 0xF0, 0xD0, 0x86, 0xD0, 0x84, 0xD0, 0x85, 0xD0, 0x82}}, + {0x16b5, 0x5, {0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x16ba, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0x53}}, + {0x16ca, 0x10, {0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x10, 0xF0, 0xD0, 0x86, 0xD0, 0x84, 0xD0, 0x85, 0xD0, 0x82}}, + {0x16da, 0x5, {0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x14ff, 0x1, {0x32}}, + {0x16df, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0x53}}, + {0x16ef, 0x10, {0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x08, 0xF0, 0xD0, 0x86, 0xD0, 0x84, 0xD0, 0x85, 0xD0, 0x82}}, + {0x16ff, 0x5, {0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x1767, 0x1, {0x32}}, + {0x1768, 0x1, {0x32}}, + {0x1769, 0x1, {0x32}}, + {0x176a, 0x1, {0x32}}, + {0x176b, 0x1, {0x32}}, + {0x176c, 0x1, {0x32}}, + {0x176d, 0x1, {0x32}}, + {0x176e, 0x1, {0x32}}, + {0x176f, 0x1, {0x32}}, + {0x1770, 0x1, {0x32}}, + {0x1771, 0x1, {0x32}}, + {0x1772, 0x1, {0x32}}, + {0x1773, 0x1, {0x32}}, + {0x1774, 0x1, {0x32}}, + {0x1775, 0x1, {0x32}}, + {0x1776, 0x1, {0x32}}, + {0x43, 0x3, {0x02, 0x15, 0x00}}, + {0x1500, 0x10, {0x02, 0x16, 0x6E, 0x00, 0x02, 0x16, 0x95, 0x00, 0x02, 0x16, 0x44, 0x00, 0x02, 0x16, 0xDF, 0x00}}, + {0x1510, 0x10, {0x02, 0x16, 0xBA, 0x00, 0x02, 0x14, 0xFF, 0x00, 0x02, 0x17, 0x67, 0x00, 0x02, 0x17, 0x68, 0x00}}, + {0x1520, 0x10, {0x02, 0x17, 0x69, 0x00, 0x02, 0x17, 0x6A, 0x00, 0x02, 0x17, 0x6B, 0x00, 0x02, 0x17, 0x6C, 0x00}}, + {0x1530, 0x10, {0x02, 0x17, 0x6D, 0x00, 0x02, 0x17, 0x6E, 0x00, 0x02, 0x17, 0x6F, 0x00, 0x02, 0x17, 0x70, 0x00}}, + {0x1540, 0x10, {0x02, 0x17, 0x71, 0x00, 0x02, 0x17, 0x72, 0x00, 0x02, 0x17, 0x73, 0x00, 0x02, 0x17, 0x74, 0x00}}, + {0x1550, 0x8, {0x02, 0x17, 0x75, 0x00, 0x02, 0x17, 0x76, 0x00}}, + {0x173c, 0x10, {0x8E, 0x14, 0x8F, 0x15, 0xE5, 0x15, 0x15, 0x15, 0xAE, 0x14, 0x70, 0x02, 0x15, 0x14, 0x4E, 0x60}}, + {0x174c, 0x7, {0x05, 0x12, 0x14, 0xEE, 0x80, 0xEE, 0x22}}, + {0x175f, 0x8, {0xE4, 0xF5, 0x1B, 0xD2, 0xE9, 0xD2, 0xAF, 0x22}}, + {0x1619, 0x10, {0xA9, 0x07, 0xE5, 0x1B, 0x70, 0x23, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x80, 0xF0, 0xE9, 0x25, 0xE0}}, + {0x1629, 0x10, {0x90, 0x7F, 0xA6, 0xF0, 0x8D, 0x16, 0xAF, 0x03, 0xA9, 0x07, 0x75, 0x17, 0x01, 0x8A, 0x18, 0x89}}, + {0x1639, 0xb, {0x19, 0xE4, 0xF5, 0x1A, 0x75, 0x1B, 0x01, 0xD3, 0x22, 0xC3, 0x22}}, + {0x15ec, 0x10, {0xA9, 0x07, 0xE5, 0x1B, 0x70, 0x25, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x80, 0xF0, 0xE9, 0x25, 0xE0}}, + {0x15fc, 0x10, {0x44, 0x01, 0x90, 0x7F, 0xA6, 0xF0, 0x8D, 0x16, 0xAF, 0x03, 0xA9, 0x07, 0x75, 0x17, 0x01, 0x8A}}, + {0x160c, 0xd, {0x18, 0x89, 0x19, 0xE4, 0xF5, 0x1A, 0x75, 0x1B, 0x03, 0xD3, 0x22, 0xC3, 0x22}}, + {0x4b, 0x3, {0x02, 0x13, 0x7F}}, + {0x137f, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0x85, 0xC0, 0x84, 0xC0, 0x86, 0x75, 0x86, 0x00, 0xC0}}, + {0x138f, 0x10, {0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC0, 0x06, 0xC0, 0x07}}, + {0x139f, 0x10, {0x90, 0x7F, 0xA5, 0xE0, 0x30, 0xE2, 0x06, 0x75, 0x1B, 0x06, 0x02, 0x14, 0x4E, 0x90, 0x7F, 0xA5}}, + {0x13af, 0x10, {0xE0, 0x20, 0xE1, 0x0C, 0xE5, 0x1B, 0x64, 0x02, 0x60, 0x06, 0x75, 0x1B, 0x07, 0x02, 0x14, 0x4E}}, + {0x13bf, 0x10, {0xAF, 0x1B, 0xEF, 0x24, 0xFE, 0x60, 0x48, 0x14, 0x60, 0x2C, 0x24, 0xFE, 0x60, 0x77, 0x24, 0x04}}, + {0x13cf, 0x10, {0x60, 0x03, 0x02, 0x14, 0x4E, 0xAB, 0x17, 0xAA, 0x18, 0xA9, 0x19, 0xAF, 0x1A, 0x05, 0x1A, 0x8F}}, + {0x13df, 0x10, {0x82, 0x75, 0x83, 0x00, 0x12, 0x12, 0x4B, 0x90, 0x7F, 0xA6, 0xF0, 0xE5, 0x1A, 0x65, 0x16, 0x70}}, + {0x13ef, 0x10, {0x5E, 0x75, 0x1B, 0x05, 0x80, 0x59, 0x90, 0x7F, 0xA6, 0xE0, 0xAB, 0x17, 0xAA, 0x18, 0xA9, 0x19}}, + {0x13ff, 0x10, {0xAE, 0x1A, 0x8E, 0x82, 0x75, 0x83, 0x00, 0x12, 0x12, 0x78, 0x75, 0x1B, 0x02, 0x80, 0x40, 0xE5}}, + {0x140f, 0x10, {0x16, 0x24, 0xFE, 0xB5, 0x1A, 0x07, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x20, 0xF0, 0xE5, 0x16, 0x14}}, + {0x141f, 0x10, {0xB5, 0x1A, 0x0A, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x40, 0xF0, 0x75, 0x1B, 0x00, 0x90, 0x7F, 0xA6}}, + {0x142f, 0x10, {0xE0, 0xAB, 0x17, 0xAA, 0x18, 0xA9, 0x19, 0xAE, 0x1A, 0x8E, 0x82, 0x75, 0x83, 0x00, 0x12, 0x12}}, + {0x143f, 0x10, {0x78, 0x05, 0x1A, 0x80, 0x0A, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x40, 0xF0, 0x75, 0x1B, 0x00, 0x53}}, + {0x144f, 0x10, {0x91, 0xDF, 0xD0, 0x07, 0xD0, 0x06, 0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0}}, + {0x145f, 0xd, {0xD0, 0x86, 0xD0, 0x84, 0xD0, 0x85, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0x1704, 0x10, {0x12, 0x15, 0xEC, 0xE5, 0x1B, 0x24, 0xFA, 0x60, 0x0E, 0x14, 0x60, 0x06, 0x24, 0x07, 0x70, 0xF3}}, + {0x1714, 0xc, {0xD3, 0x22, 0xE4, 0xF5, 0x1B, 0xD3, 0x22, 0xE4, 0xF5, 0x1B, 0xD3, 0x22}}, + {0x1720, 0x10, {0x12, 0x16, 0x19, 0xE5, 0x1B, 0x24, 0xFA, 0x60, 0x0E, 0x14, 0x60, 0x06, 0x24, 0x07, 0x70, 0xF3}}, + {0x1730, 0xc, {0xD3, 0x22, 0xE4, 0xF5, 0x1B, 0xD3, 0x22, 0xE4, 0xF5, 0x1B, 0xD3, 0x22}}, + {0x14ee, 0x10, {0x74, 0x00, 0xF5, 0x86, 0x90, 0xFD, 0xA5, 0x7C, 0x05, 0xA3, 0xE5, 0x82, 0x45, 0x83, 0x70, 0xF9}}, + {0x14fe, 0x1, {0x22}}, + {0x0, 0x3, {0x02, 0x17, 0x53}}, + {0x1753, 0xc, {0x78, 0x7F, 0xE4, 0xF6, 0xD8, 0xFD, 0x75, 0x81, 0x20, 0x02, 0x14, 0x6C}}, + {0x124b, 0x10, {0xBB, 0x01, 0x0C, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE0, 0x22, 0x50}}, + {0x125b, 0x10, {0x06, 0xE9, 0x25, 0x82, 0xF8, 0xE6, 0x22, 0xBB, 0xFE, 0x06, 0xE9, 0x25, 0x82, 0xF8, 0xE2, 0x22}}, + {0x126b, 0xd, {0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE4, 0x93, 0x22}}, + {0x1278, 0x10, {0xF8, 0xBB, 0x01, 0x0D, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE8, 0xF0}}, + {0x1288, 0x10, {0x22, 0x50, 0x06, 0xE9, 0x25, 0x82, 0xC8, 0xF6, 0x22, 0xBB, 0xFE, 0x05, 0xE9, 0x25, 0x82, 0xC8}}, + {0x1298, 0x2, {0xF2, 0x22}}, + {0x129a, 0x10, {0xE7, 0x09, 0xF6, 0x08, 0xDF, 0xFA, 0x80, 0x46, 0xE7, 0x09, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x3E}}, + {0x12aa, 0x10, {0x88, 0x82, 0x8C, 0x83, 0xE7, 0x09, 0xF0, 0xA3, 0xDF, 0xFA, 0x80, 0x32, 0xE3, 0x09, 0xF6, 0x08}}, + {0x12ba, 0x10, {0xDF, 0xFA, 0x80, 0x6E, 0xE3, 0x09, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x66, 0x88, 0x82, 0x8C, 0x83}}, + {0x12ca, 0x10, {0xE3, 0x09, 0xF0, 0xA3, 0xDF, 0xFA, 0x80, 0x5A, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0xA3, 0xF6, 0x08}}, + {0x12da, 0x10, {0xDF, 0xFA, 0x80, 0x4E, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0xA3, 0xF2, 0x08, 0xDF, 0xFA, 0x80, 0x42}}, + {0x12ea, 0x10, {0x80, 0xD2, 0x80, 0xFA, 0x80, 0xC6, 0x80, 0xD4, 0x80, 0x55, 0x80, 0xF2, 0x80, 0x29, 0x80, 0x10}}, + {0x12fa, 0x10, {0x80, 0xA6, 0x80, 0xEA, 0x80, 0x9A, 0x80, 0xA8, 0x80, 0xDA, 0x80, 0xE2, 0x80, 0xCA, 0x80, 0x29}}, + {0x130a, 0x10, {0x88, 0x84, 0x8C, 0x85, 0x89, 0x82, 0x8A, 0x83, 0xE4, 0x93, 0xA3, 0x05, 0x86, 0xF0, 0xA3, 0x05}}, + {0x131a, 0x10, {0x86, 0xDF, 0xF5, 0xDE, 0xF3, 0x80, 0x0B, 0x89, 0x82, 0x8A, 0x83, 0xE4, 0x93, 0xA3, 0xF6, 0x08}}, + {0x132a, 0x10, {0xDF, 0xF9, 0xEC, 0xFA, 0xA9, 0xF0, 0xED, 0xFB, 0x22, 0x88, 0x84, 0x8C, 0x85, 0x89, 0x82, 0x8A}}, + {0x133a, 0x10, {0x83, 0xE0, 0xA3, 0x05, 0x86, 0xF0, 0xA3, 0x05, 0x86, 0xDF, 0xF6, 0xDE, 0xF4, 0x80, 0xE3, 0x89}}, + {0x134a, 0x10, {0x82, 0x8A, 0x83, 0xE4, 0x93, 0xA3, 0xF2, 0x08, 0xDF, 0xF9, 0x80, 0xD6, 0x88, 0xF0, 0xED, 0x24}}, + {0x135a, 0x10, {0x02, 0xB4, 0x04, 0x00, 0x50, 0xCC, 0xF5, 0x82, 0xEB, 0x24, 0x02, 0xB4, 0x04, 0x00, 0x50, 0xC2}}, + {0x136a, 0x10, {0x23, 0x23, 0x45, 0x82, 0xF5, 0x82, 0xEF, 0x4E, 0x60, 0xB8, 0xEF, 0x60, 0x01, 0x0E, 0xE5, 0x82}}, + {0x137a, 0x5, {0x23, 0x90, 0x12, 0xEA, 0x73}}, + {0x7f92, 0x1, {0x00}}, + {0x7f92, 0x1, {0x01}}, + {0xb29, 0x10, {0xD2, 0x00, 0x90, 0x7F, 0xA1, 0x74, 0x01, 0xF0, 0xE4, 0x90, 0x7F, 0x93, 0xF0, 0x90, 0x7F, 0x94}}, + {0xb39, 0x10, {0xF0, 0x90, 0x7F, 0x95, 0x74, 0x03, 0xF0, 0x90, 0x7F, 0x9C, 0x74, 0x30, 0xF0, 0xE4, 0x90, 0x7F}}, + {0xb49, 0x10, {0x9D, 0xF0, 0x90, 0x7F, 0x9E, 0x74, 0xF2, 0xF0, 0xE4, 0x90, 0x7F, 0x96, 0xF0, 0x90, 0x7F, 0x98}}, + {0xb59, 0x10, {0x74, 0xF2, 0xF0, 0x12, 0x0D, 0x28, 0x12, 0x0D, 0xFE, 0x90, 0x7F, 0xDE, 0xE0, 0x44, 0x04, 0xF0}}, + {0xb69, 0x10, {0x90, 0x7F, 0xDF, 0xE0, 0x44, 0x02, 0xF0, 0x90, 0x7F, 0xAD, 0xE0, 0x44, 0x02, 0xF0, 0x12, 0x09}}, + {0xb79, 0x2, {0x26, 0x22}}, + {0xe32, 0x4, {0x12, 0x03, 0x4F, 0x22}}, + {0xe3a, 0x2, {0xD3, 0x22}}, + {0xe3c, 0x2, {0xD3, 0x22}}, + {0xe3e, 0x2, {0xD3, 0x22}}, + {0xbf8, 0x8, {0x90, 0x7F, 0xEA, 0xE0, 0xF5, 0x0F, 0xD3, 0x22}}, + {0xe0e, 0xe, {0x90, 0x7F, 0x00, 0xE5, 0x0F, 0xF0, 0x90, 0x7F, 0xB5, 0x74, 0x01, 0xF0, 0xD3, 0x22}}, + {0xe2a, 0x8, {0x90, 0x7F, 0xEA, 0xE0, 0xF5, 0x0E, 0xD3, 0x22}}, + {0xe1c, 0xe, {0x90, 0x7F, 0x00, 0xE5, 0x0E, 0xF0, 0x90, 0x7F, 0xB5, 0x74, 0x01, 0xF0, 0xD3, 0x22}}, + {0xe40, 0x2, {0xD3, 0x22}}, + {0xe42, 0x2, {0xD3, 0x22}}, + {0xe44, 0x2, {0xD3, 0x22}}, + {0xce4, 0x10, {0x90, 0x7F, 0xE8, 0xE0, 0x30, 0xE6, 0x1A, 0xA3, 0xE0, 0x24, 0xF0, 0x70, 0x12, 0x7F, 0x06, 0x12}}, + {0xcf4, 0x10, {0x0A, 0xCF, 0x90, 0x7F, 0x00, 0xEF, 0xF0, 0x90, 0x7F, 0xB5, 0x74, 0x01, 0xF0, 0x80, 0x02, 0xD3}}, + {0xd04, 0x3, {0x22, 0xC3, 0x22}}, + {0xd5f, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xD2, 0x01, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x01}}, + {0xd6f, 0x8, {0xF0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0xda6, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x04, 0xF0, 0xD0}}, + {0xdb6, 0x6, {0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0xdbc, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x02, 0xF0, 0xD0}}, + {0xdcc, 0x6, {0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0xdd2, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x10, 0xF0, 0xD0}}, + {0xde2, 0x6, {0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0xe46, 0x1, {0x32}}, + {0xd77, 0x10, {0xC0, 0xE0, 0xC0, 0x83, 0xC0, 0x82, 0xD2, 0x03, 0x53, 0x91, 0xEF, 0x90, 0x7F, 0xAB, 0x74, 0x08}}, + {0xd87, 0x8, {0xF0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xE0, 0x32}}, + {0xe47, 0x1, {0x32}}, + {0xe48, 0x1, {0x32}}, + {0xe49, 0x1, {0x32}}, + {0xe4a, 0x1, {0x32}}, + {0xe4b, 0x1, {0x32}}, + {0xe4c, 0x1, {0x32}}, + {0xe4d, 0x1, {0x32}}, + {0xe4e, 0x1, {0x32}}, + {0xe4f, 0x1, {0x32}}, + {0xe50, 0x1, {0x32}}, + {0xe51, 0x1, {0x32}}, + {0xe52, 0x1, {0x32}}, + {0xe53, 0x1, {0x32}}, + {0xe54, 0x1, {0x32}}, + {0xe55, 0x1, {0x32}}, + {0xe56, 0x1, {0x32}}, + {0xa5f, 0x10, {0x12, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x62, 0x09, 0x01, 0x30, 0x01, 0x11, 0x01, 0x02}}, + {0xa6f, 0x10, {0x00, 0x01, 0x09, 0x02, 0x20, 0x00, 0x01, 0x01, 0x00, 0xA0, 0x64, 0x09, 0x04, 0x00, 0x00, 0x02}}, + {0xa7f, 0x10, {0xFF, 0x00, 0x00, 0x00, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40}}, + {0xa8f, 0x10, {0x00, 0x00, 0x04, 0x03, 0x09, 0x04, 0x26, 0x03, 0x44, 0x00, 0x69, 0x00, 0x67, 0x00, 0x69, 0x00}}, + {0xa9f, 0x10, {0x74, 0x00, 0x61, 0x00, 0x6C, 0x00, 0x20, 0x00, 0x41, 0x00, 0x72, 0x00, 0x74, 0x00, 0x20, 0x00}}, + {0xaaf, 0x10, {0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6D, 0x00, 0x12, 0x03, 0x53, 0x00}}, + {0xabf, 0x10, {0x49, 0x00, 0x55, 0x00, 0x44, 0x00, 0x49, 0x00, 0x2D, 0x00, 0x49, 0x00, 0x4E, 0x00, 0x00, 0x00}}, + {0x524, 0x10, {0xE4, 0xF5, 0x2C, 0xF5, 0x2B, 0xF5, 0x2A, 0xF5, 0x29, 0xC2, 0x03, 0xC2, 0x00, 0xC2, 0x02, 0xC2}}, + {0x534, 0x10, {0x01, 0x12, 0x0B, 0x29, 0x7E, 0x0A, 0x7F, 0x5F, 0x8E, 0x08, 0x8F, 0x09, 0x75, 0x0A, 0x0A, 0x75}}, + {0x544, 0x10, {0x0B, 0x71, 0x75, 0x0C, 0x0A, 0x75, 0x0D, 0x91, 0xEE, 0x54, 0xE0, 0x70, 0x02, 0xC1, 0x37, 0x75}}, + {0x554, 0x10, {0x2D, 0x00, 0x75, 0x2E, 0x80, 0x8E, 0x2F, 0x8F, 0x30, 0xC3, 0x74, 0xCD, 0x9F, 0xFF, 0x74, 0x0A}}, + {0x564, 0x10, {0x9E, 0xCF, 0x24, 0x02, 0xCF, 0x34, 0x00, 0xFE, 0xE4, 0x8F, 0x28, 0x8E, 0x27, 0xF5, 0x26, 0xF5}}, + {0x574, 0x10, {0x25, 0xF5, 0x24, 0xF5, 0x23, 0xF5, 0x22, 0xF5, 0x21, 0xAF, 0x28, 0xAE, 0x27, 0xAD, 0x26, 0xAC}}, + {0x584, 0x10, {0x25, 0xAB, 0x24, 0xAA, 0x23, 0xA9, 0x22, 0xA8, 0x21, 0xC3, 0x12, 0x08, 0x2C, 0x50, 0x2A, 0xE5}}, + {0x594, 0x10, {0x2E, 0x25, 0x24, 0xF5, 0x82, 0xE5, 0x2D, 0x35, 0x23, 0xF5, 0x83, 0x74, 0xCD, 0xF0, 0xE4, 0xFA}}, + {0x5a4, 0x10, {0xF9, 0xF8, 0xE5, 0x24, 0x24, 0x01, 0xF5, 0x24, 0xEA, 0x35, 0x23, 0xF5, 0x23, 0xE9, 0x35, 0x22}}, + {0x5b4, 0x10, {0xF5, 0x22, 0xE8, 0x35, 0x21, 0xF5, 0x21, 0x80, 0xC0, 0xE4, 0xF5, 0x24, 0xF5, 0x23, 0xF5, 0x22}}, + {0x5c4, 0x10, {0xF5, 0x21, 0xAF, 0x28, 0xAE, 0x27, 0xAD, 0x26, 0xAC, 0x25, 0xAB, 0x24, 0xAA, 0x23, 0xA9, 0x22}}, + {0x5d4, 0x10, {0xA8, 0x21, 0xC3, 0x12, 0x08, 0x2C, 0x50, 0x35, 0xAE, 0x23, 0xAF, 0x24, 0xE5, 0x30, 0x2F, 0xF5}}, + {0x5e4, 0x10, {0x82, 0xE5, 0x2F, 0x3E, 0xF5, 0x83, 0xE0, 0xFD, 0xE5, 0x2E, 0x2F, 0xF5, 0x82, 0xE5, 0x2D, 0x3E}}, + {0x5f4, 0x10, {0xF5, 0x83, 0xED, 0xF0, 0xE4, 0xFA, 0xF9, 0xF8, 0xEF, 0x24, 0x01, 0xF5, 0x24, 0xEA, 0x3E, 0xF5}}, + {0x604, 0x10, {0x23, 0xE9, 0x35, 0x22, 0xF5, 0x22, 0xE8, 0x35, 0x21, 0xF5, 0x21, 0x80, 0xB5, 0x85, 0x2D, 0x08}}, + {0x614, 0x10, {0x85, 0x2E, 0x09, 0x74, 0x5F, 0x24, 0x80, 0xFF, 0x74, 0x0A, 0x34, 0xFF, 0xFE, 0xC3, 0xE5, 0x0B}}, + {0x624, 0x10, {0x9F, 0xF5, 0x0B, 0xE5, 0x0A, 0x9E, 0xF5, 0x0A, 0xC3, 0xE5, 0x0D, 0x9F, 0xF5, 0x0D, 0xE5, 0x0C}}, + {0x634, 0x10, {0x9E, 0xF5, 0x0C, 0xD2, 0xE8, 0x43, 0xD8, 0x20, 0x90, 0x7F, 0xAB, 0x74, 0xFF, 0xF0, 0x90, 0x7F}}, + {0x644, 0x10, {0xAF, 0xE0, 0x44, 0x01, 0xF0, 0x90, 0x7F, 0xAE, 0xE0, 0x44, 0x1D, 0xF0, 0xD2, 0xAF, 0x20, 0x01}}, + {0x654, 0x10, {0x45, 0x20, 0x01, 0x05, 0xD2, 0x05, 0x12, 0x0B, 0x7B, 0xE4, 0xF5, 0x2C, 0xF5, 0x2B, 0xF5, 0x2A}}, + {0x664, 0x10, {0xF5, 0x29, 0x7F, 0x40, 0x7E, 0x92, 0x7D, 0x04, 0x7C, 0x00, 0xAB, 0x2C, 0xAA, 0x2B, 0xA9, 0x2A}}, + {0x674, 0x10, {0xA8, 0x29, 0xC3, 0x12, 0x08, 0x2C, 0x50, 0xD6, 0x20, 0x01, 0xD3, 0xE4, 0xFA, 0xF9, 0xF8, 0xE5}}, + {0x684, 0x10, {0x2C, 0x24, 0x01, 0xF5, 0x2C, 0xEA, 0x35, 0x2B, 0xF5, 0x2B, 0xE9, 0x35, 0x2A, 0xF5, 0x2A, 0xE8}}, + {0x694, 0x10, {0x35, 0x29, 0xF5, 0x29, 0x80, 0xCC, 0x53, 0x8E, 0xF8, 0x30, 0x01, 0x05, 0x12, 0x00, 0x80, 0xC2}}, + {0x6a4, 0x10, {0x01, 0x30, 0x03, 0x1A, 0x12, 0x0E, 0x3A, 0x50, 0x15, 0xC2, 0x03, 0x12, 0x0D, 0x07, 0x20, 0x00}}, + {0x6b4, 0x10, {0x07, 0x90, 0x7F, 0xD6, 0xE0, 0x20, 0xE7, 0xF3, 0x12, 0x0D, 0x45, 0x12, 0x0E, 0x3C, 0x12, 0x0E}}, + {0x6c4, 0x3, {0x32, 0x80, 0xD6}}, + {0x6c7, 0x1, {0x22}}, + {0x80, 0x10, {0x90, 0x7F, 0xE9, 0xE0, 0x70, 0x02, 0x21, 0xFD, 0x14, 0x70, 0x02, 0x41, 0x74, 0x24, 0xFE, 0x70}}, + {0x90, 0x10, {0x02, 0x41, 0xE7, 0x24, 0xFB, 0x70, 0x02, 0x21, 0xF8, 0x14, 0x70, 0x02, 0x21, 0xF3, 0x14, 0x70}}, + {0xa0, 0x10, {0x02, 0x21, 0xE9, 0x14, 0x70, 0x02, 0x21, 0xEE, 0x24, 0x05, 0x60, 0x02, 0x61, 0x3B, 0x12, 0x0E}}, + {0xb0, 0x10, {0x3E, 0x40, 0x02, 0x61, 0x47, 0x90, 0x7F, 0xEB, 0xE0, 0x24, 0xFE, 0x60, 0x17, 0x14, 0x60, 0x41}}, + {0xc0, 0x10, {0x24, 0x02, 0x60, 0x02, 0x21, 0xE0, 0xE5, 0x08, 0x90, 0x7F, 0xD4, 0xF0, 0xE5, 0x09, 0x90, 0x7F}}, + {0xd0, 0x10, {0xD5, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xEA, 0xE0, 0xFF, 0x12, 0x0C, 0xA2, 0xAA, 0x06, 0xA9, 0x07}}, + {0xe0, 0x10, {0x7B, 0x01, 0x8B, 0x31, 0x8A, 0x32, 0x89, 0x33, 0xEA, 0x49, 0x60, 0x0C, 0xEE, 0x90, 0x7F, 0xD4}}, + {0xf0, 0x10, {0xF0, 0xEF, 0x90, 0x7F, 0xD5, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x61}}, + {0x100, 0x10, {0x47, 0x90, 0x7F, 0xEA, 0xE0, 0xFF, 0x12, 0x0B, 0xCC, 0xAA, 0x06, 0xA9, 0x07, 0x7B, 0x01, 0x8B}}, + {0x110, 0xb, {0x31, 0x8A, 0x32, 0x89, 0x33, 0xEA, 0x49, 0x70, 0x02, 0x21, 0xD7}}, + {0x11b, 0x10, {0xAB, 0x31, 0x8B, 0x38, 0x8A, 0x39, 0x89, 0x3A, 0x12, 0x06, 0xC8, 0xF5, 0x3B, 0x90, 0x7F, 0xEE}}, + {0x12b, 0x10, {0xE0, 0xFF, 0xE5, 0x3B, 0xD3, 0x9F, 0x40, 0x03, 0xE0, 0xF5, 0x3B, 0xE5, 0x3B, 0x70, 0x02, 0x21}}, + {0x13b, 0x10, {0xCA, 0xE4, 0xF5, 0x37, 0xF5, 0x36, 0xF5, 0x35, 0xF5, 0x34, 0xE5, 0x3B, 0xC3, 0x94, 0x40, 0x50}}, + {0x14b, 0x10, {0x04, 0xAF, 0x3B, 0x80, 0x02, 0x7F, 0x40, 0xE4, 0xFC, 0xFD, 0xFE, 0xAB, 0x37, 0xAA, 0x36, 0xA9}}, + {0x15b, 0x10, {0x35, 0xA8, 0x34, 0xC3, 0x12, 0x08, 0x2C, 0x50, 0x36, 0xE5, 0x3A, 0x25, 0x37, 0xF5, 0x82, 0xE5}}, + {0x16b, 0x10, {0x39, 0x35, 0x36, 0xF5, 0x83, 0xE0, 0xFF, 0x74, 0x00, 0x25, 0x37, 0xF5, 0x82, 0xE4, 0x34, 0x7F}}, + {0x17b, 0x10, {0xF5, 0x83, 0xEF, 0xF0, 0xE4, 0xFA, 0xF9, 0xF8, 0xE5, 0x37, 0x24, 0x01, 0xF5, 0x37, 0xEA, 0x35}}, + {0x18b, 0x10, {0x36, 0xF5, 0x36, 0xE9, 0x35, 0x35, 0xF5, 0x35, 0xE8, 0x35, 0x34, 0xF5, 0x34, 0x80, 0xAB, 0xE5}}, + {0x19b, 0x10, {0x3B, 0xC3, 0x94, 0x40, 0x50, 0x04, 0xAF, 0x3B, 0x80, 0x02, 0x7F, 0x40, 0x90, 0x7F, 0xB5, 0xEF}}, + {0x1ab, 0x10, {0xF0, 0xE5, 0x3B, 0xC3, 0x94, 0x40, 0x50, 0x04, 0xAF, 0x3B, 0x80, 0x02, 0x7F, 0x40, 0xC3, 0xE5}}, + {0x1bb, 0x10, {0x3B, 0x9F, 0xF5, 0x3B, 0x90, 0x7F, 0xB4, 0xE0, 0x20, 0xE2, 0x02, 0x21, 0x36, 0x80, 0xF5, 0xE4}}, + {0x1cb, 0xa, {0x90, 0x7F, 0xB5, 0xF0, 0x90, 0x7F, 0xB4, 0x74, 0x02, 0xF0}}, + {0x1d5, 0x10, {0x61, 0x47, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xB4, 0xE0, 0x44}}, + {0x1e5, 0x10, {0x01, 0xF0, 0x61, 0x47, 0x12, 0x0E, 0x1C, 0x61, 0x47, 0x12, 0x0E, 0x2A, 0x61, 0x47, 0x12, 0x0B}}, + {0x1f5, 0x10, {0xF8, 0x61, 0x47, 0x12, 0x0E, 0x0E, 0x61, 0x47, 0x12, 0x0E, 0x40, 0x40, 0x02, 0x61, 0x47, 0x90}}, + {0x205, 0x10, {0x7F, 0xE8, 0xE0, 0x24, 0x7F, 0x60, 0x23, 0x14, 0x60, 0x2F, 0x24, 0x02, 0x70, 0x58, 0xA2, 0x00}}, + {0x215, 0x10, {0xE4, 0x33, 0xFF, 0x25, 0xE0, 0xFF, 0xA2, 0x02, 0xE4, 0x33, 0x4F, 0x90, 0x7F, 0x00, 0xF0, 0xE4}}, + {0x225, 0x10, {0xA3, 0xF0, 0x90, 0x7F, 0xB5, 0x74, 0x02, 0xF0, 0x61, 0x47, 0xE4, 0x90, 0x7F, 0x00, 0xF0, 0xA3}}, + {0x235, 0x10, {0xF0, 0x90, 0x7F, 0xB5, 0x74, 0x02, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xEC, 0xE0, 0xF4, 0x54, 0x80}}, + {0x245, 0x10, {0xFF, 0xC4, 0x54, 0x0F, 0xFF, 0xE0, 0x54, 0x07, 0x2F, 0x25, 0xE0, 0x24, 0xB4, 0xF5, 0x82, 0xE4}}, + {0x255, 0x10, {0x34, 0x7F, 0xF5, 0x83, 0xE0, 0x54, 0x01, 0x90, 0x7F, 0x00, 0xF0, 0xE4, 0xA3, 0xF0, 0x90, 0x7F}}, + {0x265, 0x10, {0xB5, 0x74, 0x02, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x61, 0x47, 0x12}}, + {0x275, 0x10, {0x0E, 0x42, 0x40, 0x02, 0x61, 0x47, 0x90, 0x7F, 0xE8, 0xE0, 0x24, 0xFE, 0x60, 0x1A, 0x24, 0x02}}, + {0x285, 0x10, {0x60, 0x02, 0x61, 0x47, 0x90, 0x7F, 0xEA, 0xE0, 0xB4, 0x01, 0x04, 0xC2, 0x00, 0x61, 0x47, 0x90}}, + {0x295, 0x10, {0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x61, 0x47, 0x90, 0x7F, 0xEA, 0xE0, 0x70, 0x3B, 0x90, 0x7F}}, + {0x2a5, 0x10, {0xEC, 0xE0, 0xF4, 0x54, 0x80, 0xFF, 0xC4, 0x54, 0x0F, 0xFF, 0xE0, 0x54, 0x07, 0x2F, 0x25, 0xE0}}, + {0x2b5, 0x10, {0x24, 0xB4, 0xF5, 0x82, 0xE4, 0x34, 0x7F, 0xF5, 0x83, 0xE4, 0xF0, 0x90, 0x7F, 0xEC, 0xE0, 0x54}}, + {0x2c5, 0x10, {0x80, 0xFF, 0x13, 0x13, 0x13, 0x54, 0x1F, 0xFF, 0xE0, 0x54, 0x07, 0x2F, 0x90, 0x7F, 0xD7, 0xF0}}, + {0x2d5, 0x3, {0xE4, 0xF5, 0x38}}, + {0x2d8, 0x10, {0xE0, 0x44, 0x20, 0xF0, 0x80, 0x69, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x80, 0x60, 0x12}}, + {0x2e8, 0x10, {0x0E, 0x44, 0x50, 0x5B, 0x90, 0x7F, 0xE8, 0xE0, 0x24, 0xFE, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4F}}, + {0x2f8, 0x10, {0x90, 0x7F, 0xEA, 0xE0, 0xB4, 0x01, 0x04, 0xD2, 0x00, 0x80, 0x44, 0x90, 0x7F, 0xB4, 0xE0, 0x44}}, + {0x308, 0x10, {0x01, 0xF0, 0x80, 0x3B, 0x90, 0x7F, 0xEA, 0xE0, 0x70, 0x20, 0x90, 0x7F, 0xEC, 0xE0, 0xF4, 0x54}}, + {0x318, 0x10, {0x80, 0xFF, 0xC4, 0x54, 0x0F, 0xFF, 0xE0, 0x54, 0x07, 0x2F, 0x25, 0xE0, 0x24, 0xB4, 0xF5, 0x82}}, + {0x328, 0x10, {0xE4, 0x34, 0x7F, 0xF5, 0x83, 0x74, 0x01, 0xF0, 0x80, 0x15, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01}}, + {0x338, 0x10, {0xF0, 0x80, 0x0C, 0x12, 0x0C, 0xE4, 0x50, 0x07, 0x90, 0x7F, 0xB4, 0xE0, 0x44, 0x01, 0xF0, 0x90}}, + {0x348, 0x6, {0x7F, 0xB4, 0xE0, 0x44, 0x02, 0xF0}}, + {0x34e, 0x1, {0x22}}, + {0x33, 0x3, {0x02, 0x0E, 0x36}}, + {0xe36, 0x4, {0x53, 0xD8, 0xEF, 0x32}}, + {0x43, 0x3, {0x02, 0x0C, 0x00}}, + {0xc00, 0x10, {0x02, 0x0D, 0x5F, 0x00, 0x02, 0x0D, 0xBC, 0x00, 0x02, 0x0D, 0xA6, 0x00, 0x02, 0x0D, 0x77, 0x00}}, + {0xc10, 0x10, {0x02, 0x0D, 0xD2, 0x00, 0x02, 0x0E, 0x46, 0x00, 0x02, 0x0E, 0x47, 0x00, 0x02, 0x0E, 0x48, 0x00}}, + {0xc20, 0x10, {0x02, 0x0E, 0x49, 0x00, 0x02, 0x0E, 0x4A, 0x00, 0x02, 0x0E, 0x4B, 0x00, 0x02, 0x0E, 0x4C, 0x00}}, + {0xc30, 0x10, {0x02, 0x0E, 0x4D, 0x00, 0x02, 0x0E, 0x4E, 0x00, 0x02, 0x0E, 0x4F, 0x00, 0x02, 0x0E, 0x50, 0x00}}, + {0xc40, 0x10, {0x02, 0x0E, 0x51, 0x00, 0x02, 0x0E, 0x52, 0x00, 0x02, 0x0E, 0x53, 0x00, 0x02, 0x0E, 0x54, 0x00}}, + {0xc50, 0x8, {0x02, 0x0E, 0x55, 0x00, 0x02, 0x0E, 0x56, 0x00}}, + {0xd45, 0x10, {0x90, 0x7F, 0xD6, 0xE0, 0x30, 0xE7, 0x12, 0xE0, 0x44, 0x01, 0xF0, 0x7F, 0x14, 0x7E, 0x00, 0x12}}, + {0xd55, 0xa, {0x0D, 0x8F, 0x90, 0x7F, 0xD6, 0xE0, 0x54, 0xFE, 0xF0, 0x22}}, + {0xd07, 0x10, {0x90, 0x7F, 0xD6, 0xE0, 0x44, 0x80, 0xF0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22}}, + {0xb7b, 0x7, {0x90, 0x7F, 0xD6, 0xE0, 0x44, 0x08, 0xF0}}, + {0xb82, 0x3, {0xE4, 0xF5, 0x31}}, + {0xb85, 0x4, {0xE0, 0x54, 0xFB, 0xF0}}, + {0xb89, 0x3, {0xE4, 0xF5, 0x31}}, + {0xb8c, 0x10, {0xE0, 0x44, 0x08, 0xF0, 0x30, 0x05, 0x04, 0xE0, 0x44, 0x02, 0xF0, 0x7F, 0xDC, 0x7E, 0x05, 0x12}}, + {0xb9c, 0x10, {0x0D, 0x8F, 0x90, 0x7F, 0x92, 0xE0, 0x30, 0xE3, 0x07, 0x7F, 0xDC, 0x7E, 0x05, 0x12, 0x0D, 0x8F}}, + {0xbac, 0x10, {0x90, 0x7F, 0xAB, 0x74, 0xFF, 0xF0, 0x90, 0x7F, 0xA9, 0xF0, 0x90, 0x7F, 0xAA, 0xF0, 0x53, 0x91}}, + {0xbbc, 0x8, {0xEF, 0x90, 0x7F, 0xD6, 0xE0, 0x54, 0xF7, 0xF0}}, + {0xbc4, 0x3, {0xE4, 0xF5, 0x31}}, + {0xbc7, 0x5, {0xE0, 0x44, 0x04, 0xF0, 0x22}}, + {0xbcc, 0x2, {0xA9, 0x07}}, + {0xbce, 0x10, {0xAE, 0x0C, 0xAF, 0x0D, 0x8F, 0x82, 0x8E, 0x83, 0xA3, 0xE0, 0x64, 0x03, 0x70, 0x17, 0xAD, 0x01}}, + {0xbde, 0x10, {0x19, 0xED, 0x70, 0x01, 0x22, 0x8F, 0x82, 0x8E, 0x83, 0xE0, 0x7C, 0x00, 0x2F, 0xFD, 0xEC, 0x3E}}, + {0xbee, 0x9, {0xFE, 0xAF, 0x05, 0x80, 0xDF, 0x7E, 0x00, 0x7F, 0x00}}, + {0xbf7, 0x1, {0x22}}, + {0xca2, 0x10, {0xE4, 0xFE, 0xAC, 0x0A, 0xAD, 0x0B, 0x8D, 0x82, 0x8C, 0x83, 0xA3, 0xE0, 0x64, 0x02, 0x70, 0x2D}}, + {0xcb2, 0x10, {0xAB, 0x06, 0x0E, 0xEB, 0xB5, 0x07, 0x05, 0xAF, 0x05, 0xAE, 0x04, 0x22, 0x8D, 0x82, 0x8C, 0x83}}, + {0xcc2, 0x10, {0xA3, 0xA3, 0xE0, 0xF5, 0x3C, 0xA3, 0xE0, 0xF5, 0x3D, 0x62, 0x3C, 0xE5, 0x3C, 0x62, 0x3D, 0xE5}}, + {0xcd2, 0x10, {0x3D, 0x62, 0x3C, 0x2D, 0xFB, 0xE5, 0x3C, 0x3C, 0xFC, 0xAD, 0x03, 0x80, 0xC9, 0x7E, 0x00, 0x7F}}, + {0xce2, 0x1, {0x00}}, + {0xce3, 0x1, {0x22}}, + {0xd8f, 0x10, {0x8E, 0x32, 0x8F, 0x33, 0xE5, 0x33, 0x15, 0x33, 0xAE, 0x32, 0x70, 0x02, 0x15, 0x32, 0x4E, 0x60}}, + {0xd9f, 0x7, {0x05, 0x12, 0x0D, 0x17, 0x80, 0xEE, 0x22}}, + {0xd17, 0x10, {0x74, 0x00, 0xF5, 0x86, 0x90, 0xFD, 0xA5, 0x7C, 0x05, 0xA3, 0xE5, 0x82, 0x45, 0x83, 0x70, 0xF9}}, + {0xd27, 0x1, {0x22}}, + {0xde8, 0x10, {0x02, 0x46, 0x00, 0x00, 0x02, 0x49, 0x00, 0x00, 0x01, 0x48, 0x01, 0x01, 0x4B, 0x03, 0x01, 0x4C}}, + {0xdf8, 0x5, {0x00, 0x02, 0x44, 0x00, 0x00}}, + {0x926, 0x10, {0xE4, 0xFF, 0xFE, 0x74, 0x00, 0x2F, 0xF5, 0x82, 0x74, 0x20, 0x3E, 0xF5, 0x83, 0xE4, 0xF0, 0x74}}, + {0x936, 0x10, {0x06, 0x2F, 0xF5, 0x82, 0x74, 0x22, 0x3E, 0xF5, 0x83, 0xE4, 0xF0, 0x74, 0x0C, 0x2F, 0xF5, 0x82}}, + {0x946, 0x10, {0x74, 0x24, 0x3E, 0xF5, 0x83, 0xE4, 0xF0, 0x0F, 0xBF, 0x00, 0x01, 0x0E, 0xBE, 0x02, 0xD4, 0xBF}}, + {0x956, 0x10, {0x01, 0xD1, 0x90, 0x22, 0x01, 0x74, 0x02, 0xF0, 0xA3, 0x14, 0xF0, 0x90, 0x24, 0x07, 0x04, 0xF0}}, + {0x966, 0x10, {0xA3, 0x14, 0xF0, 0xE4, 0x90, 0x26, 0x0D, 0xF0, 0xA3, 0xF0, 0x90, 0x22, 0x03, 0x04, 0xF0, 0x90}}, + {0x976, 0x10, {0x24, 0x09, 0xF0, 0xE4, 0x90, 0x26, 0x0F, 0xF0, 0x90, 0x22, 0x04, 0xF0, 0x90, 0x24, 0x0A, 0xF0}}, + {0x986, 0x10, {0x90, 0x26, 0x10, 0xF0, 0x90, 0x22, 0x05, 0xF0, 0x90, 0x24, 0x0B, 0xF0, 0x90, 0x26, 0x11, 0xF0}}, + {0x996, 0x10, {0x75, 0x3E, 0x01, 0x75, 0x3F, 0x20, 0x75, 0x40, 0x00, 0x75, 0x41, 0x01, 0x75, 0x42, 0x24, 0x75}}, + {0x9a6, 0x10, {0x43, 0x0C, 0xF5, 0x46, 0xF5, 0x47, 0xD2, 0x04, 0x75, 0x48, 0x01, 0x75, 0x4B, 0x03, 0x90, 0x7F}}, + {0x9b6, 0x10, {0x9B, 0xE0, 0x44, 0x20, 0x90, 0x7F, 0x98, 0xF0, 0x90, 0x7F, 0x9B, 0xE0, 0x44, 0x40, 0x90, 0x7F}}, + {0x9c6, 0xc, {0x98, 0xF0, 0x90, 0x7F, 0x9B, 0xE0, 0x44, 0x80, 0x90, 0x7F, 0x98, 0xF0}}, + {0x9d2, 0x1, {0x22}}, + {0xd28, 0x10, {0xD2, 0x9F, 0xD2, 0x9E, 0xD2, 0x9D, 0xD2, 0x9C, 0xC2, 0x9A, 0xD2, 0xBC, 0xC2, 0xC9, 0xC2, 0xCC}}, + {0xd38, 0xd, {0xD2, 0xCD, 0x75, 0xCB, 0xFF, 0x75, 0xCA, 0xFD, 0xD2, 0xAC, 0xD2, 0xCA, 0x22}}, + {0xdfe, 0x10, {0xC2, 0x8C, 0x75, 0x89, 0x0A, 0x75, 0x8C, 0xB0, 0x75, 0x8A, 0xB0, 0xD2, 0xA9, 0xD2, 0x8C, 0x22}}, + {0x34f, 0x10, {0xE4, 0xF5, 0x31, 0xF5, 0x32, 0x90, 0x7F, 0xB8, 0xE0, 0x30, 0xE1, 0x02, 0xA1, 0x23, 0xAB, 0x3E}}, + {0x35f, 0x10, {0xAA, 0x3F, 0xA9, 0x40, 0x90, 0x02, 0x03, 0x12, 0x06, 0xE1, 0x64, 0x01, 0x60, 0x02, 0xA1, 0x15}}, + {0x36f, 0x10, {0x90, 0x02, 0x05, 0x12, 0x06, 0xE1, 0x60, 0x02, 0xA1, 0x15, 0x30, 0x04, 0x25, 0x90, 0x02, 0x01}}, + {0x37f, 0x10, {0x12, 0x07, 0x5B, 0xAE, 0xF0, 0x90, 0x7E, 0x00, 0xF0, 0xEE, 0xFF, 0x33, 0x95, 0xE0, 0xEF, 0xA3}}, + {0x38f, 0x10, {0xF0, 0x75, 0x32, 0x02, 0xC2, 0x04, 0x90, 0x7F, 0x9B, 0xE0, 0x64, 0x80, 0x90, 0x7F, 0x98, 0xF0}}, + {0x39f, 0x10, {0x80, 0x03, 0xE4, 0xF5, 0x32, 0xAB, 0x3E, 0xAA, 0x3F, 0xA9, 0x40, 0x90, 0x02, 0x01, 0x12, 0x07}}, + {0x3af, 0x10, {0x5B, 0xFF, 0xAD, 0x32, 0xED, 0x33, 0x95, 0xE0, 0xFC, 0xC3, 0x74, 0x40, 0x9D, 0xFD, 0xE4, 0x9C}}, + {0x3bf, 0x10, {0xFC, 0xD3, 0xEF, 0x9D, 0xEC, 0x64, 0x80, 0xF8, 0xE5, 0xF0, 0x64, 0x80, 0x98, 0x50, 0x02, 0x81}}, + {0x3cf, 0x10, {0x51, 0xE4, 0xF5, 0x31, 0xC3, 0x74, 0x40, 0x95, 0x32, 0xC3, 0x64, 0x80, 0xF8, 0xE5, 0x31, 0x64}}, + {0x3df, 0x10, {0x80, 0x98, 0x50, 0x3C, 0xAB, 0x3E, 0xAA, 0x3F, 0xA9, 0x40, 0x85, 0x47, 0x82, 0x85, 0x46, 0x83}}, + {0x3ef, 0x10, {0x12, 0x06, 0xE1, 0xFF, 0xE5, 0x32, 0xFD, 0x33, 0x95, 0xE0, 0xFC, 0xE5, 0x31, 0xFB, 0x33, 0x95}}, + {0x3ff, 0x10, {0xE0, 0xFA, 0xEB, 0x2D, 0xFD, 0xEA, 0x3C, 0xFC, 0x74, 0x00, 0x2D, 0xF5, 0x82, 0x74, 0x7E, 0x3C}}, + {0x40f, 0x10, {0xF5, 0x83, 0xEF, 0xF0, 0x05, 0x47, 0xE5, 0x47, 0x70, 0x02, 0x05, 0x46, 0x05, 0x31, 0x80, 0xB4}}, + {0x41f, 0x10, {0x90, 0x7F, 0xB9, 0x74, 0x40, 0xF0, 0xAB, 0x3E, 0xE5, 0x40, 0x24, 0x01, 0xF9, 0xE5, 0x3F, 0x34}}, + {0x42f, 0x10, {0x02, 0xFA, 0x12, 0x07, 0x30, 0xFF, 0xAD, 0x32, 0xED, 0x33, 0x95, 0xE0, 0xFC, 0xC3, 0x74, 0x40}}, + {0x43f, 0x10, {0x9D, 0xFD, 0xE4, 0x9C, 0xFC, 0xC3, 0xEF, 0x9D, 0xFF, 0xE5, 0xF0, 0x9C, 0x8F, 0xF0, 0x12, 0x07}}, + {0x44f, 0x10, {0xE0, 0x22, 0xE4, 0xF5, 0x31, 0xAB, 0x3E, 0xAA, 0x3F, 0xA9, 0x40, 0x90, 0x02, 0x01, 0x12, 0x07}}, + {0x45f, 0x10, {0x5B, 0xFF, 0xAD, 0x32, 0xED, 0x33, 0x95, 0xE0, 0xFC, 0xC3, 0xEF, 0x9D, 0xFF, 0xE5, 0xF0, 0x9C}}, + {0x46f, 0x10, {0xFE, 0xAD, 0x31, 0xED, 0x33, 0x95, 0xE0, 0xFC, 0xC3, 0xED, 0x9F, 0xEE, 0x64, 0x80, 0xF8, 0xEC}}, + {0x47f, 0x10, {0x64, 0x80, 0x98, 0x50, 0x36, 0x85, 0x47, 0x82, 0x85, 0x46, 0x83, 0x12, 0x06, 0xE1, 0xFF, 0xE5}}, + {0x48f, 0x10, {0x32, 0xFD, 0x33, 0x95, 0xE0, 0xFC, 0xE5, 0x31, 0xFB, 0x33, 0x95, 0xE0, 0xFA, 0xEB, 0x2D, 0xFD}}, + {0x49f, 0x10, {0xEA, 0x3C, 0xFC, 0x74, 0x00, 0x2D, 0xF5, 0x82, 0x74, 0x7E, 0x3C, 0xF5, 0x83, 0xEF, 0xF0, 0x05}}, + {0x4af, 0x10, {0x47, 0xE5, 0x47, 0x70, 0x02, 0x05, 0x46, 0x05, 0x31, 0x80, 0x9A, 0xAB, 0x3E, 0xAA, 0x3F, 0xA9}}, + {0x4bf, 0x10, {0x40, 0x90, 0x02, 0x01, 0x12, 0x07, 0x5B, 0x25, 0x32, 0x90, 0x7F, 0xB9, 0xF0, 0xE4, 0xF5, 0x46}}, + {0x4cf, 0x10, {0xF5, 0x47, 0x90, 0x02, 0x03, 0x12, 0x07, 0x0E, 0xD2, 0x04, 0x90, 0x02, 0x04, 0x74, 0x01, 0x12}}, + {0x4df, 0x10, {0x07, 0x0E, 0xE5, 0x48, 0x24, 0xFE, 0x60, 0x14, 0x14, 0x60, 0x1E, 0x24, 0x02, 0x70, 0x35, 0x75}}, + {0x4ef, 0x10, {0x3E, 0x01, 0x75, 0x3F, 0x22, 0x75, 0x40, 0x06, 0x75, 0x48, 0x02, 0x22, 0x75, 0x3E, 0x01, 0x75}}, + {0x4ff, 0x10, {0x3F, 0x24, 0x75, 0x40, 0x0C, 0x75, 0x48, 0x03, 0x22, 0x75, 0x3E, 0x01, 0x75, 0x3F, 0x20, 0x75}}, + {0x50f, 0x10, {0x40, 0x00, 0x75, 0x48, 0x01, 0x22, 0x90, 0x7E, 0x00, 0x74, 0xFF, 0xF0, 0xA3, 0xF0, 0x90, 0x7F}}, + {0x51f, 0x4, {0xB9, 0x74, 0x02, 0xF0}}, + {0x523, 0x1, {0x22}}, + {0x23, 0x3, {0x02, 0x0C, 0x58}}, + {0xc58, 0x10, {0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x10, 0x75, 0x8A, 0xB0}}, + {0xc68, 0x10, {0xD2, 0x8C, 0xC2, 0x98, 0xAB, 0x41, 0xAA, 0x42, 0xA9, 0x43, 0x85, 0x4A, 0x82, 0x85, 0x49, 0x83}}, + {0xc78, 0x10, {0xE5, 0x99, 0x12, 0x07, 0x0E, 0x05, 0x4A, 0xE5, 0x4A, 0x70, 0x02, 0x05, 0x49, 0x90, 0x02, 0x01}}, + {0xc88, 0x10, {0xE4, 0x75, 0xF0, 0x01, 0x12, 0x07, 0x93, 0x90, 0x02, 0x03, 0x74, 0x01, 0x12, 0x07, 0x0E, 0xD0}}, + {0xc98, 0xa, {0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0, 0xD0, 0xE0, 0x32}}, + {0xb, 0x3, {0x02, 0x08, 0x53}}, + {0x853, 0x10, {0xC0, 0xE0, 0xC0, 0xF0, 0xC0, 0x83, 0xC0, 0x82, 0xC0, 0xD0, 0x75, 0xD0, 0x00, 0xC0, 0x00, 0xC0}}, + {0x863, 0x10, {0x01, 0xC0, 0x02, 0xC0, 0x03, 0xC2, 0x8C, 0x90, 0x7F, 0x9B, 0xE0, 0x64, 0x40, 0x90, 0x7F, 0x98}}, + {0x873, 0x10, {0xF0, 0xAB, 0x41, 0xAA, 0x42, 0xA9, 0x43, 0x90, 0x02, 0x03, 0x12, 0x06, 0xE1, 0x64, 0x01, 0x70}}, + {0x883, 0x10, {0x6B, 0xE5, 0x4B, 0x24, 0xFE, 0x60, 0x23, 0x14, 0x60, 0x42, 0x24, 0x02, 0x70, 0x5E, 0x90, 0x24}}, + {0x893, 0x10, {0x0A, 0xE0, 0x64, 0x01, 0x70, 0x56, 0x90, 0x02, 0x05, 0x12, 0x07, 0x0E, 0x75, 0x41, 0x01, 0x75}}, + {0x8a3, 0x10, {0x42, 0x22, 0x75, 0x43, 0x06, 0x75, 0x4B, 0x02, 0x80, 0x42, 0x90, 0x26, 0x10, 0xE0, 0x64, 0x01}}, + {0x8b3, 0x10, {0x70, 0x3A, 0xAB, 0x41, 0xAA, 0x42, 0xA9, 0x43, 0x90, 0x02, 0x05, 0x12, 0x07, 0x0E, 0x75, 0x41}}, + {0x8c3, 0x10, {0x01, 0x75, 0x42, 0x24, 0x75, 0x43, 0x0C, 0x75, 0x4B, 0x03, 0x80, 0x20, 0x90, 0x22, 0x04, 0xE0}}, + {0x8d3, 0x10, {0xB4, 0x01, 0x19, 0xAB, 0x41, 0xAA, 0x42, 0xA9, 0x43, 0x90, 0x02, 0x05, 0xE4, 0x12, 0x07, 0x0E}}, + {0x8e3, 0x10, {0x75, 0x41, 0x01, 0x75, 0x42, 0x20, 0x75, 0x43, 0x00, 0x75, 0x4B, 0x01, 0xAB, 0x41, 0xAA, 0x42}}, + {0x8f3, 0x10, {0xA9, 0x43, 0x90, 0x02, 0x05, 0x74, 0x01, 0x12, 0x07, 0x0E, 0x90, 0x02, 0x04, 0xE4, 0x12, 0x07}}, + {0x903, 0x10, {0x0E, 0x75, 0x49, 0x00, 0x75, 0x4A, 0x00, 0x90, 0x02, 0x01, 0xE4, 0xF5, 0xF0, 0x12, 0x07, 0xFF}}, + {0x913, 0x10, {0xD0, 0x03, 0xD0, 0x02, 0xD0, 0x01, 0xD0, 0x00, 0xD0, 0xD0, 0xD0, 0x82, 0xD0, 0x83, 0xD0, 0xF0}}, + {0x923, 0x3, {0xD0, 0xE0, 0x32}}, + {0xacf, 0x10, {0xAE, 0xE8, 0xC2, 0xE9, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x7F, 0xA6, 0x74, 0xA0}}, + {0xadf, 0x10, {0xF0, 0x90, 0x7F, 0xA5, 0xE0, 0x30, 0xE0, 0xF9, 0x90, 0x7F, 0xA6, 0xEF, 0xF0, 0x90, 0x7F, 0xA5}}, + {0xaef, 0x10, {0xE0, 0x30, 0xE0, 0xF9, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x80, 0xF0, 0x90, 0x7F, 0xA6, 0x74, 0xA1}}, + {0xaff, 0x10, {0xF0, 0x90, 0x7F, 0xA5, 0xE0, 0x30, 0xE0, 0xF9, 0x90, 0x7F, 0xA5, 0xE0, 0x44, 0x20, 0xF0, 0x90}}, + {0xb0f, 0x10, {0x7F, 0xA6, 0xE0, 0xFF, 0x90, 0x7F, 0xA5, 0xE0, 0x30, 0xE0, 0xF9, 0x90, 0x7F, 0xA5, 0xE0, 0x44}}, + {0xb1f, 0x9, {0x40, 0xF0, 0x90, 0x7F, 0xA6, 0xE0, 0xFF, 0x8E, 0xE8}}, + {0xb28, 0x1, {0x22}}, + {0x0, 0x3, {0x02, 0x09, 0xD3}}, + {0x9d3, 0xc, {0x78, 0x7F, 0xE4, 0xF6, 0xD8, 0xFD, 0x75, 0x81, 0x4C, 0x02, 0x0A, 0x1A}}, + {0x6c8, 0x10, {0xBB, 0x01, 0x06, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0x22, 0x50, 0x02, 0xE7, 0x22, 0xBB, 0xFE, 0x02}}, + {0x6d8, 0x9, {0xE3, 0x22, 0x89, 0x82, 0x8A, 0x83, 0xE4, 0x93, 0x22}}, + {0x6e1, 0x10, {0xBB, 0x01, 0x0C, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE0, 0x22, 0x50}}, + {0x6f1, 0x10, {0x06, 0xE9, 0x25, 0x82, 0xF8, 0xE6, 0x22, 0xBB, 0xFE, 0x06, 0xE9, 0x25, 0x82, 0xF8, 0xE2, 0x22}}, + {0x701, 0xd, {0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE4, 0x93, 0x22}}, + {0x70e, 0x10, {0xF8, 0xBB, 0x01, 0x0D, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE8, 0xF0}}, + {0x71e, 0x10, {0x22, 0x50, 0x06, 0xE9, 0x25, 0x82, 0xC8, 0xF6, 0x22, 0xBB, 0xFE, 0x05, 0xE9, 0x25, 0x82, 0xC8}}, + {0x72e, 0x2, {0xF2, 0x22}}, + {0x730, 0x10, {0xBB, 0x01, 0x0A, 0x89, 0x82, 0x8A, 0x83, 0xE0, 0xF5, 0xF0, 0xA3, 0xE0, 0x22, 0x50, 0x06, 0x87}}, + {0x740, 0x10, {0xF0, 0x09, 0xE7, 0x19, 0x22, 0xBB, 0xFE, 0x07, 0xE3, 0xF5, 0xF0, 0x09, 0xE3, 0x19, 0x22, 0x89}}, + {0x750, 0xb, {0x82, 0x8A, 0x83, 0xE4, 0x93, 0xF5, 0xF0, 0x74, 0x01, 0x93, 0x22}}, + {0x75b, 0x10, {0xBB, 0x01, 0x10, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE0, 0xF5, 0xF0}}, + {0x76b, 0x10, {0xA3, 0xE0, 0x22, 0x50, 0x09, 0xE9, 0x25, 0x82, 0xF8, 0x86, 0xF0, 0x08, 0xE6, 0x22, 0xBB, 0xFE}}, + {0x77b, 0x10, {0x0A, 0xE9, 0x25, 0x82, 0xF8, 0xE2, 0xF5, 0xF0, 0x08, 0xE2, 0x22, 0xE5, 0x83, 0x2A, 0xF5, 0x83}}, + {0x78b, 0x8, {0xE9, 0x93, 0xF5, 0xF0, 0xA3, 0xE9, 0x93, 0x22}}, + {0x793, 0x10, {0xBB, 0x01, 0x0D, 0xC5, 0x82, 0x29, 0xC5, 0x82, 0xC5, 0x83, 0x3A, 0xC5, 0x83, 0x02, 0x08, 0x3D}}, + {0x7a3, 0x10, {0x50, 0x11, 0xC5, 0x82, 0x29, 0xF8, 0x08, 0xE5, 0xF0, 0x26, 0xF6, 0x18, 0xF5, 0xF0, 0xE5, 0x82}}, + {0x7b3, 0x10, {0x36, 0xF6, 0x22, 0xBB, 0xFE, 0x11, 0xC5, 0x82, 0x29, 0xF8, 0x08, 0xE2, 0x25, 0xF0, 0xF5, 0xF0}}, + {0x7c3, 0x10, {0xF2, 0x18, 0xE2, 0x35, 0x82, 0xF2, 0x22, 0xF8, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x2A}}, + {0x7d3, 0xd, {0xF5, 0x83, 0x74, 0x01, 0x93, 0x25, 0xF0, 0xF5, 0xF0, 0xE4, 0x93, 0x38, 0x22}}, + {0x7e0, 0x10, {0xBB, 0x01, 0x0A, 0x89, 0x82, 0x8A, 0x83, 0xF0, 0xE5, 0xF0, 0xA3, 0xF0, 0x22, 0x50, 0x06, 0xF7}}, + {0x7f0, 0xf, {0x09, 0xA7, 0xF0, 0x19, 0x22, 0xBB, 0xFE, 0x06, 0xF3, 0xE5, 0xF0, 0x09, 0xF3, 0x19, 0x22}}, + {0x7ff, 0x10, {0xF8, 0xBB, 0x01, 0x11, 0xE5, 0x82, 0x29, 0xF5, 0x82, 0xE5, 0x83, 0x3A, 0xF5, 0x83, 0xE8, 0xF0}}, + {0x80f, 0x10, {0xE5, 0xF0, 0xA3, 0xF0, 0x22, 0x50, 0x09, 0xE9, 0x25, 0x82, 0xC8, 0xF6, 0x08, 0xA6, 0xF0, 0x22}}, + {0x81f, 0xd, {0xBB, 0xFE, 0x09, 0xE9, 0x25, 0x82, 0xC8, 0xF2, 0xE5, 0xF0, 0x08, 0xF2, 0x22}}, + {0x82c, 0x10, {0xEB, 0x9F, 0xF5, 0xF0, 0xEA, 0x9E, 0x42, 0xF0, 0xE9, 0x9D, 0x42, 0xF0, 0xE8, 0x9C, 0x45, 0xF0}}, + {0x83c, 0x1, {0x22}}, + {0x9df, 0x10, {0x02, 0x05, 0x24, 0xE4, 0x93, 0xA3, 0xF8, 0xE4, 0x93, 0xA3, 0x40, 0x03, 0xF6, 0x80, 0x01, 0xF2}}, + {0x9ef, 0x10, {0x08, 0xDF, 0xF4, 0x80, 0x29, 0xE4, 0x93, 0xA3, 0xF8, 0x54, 0x07, 0x24, 0x0C, 0xC8, 0xC3, 0x33}}, + {0x9ff, 0x10, {0xC4, 0x54, 0x0F, 0x44, 0x20, 0xC8, 0x83, 0x40, 0x04, 0xF4, 0x56, 0x80, 0x01, 0x46, 0xF6, 0xDF}}, + {0xa0f, 0x10, {0xE4, 0x80, 0x0B, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x0D, 0xE8, 0xE4, 0x7E}}, + {0xa1f, 0x10, {0x01, 0x93, 0x60, 0xBC, 0xA3, 0xFF, 0x54, 0x3F, 0x30, 0xE5, 0x09, 0x54, 0x1F, 0xFE, 0xE4, 0x93}}, + {0xa2f, 0x10, {0xA3, 0x60, 0x01, 0x0E, 0xCF, 0x54, 0xC0, 0x25, 0xE0, 0x60, 0xA8, 0x40, 0xB8, 0xE4, 0x93, 0xA3}}, + {0xa3f, 0x10, {0xFA, 0xE4, 0x93, 0xA3, 0xF8, 0xE4, 0x93, 0xA3, 0xC8, 0xC5, 0x82, 0xC8, 0xCA, 0xC5, 0x83, 0xCA}}, + {0xa4f, 0x10, {0xF0, 0xA3, 0xC8, 0xC5, 0x82, 0xC8, 0xCA, 0xC5, 0x83, 0xCA, 0xDF, 0xE9, 0xDE, 0xE7, 0x80, 0xBE}}, + {0xdfd, 0x1, {0x00}}, + {0x83d, 0x10, {0xC5, 0xF0, 0xF8, 0xA3, 0xE0, 0x28, 0xF0, 0xC5, 0xF0, 0xF8, 0xE5, 0x82, 0x15, 0x82, 0x70, 0x02}}, + {0x84d, 0x6, {0x15, 0x83, 0xE0, 0x38, 0xF0, 0x22}}, + {0x7f92, 0x1, {0x01}}, + {0x7f92, 0x1, {0x00}}, + {SUNLITE_END_OF_FIRMWARE, 0, {0x00}} +}; + +#endif // PLUGINS_USBDMX_SUNLITEFIRMWARE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.cpp new file mode 100644 index 0000000..ffa71ea --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.cpp @@ -0,0 +1,75 @@ +/* + * 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 Library 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. + * + * SunliteFirmwareLoader.cpp + * Load the firmware onto a USBDMX2 device. + * Copyright (C) 2010 Simon Newton + */ + +#include "ola/Logging.h" +#include "plugins/usbdmx/SunliteFirmware.h" +#include "plugins/usbdmx/SunliteFirmwareLoader.h" + + +namespace ola { +namespace plugin { +namespace usbdmx { + + +/* + * Load the firmware + */ +bool SunliteFirmwareLoader::LoadFirmware() { + libusb_device_handle *handle; + + if (libusb_open(m_device, &handle)) { + OLA_WARN << "Failed to open sunlite device"; + return false; + } + + if (libusb_claim_interface(handle, INTERFACE_NUMBER)) { + OLA_WARN << "Failed to claim sunlite device."; + libusb_close(handle); + return false; + } + + const struct sunlite_hex_record *record = sunlite_firmware; + + while (record->address != SUNLITE_END_OF_FIRMWARE) { + int ret = libusb_control_transfer( + handle, + UPLOAD_REQUEST_TYPE, + UPLOAD_REQUEST, + record->address, + 0, + (unsigned char*) record->data, + record->data_size, + UPLOAD_TIMEOUT); + if (ret != record->data_size) { + OLA_WARN << "Sunlite firmware load failed, address: " << record->address + << ", ret value was " << ret; + libusb_release_interface(handle, INTERFACE_NUMBER); + libusb_close(handle); + } + record++; + } + + libusb_release_interface(handle, INTERFACE_NUMBER); + libusb_close(handle); + return true; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.h new file mode 100644 index 0000000..b74eb04 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteFirmwareLoader.h @@ -0,0 +1,53 @@ +/* + * 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 Library 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. + * + * SunliteFirmwareLoader.h + * Load the firmware onto a USBDMX2 device + * Copyright (C) 2010 Simon Newton + * + * The Soundlite USBDMX2 interfaces require firmware to be loaded when they're + * connected, this performs that job. + */ + +#ifndef PLUGINS_USBDMX_SUNLITEFIRMWARELOADER_H_ +#define PLUGINS_USBDMX_SUNLITEFIRMWARELOADER_H_ + +#include +#include "plugins/usbdmx/FirmwareLoader.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +class SunliteFirmwareLoader: public FirmwareLoader { + public: + explicit SunliteFirmwareLoader(libusb_device *usb_device) + : m_device(usb_device) {} + ~SunliteFirmwareLoader() {} + + bool LoadFirmware(); + + private: + libusb_device *m_device; + + static const int INTERFACE_NUMBER = 0; // the device only has 1 interface + static const uint8_t UPLOAD_REQUEST_TYPE = 0x40; + static const uint8_t UPLOAD_REQUEST = 0xa0; + static const unsigned int UPLOAD_TIMEOUT = 300; // ms +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_SUNLITEFIRMWARELOADER_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.cpp new file mode 100644 index 0000000..abd8ddd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.cpp @@ -0,0 +1,208 @@ +/* + * 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 Library 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. + * + * SunliteOutputPort.cpp + * Thread for the Sunlite USBDMX2 Output Port + * Copyright (C) 2010 Simon Newton + * + * See the comments in SunliteOutputPort.h + */ + +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/SunliteOutputPort.h" +#include "plugins/usbdmx/SunliteDevice.h" + + +namespace ola { +namespace plugin { +namespace usbdmx { + + +/* + * Create a new SunliteOutputPort object + */ +SunliteOutputPort::SunliteOutputPort(SunliteDevice *parent, + unsigned int id, + libusb_device *usb_device) + : BasicOutputPort(parent, id), + m_term(false), + m_new_data(false), + m_usb_device(usb_device), + m_usb_handle(NULL) { + pthread_mutex_init(&m_data_mutex, NULL); + pthread_mutex_init(&m_term_mutex, NULL); + InitPacket(); +} + + +/* + * Cleanup + */ +SunliteOutputPort::~SunliteOutputPort() { + pthread_mutex_lock(&m_term_mutex); + m_term = true; + pthread_mutex_unlock(&m_term_mutex); + Join(); + + pthread_mutex_destroy(&m_term_mutex); + pthread_mutex_destroy(&m_data_mutex); +} + + +/* + * Start this thread + */ +bool SunliteOutputPort::Start() { + libusb_device_handle *usb_handle; + + if (libusb_open(m_usb_device, &usb_handle)) { + OLA_WARN << "Failed to open Sunlite usb device"; + return false; + } + + if (libusb_claim_interface(usb_handle, 0)) { + OLA_WARN << "Failed to claim Sunlite usb device"; + libusb_close(usb_handle); + return false; + } + + m_usb_handle = usb_handle; + bool ret = OlaThread::Start(); + if (!ret) { + OLA_WARN << "pthread create failed"; + libusb_release_interface(m_usb_handle, 0); + libusb_close(usb_handle); + return false; + } + return true; +} + + +/* + * Run this thread + */ +void *SunliteOutputPort::Run() { + DmxBuffer buffer; + bool new_data; + + if (!m_usb_handle) + return NULL; + + while (true) { + pthread_mutex_lock(&m_term_mutex); + if (m_term) { + pthread_mutex_unlock(&m_term_mutex); + break; + } + pthread_mutex_unlock(&m_term_mutex); + + pthread_mutex_lock(&m_data_mutex); + buffer.Set(m_buffer); + new_data = m_new_data; + m_new_data = false; + pthread_mutex_unlock(&m_data_mutex); + + if (new_data) { + if (!SendDMX(buffer)) { + OLA_WARN << "Send failed, stopping thread..."; + break; + } + } else { + // sleep for a bit + usleep(40000); + } + } + libusb_release_interface(m_usb_handle, 0); + libusb_close(m_usb_handle); + return NULL; +} + + +/* + * Store the data in the shared buffer + */ +bool SunliteOutputPort::WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + pthread_mutex_lock(&m_data_mutex); + m_buffer.Set(buffer); + m_new_data = true; + pthread_mutex_unlock(&m_data_mutex); + return true; +} + + +/* + * Setup the packet we send to the device. + * + * The packet is divided into 26 chunks of 32 bytes each. Each chunk contains + * the data for 20 channels (except the last one which has 12 channels of data) + */ +void SunliteOutputPort::InitPacket() { + // zero everything + memset(m_packet, 0, SUNLITE_PACKET_SIZE); + + for (unsigned int chunk = 0; chunk < CHUNKS_PER_PACKET; ++chunk) { + unsigned int i = chunk * CHUNK_SIZE; // index into the packet + unsigned int channel = chunk * CHANNELS_PER_CHUNK; + + m_packet[i] = 0x80; + m_packet[i+1] = channel / 2; + m_packet[i+2] = 0x84; + m_packet[i+7] = channel / 2 + 2; + m_packet[i+8] = 0x84; + m_packet[i+13] = channel / 2 + 4; + if (chunk < CHUNKS_PER_PACKET - 1) { + m_packet[i+14] = 0x84; + m_packet[i+19] = channel / 2 + 6; + m_packet[i+20] = 0x84; + m_packet[i+25] = channel / 2 + 8; + m_packet[i+26] = 0x04; + m_packet[i+31] = 0x00; + } else { + // the last m_packet is short + m_packet[i+14] = 0x04; + } + } +} + + +/* + * Send DMX to the widget + */ +bool SunliteOutputPort::SendDMX(const DmxBuffer &buffer) { + unsigned int i; + + for (unsigned int i = 0; i < buffer.Size(); i++) + m_packet[(i / CHANNELS_PER_CHUNK) * CHUNK_SIZE + + ((i / 4) % 5) * 6 + 3 + (i % 4)] = buffer.Get(i); + + int transferred; + int r = libusb_bulk_transfer( + m_usb_handle, + ENDPOINT, + (unsigned char*) m_packet, + SUNLITE_PACKET_SIZE, + &transferred, + TIMEOUT); + if (transferred != SUNLITE_PACKET_SIZE) + // not sure if this is fatal or not + OLA_WARN << "Sunlite driver failed to transfer all data"; + return r == 0; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.h new file mode 100644 index 0000000..1ba5930 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/SunliteOutputPort.h @@ -0,0 +1,78 @@ +/* + * 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 Library 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. + * + * SunliteOutputPort.h + * The output port for a Sunlite USBDMX2 device. + * Copyright (C) 2010 Simon Newton + * + * It takes around 11ms to complete the transfer to the device so we use a + * a separate thread for the writes. The time to acquire the lock, copy the + * buffer & release is 1-2 uS. + */ + +#ifndef PLUGINS_USBDMX_SUNLITEOUTPUTPORT_H_ +#define PLUGINS_USBDMX_SUNLITEOUTPUTPORT_H_ + +#include +#include +#include +#include "ola/DmxBuffer.h" +#include "ola/OlaThread.h" +#include "olad/Port.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +class SunliteDevice; + +class SunliteOutputPort: public BasicOutputPort, OlaThread { + public: + SunliteOutputPort(SunliteDevice *parent, + unsigned int id, + libusb_device *usb_device); + ~SunliteOutputPort(); + + bool Start(); + void *Run(); + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return ""; } + + private: + enum {SUNLITE_PACKET_SIZE = 0x340}; + + static const unsigned int CHUNKS_PER_PACKET = 26; + static const unsigned int CHANNELS_PER_CHUNK = 20; + static const unsigned int CHUNK_SIZE = 32; + static const uint8_t ENDPOINT = 1; + static const unsigned int TIMEOUT = 50; // 50ms is ok + + bool m_term; + bool m_new_data; + uint8_t m_packet[SUNLITE_PACKET_SIZE]; + libusb_device *m_usb_device; + libusb_device_handle *m_usb_handle; + DmxBuffer m_buffer; + pthread_mutex_t m_data_mutex; + pthread_mutex_t m_term_mutex; + + void InitPacket(); + bool SendDMX(const DmxBuffer &buffer); +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_SUNLITEOUTPUTPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDevice.h new file mode 100644 index 0000000..d7972f0 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDevice.h @@ -0,0 +1,55 @@ +/* + * 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * UsbDevice.h + * Interface for the generic usb device + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_USBDEVICE_H_ +#define PLUGINS_USBDMX_USBDEVICE_H_ + +#include +#include +#include "olad/Device.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +/* + * A Usb device, this is just like the generic Device class but it has a + * Start() method as well to do the USB setup. + */ +class UsbDevice: public ola::Device { + public: + UsbDevice(ola::AbstractPlugin *owner, + const string &name, + libusb_device *device): + Device(owner, name), + m_usb_device(device) { + libusb_ref_device(device); + } + virtual ~UsbDevice() { + libusb_unref_device(m_usb_device); + } + + protected: + libusb_device *m_usb_device; +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_USBDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.cpp new file mode 100644 index 0000000..c0ce437 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.cpp @@ -0,0 +1,282 @@ +/* + * This dmxgram 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * UsbDmxPlugin.cpp + * The UsbDmx plugin for ola + * Copyright (C) 2006-2007 Simon Newton + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" +#include "ola/network/Socket.h" + +#include "plugins/usbdmx/AnymaDevice.h" +#include "plugins/usbdmx/FirmwareLoader.h" +#include "plugins/usbdmx/SunliteDevice.h" +#include "plugins/usbdmx/SunliteFirmwareLoader.h" +#include "plugins/usbdmx/UsbDevice.h" +#include "plugins/usbdmx/UsbDmxPlugin.h" +#include "plugins/usbdmx/VellemanDevice.h" + + +namespace ola { +namespace plugin { +namespace usbdmx { + +using ola::network::DeviceSocket; + +const char UsbDmxPlugin::PLUGIN_NAME[] = "USB"; +const char UsbDmxPlugin::PLUGIN_PREFIX[] = "usbdmx"; + + +/* + * Called by libusb when a new socket is created. + */ +void libusb_fd_added(int fd, short events, void *data) { + UsbDmxPlugin *plugin = reinterpret_cast(data); + + OLA_INFO << "USB new FD: " << fd; + plugin->AddDeviceSocket(fd); +} + + +/* + * Called by libusb when a socket is no longer needed. + */ +void libusb_fd_removed(int fd, void *data) { + UsbDmxPlugin *plugin = reinterpret_cast(data); + OLA_INFO << "USB rm FD: " << fd; + plugin->RemoveDeviceSocket(fd); +} + + +/* + * Start the plugin + */ +bool UsbDmxPlugin::StartHook() { + if (libusb_init(NULL)) { + OLA_WARN << "Failed to init libusb"; + return false; + } + + // libusb_set_debug(NULL, 3); + if (LoadFirmware()) { + // we loaded firmware for at least one device, set up a callback to run in + // a couple of seconds to re-scan for devices + m_plugin_adaptor->RegisterSingleTimeout( + 3500, + NewSingleClosure(this, &UsbDmxPlugin::FindDevices)); + } + FindDevices(); + + /* + if (!libusb_pollfds_handle_timeouts(m_usb_context)) { + OLA_FATAL << "libusb doesn't have timeout support, BAD"; + return false; + } + + libusb_set_pollfd_notifiers(m_usb_context, + &libusb_fd_added, + &libusb_fd_removed, + this); + + const libusb_pollfd **pollfds = libusb_get_pollfds(m_usb_context); + while (*pollfds) { + OLA_WARN << "poll fd " << (*pollfds)->fd; + AddDeviceSocket((*pollfds)->fd); + pollfds++; + } + */ + + return true; +} + + +/* + * Load firmware onto devices if required. + * @returns true if we loaded firmware for one or more devices + */ +bool UsbDmxPlugin::LoadFirmware() { + libusb_device **device_list; + size_t device_count = libusb_get_device_list(NULL, &device_list); + FirmwareLoader *loader; + bool loaded = false; + + for (unsigned int i = 0; i < device_count; i++) { + libusb_device *usb_device = device_list[i]; + loader = NULL; + struct libusb_device_descriptor device_descriptor; + libusb_get_device_descriptor(usb_device, &device_descriptor); + + if (device_descriptor.idVendor == 0x0962 && + device_descriptor.idProduct == 0x2000) { + loader = new SunliteFirmwareLoader(usb_device); + } + + if (loader) { + loader->LoadFirmware(); + loaded = true; + delete loader; + } + } + libusb_free_device_list(device_list, 1); // unref devices + return loaded; +} + + +/* + * Find known devices & register them + */ +void UsbDmxPlugin::FindDevices() { + libusb_device **device_list; + libusb_device *found = NULL; + size_t device_count = libusb_get_device_list(NULL, &device_list); + + for (unsigned int i = 0; i < device_count; i++) { + libusb_device *usb_device = device_list[i]; + struct libusb_device_descriptor device_descriptor; + libusb_get_device_descriptor(usb_device, &device_descriptor); + UsbDevice *device = NULL; + + pair bus_dev_id(libusb_get_bus_number(usb_device), + libusb_get_device_address(usb_device)); + + if ((m_registered_devices.find(bus_dev_id) != m_registered_devices.end())) + continue; + + if (device_descriptor.idVendor == 0x10cf && + device_descriptor.idProduct == 0x8062) { + OLA_INFO << "Found a Velleman USB device"; + device = new VellemanDevice(this, usb_device); + } else if (device_descriptor.idVendor == 0x0962 && + device_descriptor.idProduct == 0x2001) { + OLA_INFO << "found a sunlite device"; + device = new SunliteDevice(this, usb_device); + } else if (device_descriptor.idVendor == 0x16C0 && + device_descriptor.idProduct == 0x05DC) { + OLA_INFO << "found a anyma device"; + device = new AnymaDevice(this, usb_device); + } + + if (device) { + if (!device->Start()) { + delete device; + continue; + } + m_registered_devices.insert(bus_dev_id); + m_devices.push_back(device); + m_plugin_adaptor->RegisterDevice(device); + } + } + libusb_free_device_list(device_list, 1); // unref devices +} + + +/* + * Stop the plugin + * @return true on success, false on failure + */ +bool UsbDmxPlugin::StopHook() { + vector::iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) { + m_plugin_adaptor->UnregisterDevice(*iter); + (*iter)->Stop(); + delete *iter; + } + m_devices.clear(); + m_registered_devices.clear(); + + libusb_exit(NULL); + + if (m_sockets.size()) { + OLA_WARN << "libusb is still using sockets, this is a bug"; + } + return true; +} + + +/* + * Return the description for this plugin + */ +string UsbDmxPlugin::Description() const { + return +"USB DMX Plugin\n" +"----------------------------\n" +"\n" +"This plugin supports various USB DMX devices including the \n" +"Anyma uDMX, Sunlite USBDMX2 & Velleman K8062.\n"; +} + + +/* + * Default to sensible values + */ +bool UsbDmxPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + return true; +} + + +bool UsbDmxPlugin::AddDeviceSocket(int fd) { + vector::const_iterator iter = m_sockets.begin(); + for (; iter != m_sockets.end(); ++iter) { + if ((*iter)->ReadDescriptor() == fd) + return true; + } + DeviceSocket *socket = new DeviceSocket(fd); + socket->SetOnData(NewClosure(this, &UsbDmxPlugin::SocketReady)); + m_plugin_adaptor->AddSocket(socket); + m_sockets.push_back(socket); +} + + +bool UsbDmxPlugin::RemoveDeviceSocket(int fd) { + vector::iterator iter = m_sockets.begin(); + for (; iter != m_sockets.end(); ++iter) { + if ((*iter)->ReadDescriptor() == fd) { + m_plugin_adaptor->RemoveSocket(*iter); + delete *iter; + m_sockets.erase(iter); + return true; + } + } + return false; +} + + +/* + * Called when there is activity on one of our sockets. + */ +void UsbDmxPlugin::SocketReady() { + struct timeval tv; + tv.tv_sec = 0; + tv.tv_usec = 0; + libusb_handle_events_timeout(NULL, &tv); +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.h new file mode 100644 index 0000000..26d46dc --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/UsbDmxPlugin.h @@ -0,0 +1,73 @@ +/* + * This dmxgram 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * UsbDmxPlugin.h + * Interface for the usbdmx plugin class + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_USBDMXPLUGIN_H_ +#define PLUGINS_USBDMX_USBDMXPLUGIN_H_ + +#include +#include +#include +#include +#include +#include "ola/plugin_id.h" +#include "olad/Plugin.h" +#include "ola/network/Socket.h" +#include "plugins/usbdmx/UsbDevice.h" + +namespace ola { +namespace plugin { + +namespace usbdmx { + +using ola::network::ConnectedSocket; + +class UsbDmxPlugin: public ola::Plugin { + public: + explicit UsbDmxPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_usb_context(NULL) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_USBDMX; } + string PluginPrefix() const { return PLUGIN_PREFIX; } + + bool AddDeviceSocket(int fd); + bool RemoveDeviceSocket(int fd); + void SocketReady(); + + private: + bool StartHook(); + bool LoadFirmware(); + void FindDevices(); + bool StopHook(); + bool SetDefaultPreferences(); + vector m_devices; // list of our devices + struct libusb_context *m_usb_context; + vector m_sockets; + set > m_registered_devices; + + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_USBDMXPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.cpp new file mode 100644 index 0000000..2c1a6f9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.cpp @@ -0,0 +1,50 @@ +/* + * This dmxgram 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * VellemanDevice.cpp + * The Velleman usb driver + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/VellemanDevice.h" +#include "plugins/usbdmx/VellemanOutputPort.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + + +/* + * Start this device. + */ +bool VellemanDevice::StartHook() { + VellemanOutputPort *output_port = new VellemanOutputPort(this, + 0, + m_usb_device); + if (!output_port->Start()) { + delete output_port; + return false; + } + AddPort(output_port); + return true; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.h new file mode 100644 index 0000000..b3454a7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanDevice.h @@ -0,0 +1,50 @@ +/* + * 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 dmxgram is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this dmxgram; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * VellemanDevice.h + * Interface for the Velleman device + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBDMX_VELLEMANDEVICE_H_ +#define PLUGINS_USBDMX_VELLEMANDEVICE_H_ + +#include +#include +#include "plugins/usbdmx/UsbDevice.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +/* + * A Velleman device + */ +class VellemanDevice: public UsbDevice { + public: + VellemanDevice(ola::AbstractPlugin *owner, + libusb_device *usb_device): + UsbDevice(owner, "Velleman USB Device", usb_device) { + } + + string DeviceId() const { return "velleman"; } + + protected: + bool StartHook(); +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_VELLEMANDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.cpp new file mode 100644 index 0000000..e6324bd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.cpp @@ -0,0 +1,234 @@ +/* + * 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 Library 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. + * + * VellemanOutputPort.cpp + * Thread for the Velleman Output Port + * Copyright (C) 2010 Simon Newton + * + * See the comments in VellemanOutputPort.h + */ + +#include +#include +#include + +#include "ola/Logging.h" +#include "plugins/usbdmx/VellemanOutputPort.h" +#include "plugins/usbdmx/VellemanDevice.h" + + +namespace ola { +namespace plugin { +namespace usbdmx { + +using std::string; + + +/* + * Create a new VellemanOutputPort object + */ +VellemanOutputPort::VellemanOutputPort(VellemanDevice *parent, + unsigned int id, + libusb_device *usb_device) + : BasicOutputPort(parent, id), + m_term(false), + m_usb_device(usb_device), + m_usb_handle(NULL) { + pthread_mutex_init(&m_data_mutex, NULL); + pthread_mutex_init(&m_term_mutex, NULL); +} + + +/* + * Cleanup + */ +VellemanOutputPort::~VellemanOutputPort() { + pthread_mutex_lock(&m_term_mutex); + m_term = true; + pthread_mutex_unlock(&m_term_mutex); + Join(); + + pthread_mutex_destroy(&m_term_mutex); + pthread_mutex_destroy(&m_data_mutex); +} + + +/* + * Start this thread + */ +bool VellemanOutputPort::Start() { + libusb_device_handle *usb_handle; + + if (libusb_open(m_usb_device, &usb_handle)) { + OLA_WARN << "Failed to open Velleman usb device"; + return false; + } + + if (libusb_kernel_driver_active(usb_handle, 0)) { + if (libusb_detach_kernel_driver(usb_handle, 0)) { + OLA_WARN << "Failed to detach kernel driver"; + libusb_close(usb_handle); + return false; + } + } + + // this device only has one configuration + if (libusb_set_configuration(usb_handle, CONFIGURATION)) { + OLA_WARN << "Velleman set config failed"; + libusb_close(usb_handle); + return false; + } + + if (libusb_claim_interface(usb_handle, 0)) { + OLA_WARN << "Failed to claim Velleman usb device"; + libusb_close(usb_handle); + return false; + } + + m_usb_handle = usb_handle; + bool ret = OlaThread::Start(); + if (!ret) { + OLA_WARN << "pthread create failed"; + libusb_release_interface(m_usb_handle, 0); + libusb_close(usb_handle); + return false; + } + return true; +} + + +/* + * Run this thread + */ +void *VellemanOutputPort::Run() { + DmxBuffer buffer; + if (!m_usb_handle) + return NULL; + + while (1) { + pthread_mutex_lock(&m_term_mutex); + if (m_term) { + pthread_mutex_unlock(&m_term_mutex); + break; + } + pthread_mutex_unlock(&m_term_mutex); + + pthread_mutex_lock(&m_data_mutex); + buffer.Set(m_buffer); + pthread_mutex_unlock(&m_data_mutex); + + if (buffer.Size()) { + if (!SendDMX(buffer)) { + OLA_WARN << "Send failed, stopping thread..."; + break; + } + } else { + // sleep for a bit + usleep(40000); + } + } + libusb_release_interface(m_usb_handle, 0); + libusb_close(m_usb_handle); + return NULL; +} + + +/* + * Store the data in the shared buffer + */ +bool VellemanOutputPort::WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + pthread_mutex_lock(&m_data_mutex); + m_buffer.Set(buffer); + pthread_mutex_unlock(&m_data_mutex); + return true; +} + + +/* + * Send the dmx out the widget + * @return true on success, false on failure + */ +bool VellemanOutputPort::SendDMX(const DmxBuffer &buffer) { + unsigned char usb_data[VELLEMAN_USB_CHUNK_SIZE]; + unsigned int size = buffer.Size(); + const uint8_t *data = buffer.GetRaw(); + unsigned int i = 0; + unsigned int n; + + memset(usb_data, 0, sizeof(usb_data)); + + for (n = 0; + n < MAX_COMPRESSED_CHANNELS && n < size - COMPRESSED_CHANNEL_COUNT + && !data[n]; + n++); + usb_data[0] = 4; + usb_data[1] = n + 1; // include start code + memcpy(usb_data + 2, data + n, COMPRESSED_CHANNEL_COUNT); + if (!SendDataChunk(usb_data)) + return false; + i += n + COMPRESSED_CHANNEL_COUNT; + + while (i < size - CHANNEL_COUNT) { + for (n = 0; + n < MAX_COMPRESSED_CHANNELS && n + i < size - COMPRESSED_CHANNEL_COUNT + && !data[i + n]; + n++); + if (n) { + // we have leading zeros + usb_data[0] = 5; + usb_data[1] = n; + memcpy(usb_data + 2, data + i + n, COMPRESSED_CHANNEL_COUNT); + i += n + COMPRESSED_CHANNEL_COUNT; + } else { + usb_data[0] = 2; + memcpy(usb_data + 1, data + i, CHANNEL_COUNT); + i += CHANNEL_COUNT; + } + if (!SendDataChunk(usb_data)) + return false; + } + + // send the last channels + for (;i != size; i++) { + usb_data[0] = 3; + usb_data[1] = data[i]; + if (!SendDataChunk(usb_data)) + return false; + } + return true; +} + + +/* + * Send 8 bytes to the usb device + * @returns false if there was an error, true otherwise + */ +bool VellemanOutputPort::SendDataChunk(uint8_t *usb_data) { + int transferred; + int ret = libusb_interrupt_transfer( + m_usb_handle, + ENDPOINT, + reinterpret_cast(usb_data), + VELLEMAN_USB_CHUNK_SIZE, + &transferred, + URB_TIMEOUT_MS); + if (ret) + OLA_INFO << "USB return code was " << ret << ", transferred " << + transferred; + return ret == 0; +} +} // usbdmx +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.h b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.h new file mode 100644 index 0000000..890647d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbdmx/VellemanOutputPort.h @@ -0,0 +1,82 @@ +/* + * 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 Library 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. + * + * VellemanOutputPort.h + * The output port for a Velleman 8062 device. + * Copyright (C) 2010 Simon Newton + * + * Because this interface is so slow we run the output in a separate thread. It + * takes around 8ms to respond to an urb and in the worst case we send 74 urbs + * per universe. + * + * It would be interesting to see if you can pipeline the urbs to improve the + * performance. + */ + +#ifndef PLUGINS_USBDMX_VELLEMANOUTPUTPORT_H_ +#define PLUGINS_USBDMX_VELLEMANOUTPUTPORT_H_ + +#include +#include +#include +#include "ola/DmxBuffer.h" +#include "ola/OlaThread.h" +#include "olad/Port.h" + +namespace ola { +namespace plugin { +namespace usbdmx { + +class VellemanDevice; + +class VellemanOutputPort: public BasicOutputPort, OlaThread { + public: + VellemanOutputPort(VellemanDevice *parent, + unsigned int id, + libusb_device *usb_device); + ~VellemanOutputPort(); + + bool Start(); + void *Run(); + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority); + string Description() const { return ""; } + + private: + enum {VELLEMAN_USB_CHUNK_SIZE = 8}; + enum {COMPRESSED_CHANNEL_COUNT = 6}; + enum {CHANNEL_COUNT = 7}; + + // this could be up to 254 but then the shutdown process gets wacky. + static const uint8_t MAX_COMPRESSED_CHANNELS = 100; + static const unsigned char ENDPOINT = 0x01; + // 25ms seems to be about the shortest we can go + static const unsigned int URB_TIMEOUT_MS = 25; + static const int CONFIGURATION = 1; + + bool m_term; + libusb_device *m_usb_device; + libusb_device_handle *m_usb_handle; + DmxBuffer m_buffer; + pthread_mutex_t m_data_mutex; + pthread_mutex_t m_term_mutex; + + bool SendDMX(const DmxBuffer &buffer_old); + bool SendDataChunk(uint8_t *usb_data); +}; +} // usbdmx +} // plugin +} // ola +#endif // PLUGINS_USBDMX_VELLEMANOUTPUTPORT_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.cpp new file mode 100644 index 0000000..315f346 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.cpp @@ -0,0 +1,85 @@ +/* + * 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 Library 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. + * + * ArduinoRGBDevice.h + * The Ardunio RGB Mixer device. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "olad/PortDecorators.h" +#include "plugins/usbpro/ArduinoRGBDevice.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using std::string; +using ola::network::NetworkToHost; + + +/* + * New Arduino RGB Device + */ +ArduinoRGBDevice::ArduinoRGBDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial): + UsbDevice(owner, name, widget) { + std::stringstream str; + str << std::hex << esta_id << "-" << device_id << "-" << + NetworkToHost(serial); + m_device_id = str.str(); + + OutputPort *output_port = new ThrottledOutputPortDecorator( + new ArduinoRGBOutputPort(this), + plugin_adaptor->WakeUpTime(), + 5, // start with 5 tokens in the bucket + 20); // 22 frames per second seems to be the limit + AddPort(output_port); + Start(); +} + + +/* + * Send a dmx msg + * @returns true if we sent ok, false otherwise + */ +bool ArduinoRGBDevice::SendDMX(const DmxBuffer &buffer) const { + struct { + uint8_t start_code; + uint8_t dmx[DMX_UNIVERSE_SIZE]; + } widget_dmx; + + if (!IsEnabled()) + return true; + + widget_dmx.start_code = 0; + unsigned int length = DMX_UNIVERSE_SIZE; + buffer.Get(widget_dmx.dmx, &length); + return m_widget->SendMessage(UsbWidget::DMX_LABEL, + length + 1, + reinterpret_cast(&widget_dmx)); +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.h new file mode 100644 index 0000000..5328fe5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/ArduinoRGBDevice.h @@ -0,0 +1,75 @@ +/* + * 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 Library 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. + * + * ArduinoRGBDevice.h + * The Ardunio RGB Mixer device. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_ARDUINORGBDEVICE_H_ +#define PLUGINS_USBPRO_ARDUINORGBDEVICE_H_ + +#include +#include "ola/DmxBuffer.h" +#include "plugins/usbpro/UsbDevice.h" + +namespace ola { +namespace plugin { +namespace usbpro { + + +/* + * An Arduino RGB Mixer Device + */ +class ArduinoRGBDevice: public UsbDevice { + public: + ArduinoRGBDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial); + + string DeviceId() const { return m_device_id; } + bool SendDMX(const DmxBuffer &buffer) const; + + private: + string m_device_id; +}; + + +/* + * A single Output port per device + */ +class ArduinoRGBOutputPort: public BasicOutputPort { + public: + explicit ArduinoRGBOutputPort(ArduinoRGBDevice *parent) + : BasicOutputPort(parent, 0), + m_device(parent) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + return m_device->SendDMX(buffer); + (void) priority; + } + string Description() const { return ""; } + + private: + ArduinoRGBDevice *m_device; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_ARDUINORGBDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.cpp new file mode 100644 index 0000000..d5aa9fd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.cpp @@ -0,0 +1,620 @@ +/* + * 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 Library 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. + * + * DmxTriDevice.h + * The Jese DMX TRI device. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include "ola/BaseTypes.h" +#include "ola/Logging.h" +#include "ola/network/NetworkUtils.h" +#include "ola/rdm/RDMCommand.h" +#include "ola/rdm/RDMEnums.h" +#include "ola/rdm/UID.h" +#include "ola/rdm/UIDSet.h" +#include "plugins/usbpro/DmxTriDevice.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using std::string; +using ola::network::NetworkToHost; +using ola::network::HostToNetwork; +using ola::rdm::RDMCommand; +using ola::rdm::RDMRequest; +using ola::rdm::UID; +using ola::rdm::UIDSet; + + +/* + * New DMX TRI device + */ +DmxTriDevice::DmxTriDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial): + UsbDevice(owner, name, widget), + m_plugin_adaptor(plugin_adaptor), + m_rdm_timeout_id(ola::network::INVALID_TIMEOUT), + m_uid_count(0), + m_rdm_request_pending(false), + m_last_esta_id(UID::ALL_MANUFACTURERS), + m_rdm_response(NULL) { + std::stringstream str; + str << std::hex << esta_id << "-" << device_id << "-" << + NetworkToHost(serial); + m_device_id = str.str(); + DmxTriOutputPort *output_port = new DmxTriOutputPort(this); + AddPort(output_port); + m_widget->SetMessageHandler(this); +} + + +/* + * Shutdown + */ +DmxTriDevice::~DmxTriDevice() { + // delete all outstanding requests + while (!m_pending_requests.empty()) { + const RDMRequest *request = m_pending_requests.front(); + delete request; + m_pending_requests.pop(); + } +} + + +/* + * Kick off the RDM discovery process + */ +bool DmxTriDevice::StartHook() { + RunRDMDiscovery(); + return true; +} + + +/* + * Remove the rdm timeout if it's still running + */ +void DmxTriDevice::PrePortStop() { + if (m_rdm_timeout_id != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_rdm_timeout_id); + m_rdm_timeout_id = ola::network::INVALID_TIMEOUT; + } +} + + +/* + * Send a dmx msg + * @returns true if we sent ok, false otherwise + */ +bool DmxTriDevice::SendDMX(const DmxBuffer &buffer) const { + struct { + uint8_t start_code; + uint8_t dmx[DMX_UNIVERSE_SIZE]; + } widget_dmx; + + if (!IsEnabled()) + return true; + + widget_dmx.start_code = 0; + unsigned int length = DMX_UNIVERSE_SIZE; + buffer.Get(widget_dmx.dmx, &length); + return m_widget->SendMessage(UsbWidget::DMX_LABEL, + length + 1, + reinterpret_cast(&widget_dmx)); +} + + +/* + * Handle an RDM Request, ownership of the request object is transferred to us. + */ +bool DmxTriDevice::HandleRDMRequest(const ola::rdm::RDMRequest *request) { + // if we can't find this UID, fail now. While in discovery mode the + // m_uid_index_map will be clear so skip the check in this case. + const UID &dest_uid = request->DestinationUID(); + if (!dest_uid.IsBroadcast() && + !InDiscoveryMode() && + m_uid_index_map.find(dest_uid) == m_uid_index_map.end()) { + delete request; + return false; + } + m_pending_requests.push(request); + MaybeSendRDMRequest(); + return true; +} + + +/* + * Kick off the discovery process if it's not already running + */ +void DmxTriDevice::RunRDMDiscovery() { + if (InDiscoveryMode()) + // process already running + return; + + if (!SendDiscoveryStart()) { + OLA_WARN << "Failed to begin RDM discovery"; + return; + } + + // setup a stat every RDM_STATUS_INTERVAL_MS until we're done + m_rdm_timeout_id = m_plugin_adaptor->RegisterRepeatingTimeout( + RDM_STATUS_INTERVAL_MS, + NewClosure(this, &DmxTriDevice::CheckDiscoveryStatus)); +} + + +/* + * Check the status of the RDM discovery process. + * This is called periodically while discovery is running + */ +bool DmxTriDevice::CheckDiscoveryStatus() { + if (!IsEnabled()) + return false; + return SendDiscoveryStat(); +} + + +/* + * Handle a message received from the widget + */ +void DmxTriDevice::HandleMessage(UsbWidget* widget, + uint8_t label, + unsigned int length, + const uint8_t *data) { + if (label == EXTENDED_COMMAND_LABEL) { + if (length < DATA_OFFSET) { + OLA_WARN << "DMX-TRI frame too small"; + return; + } + + uint8_t command_id = data[0]; + uint8_t return_code = data[1]; + length -= DATA_OFFSET; + data = length ? data + DATA_OFFSET: NULL; + + switch (command_id) { + case DISCOVER_AUTO_COMMAND_ID: + HandleDiscoveryAutoResponse(return_code, data, length); + break; + case DISCOVER_STATUS_COMMAND_ID: + HandleDiscoverStatResponse(return_code, data, length); + break; + case REMOTE_UID_COMMAND_ID: + HandleRemoteUIDResponse(return_code, data, length); + break; + case REMOTE_GET_COMMAND_ID: + HandleRemoteRDMResponse(return_code, data, length); + break; + case REMOTE_SET_COMMAND_ID: + HandleRemoteRDMResponse(return_code, data, length); + break; + case QUEUED_GET_COMMAND_ID: + HandleQueuedGetResponse(return_code, data, length); + break; + case SET_FILTER_COMMAND_ID: + HandleSetFilterResponse(return_code, data, length); + break; + default: + OLA_WARN << "Unknown DMX-TRI CI: " << static_cast(command_id); + } + } else { + OLA_INFO << "DMX-TRI got response " << static_cast(label); + } + (void) widget; +} + + +/* + * Return true if discovery is running + */ +bool DmxTriDevice::InDiscoveryMode() const { + return (m_rdm_timeout_id != ola::network::INVALID_TIMEOUT || + m_uid_count); +} + + +/* + * Send a DiscoAuto message to begin the discovery process. + */ +bool DmxTriDevice::SendDiscoveryStart() { + uint8_t command_id = DISCOVER_AUTO_COMMAND_ID; + + return m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + sizeof(command_id), + &command_id); +} + + +/* + * Send a DiscoAuto message to begin the discovery process. + */ +void DmxTriDevice::FetchNextUID() { + if (!m_uid_count) + return; + + OLA_INFO << "fetching index " << static_cast(m_uid_count); + uint8_t data[] = {REMOTE_UID_COMMAND_ID, m_uid_count}; + m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + sizeof(data), + data); +} + + +/* + * Send a SetFilter command + */ +bool DmxTriDevice::SendSetFilter(uint16_t esta_id) { + uint8_t data[] = {SET_FILTER_COMMAND_ID, esta_id >> 8, esta_id & 0xff}; + return m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + sizeof(data), + reinterpret_cast(&data)); +} + + +/* + * Send a DiscoStat message to begin the discovery process. + */ +bool DmxTriDevice::SendDiscoveryStat() { + uint8_t command_id = DISCOVER_STATUS_COMMAND_ID; + + return m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + sizeof(command_id), + &command_id); +} + + +/* + * If we're not in discovery mode, send the next request. This will call + * SetFilter and defer the send if it's a broadcast UID. + */ +void DmxTriDevice::MaybeSendRDMRequest() { + if (!IsEnabled()) + return; + + if (InDiscoveryMode() || m_pending_requests.empty() || m_rdm_request_pending) + return; + + m_rdm_request_pending = true; + const RDMRequest *request = m_pending_requests.front(); + if (request->DestinationUID().IsBroadcast() && + request->DestinationUID().ManufacturerId() != m_last_esta_id) { + SendSetFilter(request->DestinationUID().ManufacturerId()); + } else { + DispatchNextRequest(); + } +} + + +/* + * Send the next RDM request, this assumes that SetFilter has been called + */ +void DmxTriDevice::DispatchNextRequest() { + const RDMRequest *request = m_pending_requests.front(); + if (request->ParamId() == ola::rdm::PID_QUEUED_MESSAGE && + request->CommandClass() == RDMCommand::GET_COMMAND) { + // these are special + if (request->ParamDataSize()) + DispatchQueuedGet(request); + else + OLA_WARN << "Missing param data in queued message get"; + return; + } + + struct rdm_message { + uint8_t command; + uint8_t index; + uint16_t sub_device; + uint16_t param_id; + uint8_t data[ola::rdm::RDMCommand::MAX_PARAM_DATA_LENGTH]; + } __attribute__((packed)); + + rdm_message message; + + if (request->CommandClass() == RDMCommand::GET_COMMAND) { + message.command = REMOTE_GET_COMMAND_ID; + } else if (request->CommandClass() == RDMCommand::SET_COMMAND) { + message.command = REMOTE_SET_COMMAND_ID; + } else { + OLA_WARN << "Request was not get or set: " << + static_cast(request->CommandClass()); + return; + } + + if (request->DestinationUID().IsBroadcast()) { + message.index = 0; + } else { + map::const_iterator iter = + m_uid_index_map.find(request->DestinationUID()); + if (iter == m_uid_index_map.end()) { + OLA_WARN << request->DestinationUID() << " not found in uid map"; + return; + } + message.index = iter->second; + } + message.sub_device = HostToNetwork(request->SubDevice()); + message.param_id = HostToNetwork(request->ParamId()); + if (request->ParamDataSize()) + memcpy(message.data, + request->ParamData(), + request->ParamDataSize()); + + unsigned int size = sizeof(message) - + ola::rdm::RDMCommand::MAX_PARAM_DATA_LENGTH + request->ParamDataSize(); + + m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + size, + reinterpret_cast(&message)); +} + + +/* + * Send a queued get message + */ +void DmxTriDevice::DispatchQueuedGet(const ola::rdm::RDMRequest* request) { + map::const_iterator iter = + m_uid_index_map.find(request->DestinationUID()); + if (iter == m_uid_index_map.end()) { + OLA_WARN << request->DestinationUID() << " not found in uid map"; + return; + } + uint8_t data[] = {QUEUED_GET_COMMAND_ID, + iter->second, + request->ParamData()[0]}; + + m_widget->SendMessage(EXTENDED_COMMAND_LABEL, + sizeof(data), + reinterpret_cast(&data)); +} + + +/* + * Stop the discovery process + */ +void DmxTriDevice::StopDiscovery() { + if (m_rdm_timeout_id != ola::network::INVALID_TIMEOUT) { + m_plugin_adaptor->RemoveTimeout(m_rdm_timeout_id); + m_rdm_timeout_id = ola::network::INVALID_TIMEOUT; + } +} + + +/* + * Handle the response from calling DiscoAuto + */ +void DmxTriDevice::HandleDiscoveryAutoResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + if (return_code != EC_NO_ERROR) { + OLA_WARN << "DMX_TRI discovery returned error " << + static_cast(return_code); + StopDiscovery(); + } + (void) data; + (void) length; +} + + +/* + * Handle the response from calling discovery stat + */ +void DmxTriDevice::HandleDiscoverStatResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + switch (return_code) { + case EC_NO_ERROR: + break; + case EC_RESPONSE_MUTE: + OLA_WARN << "Failed to mute device, aborting discovery"; + StopDiscovery(); + return; + case EC_RESPONSE_DISCOVERY: + OLA_WARN << + "Duplicated or erroneous device detected, aborting discovery"; + StopDiscovery(); + return; + case EC_RESPONSE_UNEXPECTED: + OLA_INFO << "Got an unexpected RDM response during discovery"; + break; + default: + OLA_WARN << "DMX_TRI discovery returned error " << + static_cast(return_code); + StopDiscovery(); + return; + } + + if (length < 1) { + OLA_WARN << "DiscoStat command too short, was " << length; + return; + } + + if (data[1] == 0) { + OLA_DEBUG << "Discovery process has completed, " << + static_cast(data[0]) << " devices found"; + StopDiscovery(); + m_uid_count = data[0]; + m_uid_index_map.clear(); + if (m_uid_count) + FetchNextUID(); + } +} + + +/* + * Handle the response to a RemoteGet command + */ +void DmxTriDevice::HandleRemoteUIDResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + if (!m_uid_count) { + // not expecting any responses + OLA_INFO << "Got an unexpected RemoteUID response"; + return; + } + + if (return_code == EC_NO_ERROR) { + if (length < ola::rdm::UID::UID_SIZE) { + OLA_INFO << "Short RemoteUID response, was " << length; + } else { + const UID uid(data); + m_uid_index_map[uid] = m_uid_count; + } + } else if (return_code == EC_CONSTRAINT) { + // this is returned if the index is wrong + OLA_INFO << "RemoteUID returned RC_Constraint, some how we botched the" + << " discovery process, subtracting 1 and attempting to continue"; + } else { + OLA_INFO << "RemoteUID returned " << static_cast(return_code); + } + + m_uid_count--; + + if (m_uid_count) { + FetchNextUID(); + } else { + // notify the universe + UIDSet uid_set; + map::iterator iter = m_uid_index_map.begin(); + for (; iter != m_uid_index_map.end(); ++iter) { + uid_set.AddUID(iter->first); + } + GetOutputPort(0)->NewUIDList(uid_set); + + // start sending rdm commands again + MaybeSendRDMRequest(); + } +} + + +/* + * Handle the response to a RemoteGet command + */ +void DmxTriDevice::HandleRemoteRDMResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + OLA_WARN << "got get response! " << static_cast(return_code) << + " length " << length; + const RDMRequest *request = m_pending_requests.front(); + if (return_code == EC_NO_ERROR || return_code == EC_RESPONSE_WAIT || + return_code == EC_RESPONSE_MORE) { + ola::rdm::RDMResponse *response; + if (request->CommandClass() == RDMCommand::GET_COMMAND) { + response = new ola::rdm::RDMGetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + ola::rdm::ACK, + // this is a hack, there is no way to expose # of queues messages + return_code == EC_RESPONSE_WAIT ? 1 : 0, + request->SubDevice(), + request->ParamId(), + data, + length); + } else { + response = new ola::rdm::RDMSetResponse( + request->DestinationUID(), + request->SourceUID(), + request->TransactionNumber(), + ola::rdm::ACK, + // this is a hack, there is no way to expose # of queues messages + return_code == EC_RESPONSE_WAIT ? 1 : 0, + request->SubDevice(), + request->ParamId(), + data, + length); + } + + if (m_rdm_response) { + // if this is part of an overflowed response we need to combine it + ola::rdm::RDMResponse *combined_response = + ola::rdm::RDMResponse::CombineResponses(m_rdm_response, response); + delete m_rdm_response; + delete response; + m_rdm_response = combined_response; + } else { + m_rdm_response = response; + } + + if (m_rdm_response) { + if (return_code == EC_RESPONSE_MORE) { + // send the same command again; + DispatchNextRequest(); + } else { + GetOutputPort(0)->HandleRDMResponse(m_rdm_response); + m_rdm_response = NULL; + } + } + } else { + // TODO(simonn): Implement the correct response here when we error out + OLA_WARN << "Response was returned with 0x" << std::hex << + static_cast(return_code); + if (m_rdm_response) { + delete m_rdm_response; + m_rdm_response = NULL; + } + } + delete request; + m_pending_requests.pop(); + m_rdm_request_pending = false; +} + + +/* + * Handle the response to a QueuedGet command + */ +void DmxTriDevice::HandleQueuedGetResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + OLA_INFO << "got queued message response"; + // TODO(simon): implement this + (void) return_code; + (void) data; + (void) length; +} + + +/* + * Handle a setfilter response + */ +void DmxTriDevice::HandleSetFilterResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length) { + if (return_code == EC_NO_ERROR) { + m_last_esta_id = + m_pending_requests.front()->DestinationUID().ManufacturerId(); + DispatchNextRequest(); + } else { + OLA_WARN << "SetFilter returned " << static_cast(return_code) << + ", we have no option but to drop the rdm request"; + delete m_pending_requests.front(); + m_pending_requests.pop(); + m_rdm_request_pending = false; + MaybeSendRDMRequest(); + } + (void) data; + (void) length; +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.h new file mode 100644 index 0000000..870225d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/DmxTriDevice.h @@ -0,0 +1,186 @@ +/* + * 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 Library 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. + * + * DmxTriDevice.h + * The Jese DMX-TRI device. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_DMXTRIDEVICE_H_ +#define PLUGINS_USBPRO_DMXTRIDEVICE_H_ + +#include +#include +#include +#include "ola/DmxBuffer.h" +#include "plugins/usbpro/UsbDevice.h" +#include "plugins/usbpro/UsbWidget.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using std::queue; + + +/* + * An DMX TRI Device + */ +class DmxTriDevice: public UsbDevice, public WidgetListener { + public: + DmxTriDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial); + ~DmxTriDevice(); + + string DeviceId() const { return m_device_id; } + bool StartHook(); + void PrePortStop(); + bool SendDMX(const DmxBuffer &buffer) const; + + bool HandleRDMRequest(const ola::rdm::RDMRequest *request); + void RunRDMDiscovery(); + + bool CheckDiscoveryStatus(); + + void HandleMessage(UsbWidget* widget, + uint8_t label, + unsigned int length, + const uint8_t *data); + + private: + string m_device_id; + const PluginAdaptor *m_plugin_adaptor; + timeout_id m_rdm_timeout_id; + map m_uid_index_map; + unsigned int m_uid_count; + queue m_pending_requests; + bool m_rdm_request_pending; + uint16_t m_last_esta_id; + ola::rdm::RDMResponse *m_rdm_response; + + bool InDiscoveryMode() const; + bool SendDiscoveryStart(); + bool SendDiscoveryStat(); + void FetchNextUID(); + bool SendSetFilter(uint16_t esta_id); + void MaybeSendRDMRequest(); + void DispatchNextRequest(); + void DispatchQueuedGet(const ola::rdm::RDMRequest* request); + void StopDiscovery(); + + void HandleDiscoveryAutoResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + void HandleDiscoverStatResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + void HandleRemoteUIDResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + void HandleRemoteRDMResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + void HandleQueuedGetResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + void HandleSetFilterResponse(uint8_t return_code, + const uint8_t *data, + unsigned int length); + + typedef enum { + EC_NO_ERROR = 0, + EC_CONSTRAINT = 1, + EC_UNKNOWN_COMMAND = 2, + EC_INVALID_OPTION = 3, + EC_FRAME_FORMAT = 4, + EC_DATA_TOO_LONG = 5, + EC_DATA_MISSING = 6, + EC_SYSTEM_MODE = 7, + EC_SYSTEM_BUSY = 8, + EC_DATA_CHECKSUM = 0x0a, + EC_INCOMPATIBLE = 0x0b, + EC_RESPONSE_TIME = 0x10, + EC_RESPONSE_WAIT = 0x11, + EC_RESPONSE_MORE = 0x12, + EC_RESPONSE_TRANSACTION = 0x13, + EC_RESPONSE_SUBDEVICE = 0x14, + EC_RESPONSE_FORMAT = 0x15, + EC_RESPONSE_CHECKSUM = 0x16, + EC_RESPONSE_NONE = 0x18, + EC_RESPONSE_IDENTITY = 0x1a, + EC_RESPONSE_MUTE = 0x1b, + EC_RESPONSE_DISCOVERY = 0x1c, + EC_RESPONSE_UNEXPECTED = 0x1d, + EC_UNKNOWN_PID = 0x20, + EC_FORMAT_ERROR = 0x21, + EC_HARDWARE_FAULT = 0x22, + EC_PROXY_REJECT = 0x23, + EC_WRITE_PROTECT = 0x24, + EC_UNSUPPORTED_COMMAND_CLASS = 0x25, + EC_OUT_OF_RANGE = 0x26, + EC_BUFFER_FULL = 0x27, + EC_FRAME_OVERFLOW = 0x28, + EC_SUBDEVICE_UNKNOWN = 0x29, + } dmx_tri_error_codes; + + static const unsigned int DATA_OFFSET = 2; // first two bytes are CI & RC + static const uint8_t EXTENDED_COMMAND_LABEL = 88; // 'X' + static const uint8_t DISCOVER_AUTO_COMMAND_ID = 0x33; + static const uint8_t DISCOVER_STATUS_COMMAND_ID = 0x34; + static const uint8_t REMOTE_UID_COMMAND_ID = 0x35; + static const uint8_t REMOTE_GET_COMMAND_ID = 0x38; + static const uint8_t REMOTE_SET_COMMAND_ID = 0x39; + static const uint8_t QUEUED_GET_COMMAND_ID = 0x3a; + static const uint8_t SET_FILTER_COMMAND_ID = 0x3d; + // The ms delay between checking on the RDM discovery process + static const unsigned int RDM_STATUS_INTERVAL_MS = 100; +}; + + +/* + * A single output port per device + */ +class DmxTriOutputPort: public BasicOutputPort { + public: + explicit DmxTriOutputPort(DmxTriDevice *parent) + : BasicOutputPort(parent, 0), + m_device(parent) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + return m_device->SendDMX(buffer); + (void) priority; + } + string Description() const { return ""; } + + bool HandleRDMRequest(const ola::rdm::RDMRequest *request) { + return m_device->HandleRDMRequest(request); + } + + void RunRDMDiscovery() { + m_device->RunRDMDiscovery(); + } + + private: + DmxTriDevice *m_device; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_DMXTRIDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.am new file mode 100644 index 0000000..d931c08 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.am @@ -0,0 +1,15 @@ +include $(top_srcdir)/common.mk + +libdir = $(plugindir) +SUBDIRS = messages +EXTRA_DIST = UsbProPlugin.h UsbDevice.h UsbWidget.h \ + WidgetDetector.h ArduinoRGBDevice.h DmxTriDevice.h \ + UsbProDevice.h + +lib_LTLIBRARIES = libolausbpro.la +libolausbpro_la_SOURCES = UsbProPlugin.cpp ArduinoRGBDevice.cpp \ + DmxTriDevice.cpp UsbProDevice.cpp +libolausbpro_la_LIBADD = ./libolausbprowidget.la messages/libolausbproconf.la + +noinst_LTLIBRARIES = libolausbprowidget.la +libolausbprowidget_la_SOURCES = UsbWidget.cpp WidgetDetector.cpp diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.in new file mode 100644 index 0000000..8e3acdd --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/Makefile.in @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +subdir = plugins/usbpro +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +libolausbpro_la_DEPENDENCIES = ./libolausbprowidget.la \ + messages/libolausbproconf.la +am_libolausbpro_la_OBJECTS = UsbProPlugin.lo ArduinoRGBDevice.lo \ + DmxTriDevice.lo UsbProDevice.lo +libolausbpro_la_OBJECTS = $(am_libolausbpro_la_OBJECTS) +libolausbprowidget_la_LIBADD = +am_libolausbprowidget_la_OBJECTS = UsbWidget.lo WidgetDetector.lo +libolausbprowidget_la_OBJECTS = $(am_libolausbprowidget_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolausbpro_la_SOURCES) $(libolausbprowidget_la_SOURCES) +DIST_SOURCES = $(libolausbpro_la_SOURCES) \ + $(libolausbprowidget_la_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = $(plugindir) +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +SUBDIRS = messages +EXTRA_DIST = UsbProPlugin.h UsbDevice.h UsbWidget.h \ + WidgetDetector.h ArduinoRGBDevice.h DmxTriDevice.h \ + UsbProDevice.h + +lib_LTLIBRARIES = libolausbpro.la +libolausbpro_la_SOURCES = UsbProPlugin.cpp ArduinoRGBDevice.cpp \ + DmxTriDevice.cpp UsbProDevice.cpp + +libolausbpro_la_LIBADD = ./libolausbprowidget.la messages/libolausbproconf.la +noinst_LTLIBRARIES = libolausbprowidget.la +libolausbprowidget_la_SOURCES = UsbWidget.cpp WidgetDetector.cpp +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/usbpro/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/usbpro/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolausbpro.la: $(libolausbpro_la_OBJECTS) $(libolausbpro_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolausbpro_la_OBJECTS) $(libolausbpro_la_LIBADD) $(LIBS) +libolausbprowidget.la: $(libolausbprowidget_la_OBJECTS) $(libolausbprowidget_la_DEPENDENCIES) + $(CXXLINK) $(libolausbprowidget_la_OBJECTS) $(libolausbprowidget_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ArduinoRGBDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DmxTriDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UsbProDevice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UsbProPlugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UsbWidget.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WidgetDetector.Plo@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(LTLIBRARIES) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(libdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstLTLIBRARIES mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ + ctags ctags-recursive distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am \ + uninstall-libLTLIBRARIES + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbDevice.h new file mode 100644 index 0000000..36b56ce --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbDevice.h @@ -0,0 +1,58 @@ +/* + * 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 Library 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. + * + * UsbDevice.h + * Interface for the usb devices + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_USBDEVICE_H_ +#define PLUGINS_USBPRO_USBDEVICE_H_ + +#include +#include "ola/Closure.h" +#include "olad/Device.h" +#include "plugins/usbpro/UsbWidget.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +/* + * A USB device + */ +class UsbDevice: public ola::Device { + public: + UsbDevice(ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget): + Device(owner, name), + m_widget(widget) {} + + virtual ~UsbDevice() { + delete m_widget; + } + + void SetOnRemove(ola::SingleUseClosure *on_close) { + m_widget->SetOnRemove(on_close); + } + + protected: + UsbWidget *m_widget; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_USBDEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.cpp new file mode 100644 index 0000000..6918645 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.cpp @@ -0,0 +1,430 @@ +/* + * 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 Library 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. + * + * UsbProDevice.cpp + * UsbPro device + * Copyright (C) 2006-2007 Simon Newton + * + * The device creates two ports, one in and one out, but you can only use one + * at a time. + */ + +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "olad/PortDecorators.h" +#include "olad/Preferences.h" +#include "plugins/usbpro/UsbProDevice.h" +#include "plugins/usbpro/WidgetDetector.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using google::protobuf::RpcController; +using ola::plugin::usbpro::Request; +using ola::plugin::usbpro::Reply; + +/* + * Create a new device + * + * @param owner the plugin that owns this device + * @param name the device name + * @param dev_path path to the pro widget + */ +UsbProDevice::UsbProDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial, + unsigned int fps_limit): + UsbDevice(owner, name, widget), + m_got_parameters(false), + m_in_shutdown(false), + m_plugin_adaptor(plugin_adaptor), + m_serial() { + m_widget->SetMessageHandler(this); + + std::stringstream str; + str << std::setfill('0'); + uint8_t *ptr = reinterpret_cast(&serial); + for (int i = DeviceInformation::SERIAL_LENGTH - 1; i >= 0; i--) { + int digit = (10 * (ptr[i] & 0xf0) >> 4) + (ptr[i] & 0x0f); + str << std::setw(2) << digit; + } + m_serial = str.str(); + + GetParameters(); // update our local values + + UsbProInputPort *input_port = new UsbProInputPort( + this, + 0, + m_plugin_adaptor->WakeUpTime(), + ""); + AddPort(input_port); + OutputPort *output_port = new ThrottledOutputPortDecorator( + new UsbProOutputPort(this, 0, ""), + plugin_adaptor->WakeUpTime(), + 10, // start with 10 tokens in the bucket + fps_limit); // 200 frames per second seems to be the limit + + AddPort(output_port); + Start(); // this does nothing but set IsEnabled() to true + (void) esta_id; + (void) device_id; +} + + +/* + * Handle Messages from the widget + */ +void UsbProDevice::HandleMessage(UsbWidget* widget, + uint8_t label, + unsigned int length, + const uint8_t *data) { + if (widget != m_widget) { + OLA_WARN << "Something went really wrong..."; + return; + } + + switch (label) { + case REPROGRAM_FIRMWARE_LABEL: + break; + case PARAMETERS_LABEL: + HandleParameters(data, length); + break; + case RECEIVED_DMX_LABEL: + HandleDMX(data, length); + break; + case DMX_CHANGED_LABEL: + HandleDMXDiff(data, length); + break; + case UsbWidget::SERIAL_LABEL: + break; + default: + OLA_WARN << "Unknown message type " << label; + } +} + + +/* + * Stop this device + */ +void UsbProDevice::PrePortStop() { + m_in_shutdown = true; // don't allow any more writes +} + + +/* + * Send the dmx out the widget + * @return true on success, false on failure + */ +bool UsbProDevice::SendDMX(const DmxBuffer &buffer) { + struct { + uint8_t start_code; + uint8_t dmx[DMX_UNIVERSE_SIZE]; + } widget_dmx; + + if (!IsEnabled()) + return true; + + widget_dmx.start_code = 0; + unsigned int length = DMX_UNIVERSE_SIZE; + buffer.Get(widget_dmx.dmx, &length); + return m_widget->SendMessage(UsbWidget::DMX_LABEL, + length + 1, + reinterpret_cast(&widget_dmx)); +} + + +/* + * Handle device config messages + * @param controller An RpcController + * @param request the request data + * @param response the response to return + * @param done the closure to call once the request is complete + */ +void UsbProDevice::Configure(RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done) { + Request request_pb; + if (!request_pb.ParseFromString(request)) { + controller->SetFailed("Invalid Request"); + done->Run(); + return; + } + + switch (request_pb.type()) { + case ola::plugin::usbpro::Request::USBPRO_PARAMETER_REQUEST: + HandleParametersRequest(controller, &request_pb, response, done); + break; + case ola::plugin::usbpro::Request::USBPRO_SERIAL_REQUEST: + HandleSerialRequest(controller, &request_pb, response, done); + break; + default: + controller->SetFailed("Invalid Request"); + done->Run(); + } +} + + +/* + * Put the device back into recv mode + * @return true on success, false on failure + */ +bool UsbProDevice::ChangeToReceiveMode(bool change_only) { + if (m_in_shutdown) + return true; + + uint8_t mode = change_only; + bool status = m_widget->SendMessage(DMX_RX_MODE_LABEL, sizeof(mode), &mode); + + if (status && change_only) + m_input_buffer.Blackout(); + return status; +} + + + +/* + * Called when we get new parameters from the widget. + */ +void UsbProDevice::HandleParameters(const uint8_t *data, unsigned int length) { + if (m_outstanding_param_requests.empty()) + return; + + // parameters + typedef struct { + uint8_t firmware; + uint8_t firmware_high; + uint8_t break_time; + uint8_t mab_time; + uint8_t rate; + } widget_parameters_reply; + + if (length < sizeof(widget_parameters_reply)) + return; + + const widget_parameters_reply *widget_reply = + reinterpret_cast(data); + + // update local values + m_got_parameters = true; + m_break_time = widget_reply->break_time; + m_mab_time = widget_reply->mab_time; + m_rate = widget_reply->rate; + + if (!m_outstanding_param_requests.size()) + return; + + OutstandingParamRequest parameter_request = + m_outstanding_param_requests.front(); + m_outstanding_param_requests.pop_front(); + + Reply reply; + reply.set_type(ola::plugin::usbpro::Reply::USBPRO_PARAMETER_REPLY); + ola::plugin::usbpro::ParameterReply *parameters_reply = + reply.mutable_parameters(); + + parameters_reply->set_firmware_high(widget_reply->firmware_high); + parameters_reply->set_firmware(widget_reply->firmware); + parameters_reply->set_break_time(widget_reply->break_time); + parameters_reply->set_mab_time(widget_reply->mab_time); + parameters_reply->set_rate(widget_reply->rate); + reply.SerializeToString(parameter_request.response); + parameter_request.closure->Run(); +} + + +/* + * Handle the dmx frame + */ +void UsbProDevice::HandleDMX(const uint8_t *data, unsigned int length) { + typedef struct { + uint8_t status; + uint8_t dmx[DMX_UNIVERSE_SIZE + 1]; + } widget_dmx; + + if (length < 2) + return; + + const widget_dmx *widget_reply = + reinterpret_cast(data); + + if (widget_reply->status) { + OLA_WARN << "UsbPro got corrupted packet, status: " << + static_cast(widget_reply->status); + return; + } + + // only handle start code = 0 + if (length > 2 && widget_reply->dmx[0] == 0) { + m_input_buffer.Set(widget_reply->dmx + 1, length - 2); + InputPort *port = GetInputPort(0); + port->DmxChanged(); + } + return; +} + + +/* + * Handle the dmx change of state frame + */ +void UsbProDevice::HandleDMXDiff(const uint8_t *data, unsigned int length) { + typedef struct { + uint8_t start; + uint8_t changed[5]; + uint8_t data[40]; + } widget_data_changed; + + if (length < sizeof(widget_data_changed)) + return; + + const widget_data_changed *widget_reply = + reinterpret_cast(data); + + unsigned int start_channel = widget_reply->start * 8; + unsigned int offset = 0; + + // skip non-0 start codes, this code is pretty messed up because the USB Pro + // doesn't seem to provide a guarentee on the ordering of packets. Packets + // with non-0 start codes are almost certainly going to cause problems. + if (start_channel == 0 && (widget_reply->changed[0] & 0x01) && + widget_reply->data[offset]) + return; + + for (int i = 0; i < 40; i++) { + if (start_channel + i > DMX_UNIVERSE_SIZE + 1 || offset + 6 >= length) + break; + + if (widget_reply->changed[i/8] & (1 << (i % 8)) && start_channel + i != 0) { + m_input_buffer.SetChannel(start_channel + i - 1, + widget_reply->data[offset]); + offset++; + } + } + + InputPort *port = GetInputPort(0); + port->DmxChanged(); + return; +} + + +/* + * Fetch the widget parameters. + * @returns true if we sent ok, false otherwise + */ +bool UsbProDevice::GetParameters() const { + uint16_t user_size = 0; + return m_widget->SendMessage(PARAMETERS_LABEL, + sizeof(user_size), + reinterpret_cast(&user_size)); +} + + + +/* + * Handle a parameter request. This may set some parameters in the widget. + * If no parameters are set we simply fetch the parameters and return them to + * the client. If we are setting parameters, we send a SetParam() request and + * then another GetParam() request in order to return the latest values to the + * client. + */ +void UsbProDevice::HandleParametersRequest(RpcController *controller, + const Request *request, + string *response, + google::protobuf::Closure *done) { + struct { + uint16_t length; + uint8_t break_time; + uint8_t mab_time; + uint8_t rate; + } widget_parameters; + + if (request->has_parameters() && + (request->parameters().has_break_time() || + request->parameters().has_mab_time() || + request->parameters().has_rate())) { + if (!m_got_parameters) { + controller->SetFailed("SetParameters failed, startup not complete"); + done->Run(); + return; + } + + widget_parameters.length = 0; + widget_parameters.break_time = request->parameters().has_break_time() ? + request->parameters().break_time() : m_break_time; + widget_parameters.mab_time = request->parameters().has_mab_time() ? + request->parameters().mab_time() : m_mab_time; + widget_parameters.rate = request->parameters().has_rate() ? + request->parameters().rate() : m_rate; + + bool ret = m_widget->SendMessage( + SET_PARAMETERS_LABEL, + sizeof(widget_parameters), + reinterpret_cast(&widget_parameters)); + + if (!ret) { + controller->SetFailed("SetParameters failed"); + done->Run(); + return; + } + } + + if (!GetParameters()) { + controller->SetFailed("GetParameters failed"); + done->Run(); + } else { + // TODO(simonn): we should time these out if we don't get a response + OutstandingParamRequest pending_request; + pending_request.controller = controller; + pending_request.response = response; + pending_request.closure = done; + m_outstanding_param_requests.push_back(pending_request); + } +} + + +/* + * Handle a Serial number Configure RPC. We can just return the cached number. + */ +void UsbProDevice::HandleSerialRequest( + RpcController *controller, + const Request *request, + string *response, + google::protobuf::Closure *done) { + + Reply reply; + reply.set_type(ola::plugin::usbpro::Reply::USBPRO_SERIAL_REPLY); + ola::plugin::usbpro::SerialNumberReply *serial_reply = + reply.mutable_serial_number(); + serial_reply->set_serial(m_serial); + reply.SerializeToString(response); + done->Run(); + (void) controller; + (void) request; +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.h new file mode 100644 index 0000000..eb8d397 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProDevice.h @@ -0,0 +1,178 @@ +/* + * 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 Library 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. + * + * UsbProDevice.h + * Interface for the usbpro device + * Copyright (C) 2006-2007 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_USBPRODEVICE_H_ +#define PLUGINS_USBPRO_USBPRODEVICE_H_ + +#include +#include +#include "ola/DmxBuffer.h" +#include "ola/network/Socket.h" +#include "olad/Device.h" +#include "olad/PluginAdaptor.h" +#include "olad/Port.h" + +#include "plugins/usbpro/UsbDevice.h" +#include "plugins/usbpro/UsbWidget.h" +#include "plugins/usbpro/messages/UsbProConfigMessages.pb.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using google::protobuf::RpcController; +using ola::plugin::usbpro::Request; +using ola::network::ConnectedSocket; +using std::deque; + +/* + * Outstanding requests to the widget + */ +typedef struct { + RpcController *controller; + string *response; + google::protobuf::Closure *closure; +} OutstandingParamRequest; + + +/* + * An Enttec Usb Pro device + */ +class UsbProDevice: public UsbDevice, public WidgetListener { + public: + UsbProDevice(const ola::PluginAdaptor *plugin_adaptor, + ola::AbstractPlugin *owner, + const string &name, + UsbWidget *widget, + uint16_t esta_id, + uint16_t device_id, + uint32_t serial, + unsigned int fps_limit); + void HandleMessage(UsbWidget* widget, + uint8_t label, + unsigned int length, + const uint8_t *data); + + string DeviceId() const { return m_serial; } + + void Configure(RpcController *controller, + const string &request, + string *response, + google::protobuf::Closure *done); + + bool SendDMX(const DmxBuffer &buffer); + const DmxBuffer &FetchDMX() const { return m_input_buffer; } + bool ChangeToReceiveMode(bool change_only); + + protected: + void PrePortStop(); + + private: + void HandleParameters(const uint8_t *data, unsigned int length); + void HandleDMX(const uint8_t *data, unsigned int length); + void HandleDMXDiff(const uint8_t *data, unsigned int length); + bool GetParameters() const; + + void HandleParametersRequest(RpcController *controller, + const Request *request, + string *response, + google::protobuf::Closure *done); + + void HandleSerialRequest(RpcController *controller, + const Request *request, + string *response, + google::protobuf::Closure *done); + + bool m_got_parameters; + bool m_in_shutdown; // set to true if we're shutting down + const ola::PluginAdaptor *m_plugin_adaptor; + string m_serial; + DmxBuffer m_input_buffer; + deque m_outstanding_param_requests; + + uint8_t m_break_time; + uint8_t m_mab_time; + uint8_t m_rate; + + static const uint8_t REPROGRAM_FIRMWARE_LABEL = 2; + static const uint8_t PARAMETERS_LABEL = 3; + static const uint8_t SET_PARAMETERS_LABEL = 4; + static const uint8_t RECEIVED_DMX_LABEL = 5; + static const uint8_t DMX_RX_MODE_LABEL = 8; + static const uint8_t DMX_CHANGED_LABEL = 9; +}; + + +/* + * The Input port + */ +class UsbProInputPort: public BasicInputPort { + public: + UsbProInputPort(UsbProDevice *parent, unsigned int id, + const TimeStamp *wake_time, const string &path) + : BasicInputPort(parent, id, wake_time), + m_path(path), + m_device(parent) {} + + const DmxBuffer &ReadDMX() const { + return m_device->FetchDMX(); + } + + string Description() const { + return m_path; + } + + private: + string m_path; + UsbProDevice *m_device; +}; + + +/* + * The output port + */ +class UsbProOutputPort: public BasicOutputPort { + public: + UsbProOutputPort(UsbProDevice *parent, unsigned int id, const string &path) + : BasicOutputPort(parent, id), + m_path(path), + m_device(parent) {} + + bool WriteDMX(const DmxBuffer &buffer, uint8_t priority) { + return m_device->SendDMX(buffer); + (void) priority; + } + + void PostSetUniverse(Universe *old_universe, Universe *new_universe) { + if (!new_universe) + m_device->ChangeToReceiveMode(false); + (void) old_universe; + } + + string Description() const { return m_path; } + + private: + string m_path; + UsbProDevice *m_device; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_USBPRODEVICE_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.cpp new file mode 100644 index 0000000..e0d7530 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.cpp @@ -0,0 +1,316 @@ +/* + * 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 Library 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. + * + * UsbProPlugin.cpp + * The UsbPro plugin for ola + * Copyright (C) 2006-2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + +#include "ola/BaseTypes.h" +#include "ola/Closure.h" +#include "ola/Logging.h" +#include "ola/StringUtils.h" +#include "olad/PluginAdaptor.h" +#include "olad/Preferences.h" + +#include "plugins/usbpro/UsbProPlugin.h" +#include "plugins/usbpro/ArduinoRGBDevice.h" +#include "plugins/usbpro/DmxTriDevice.h" +#include "plugins/usbpro/UsbProDevice.h" + + +namespace ola { +namespace plugin { +namespace usbpro { + +const char UsbProPlugin::DEFAULT_DEVICE_DIR[] = "/dev"; +const char UsbProPlugin::DEFAULT_PRO_FPS_LIMIT[] = "190"; +const char UsbProPlugin::DEVICE_DIR_KEY[] = "device_dir"; +const char UsbProPlugin::DEVICE_PREFIX_KEY[] = "device_prefix"; +const char UsbProPlugin::LINUX_DEVICE_PREFIX[] = "ttyUSB"; +const char UsbProPlugin::MAC_DEVICE_PREFIX[] = "cu.usbserial-"; +const char UsbProPlugin::PLUGIN_NAME[] = "Enttec USB Pro"; +const char UsbProPlugin::PLUGIN_PREFIX[] = "usbpro"; +const char UsbProPlugin::USBPRO_DEVICE_NAME[] = "Enttec Usb Pro Device"; +const char UsbProPlugin::USB_PRO_FPS_LIMIT_KEY[] = "pro_fps_limit"; + + +/* + * Return the description for this plugin + */ +string UsbProPlugin::Description() const { + return +"Enttec USB Pro Plugin\n" +"----------------------------\n" +"\n" +"This plugin supports devices that implement the Enttec USB Pro specfication\n" +"including the DMX USB Pro, the DMXking USB DMX512-A & the DMX-TRI. See\n" +"http://opendmx.net/index.php/USB_Protocol_Extensions for more info.\n" +"\n" +"--- Config file : ola-usbpro.conf ---\n" +"\n" +"device_dir = /dev\n" +"The directory to look for devices in\n" +"\n" +"device_prefix = ttyUSB\n" +"The prefix of filenames to consider as devices, multiple keys are allowed\n" +"\n" +"pro_fps_limit = 190\n" +"The max frames per second to send to a Usb Pro or DMXKing device\n"; +} + + +/* + * Called when a device is removed + */ +void UsbProPlugin::DeviceRemoved(UsbDevice *device) { + vector::iterator iter; + + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) { + if (*iter == device) { + break; + } + } + + if (iter == m_devices.end()) { + OLA_WARN << "Couldn't find the device that was removed"; + return; + } + + DeleteDevice(device); + m_devices.erase(iter); +} + + +/* + * Called when a new widget is detected + * @param widget a pointer to a UsbWidget whose ownership is transferred to us. + * @param information A DeviceInformation struct for this widget + */ +void UsbProPlugin::NewWidget(class UsbWidget *widget, + const DeviceInformation &information) { + string device_name = information.manufactuer; + if (!(information.manufactuer.empty() || + information.device.empty())) + device_name += " - "; + device_name += information.device; + uint32_t serial; + memcpy(&serial, information.serial, sizeof(serial)); + widget->SetMessageHandler(NULL); + + switch (information.esta_id) { + case OPEN_LIGHTING_ESTA_CODE: + if (information.device_id == OPEN_LIGHTING_RGB_MIXER_ID || + information.device_id == OPEN_LIGHTING_PACKETHEADS_ID) { + AddDevice(new ArduinoRGBDevice( + m_plugin_adaptor, + this, + device_name, + widget, + information.esta_id, + information.device_id, + serial)); + return; + } + break; + case JESE_ESTA_ID: + if (information.device_id == JESE_DMX_TRI_ID) { + AddDevice(new DmxTriDevice( + m_plugin_adaptor, + this, + device_name, + widget, + information.esta_id, + information.device_id, + serial)); + return; + } + break; + case DMX_KING_ESTA_ID: + if (information.device_id == DMX_KING_DEVICE_ID) { + // DMxKing devices are drop in replacements for a Usb Pro + AddDevice(new UsbProDevice( + m_plugin_adaptor, + this, + device_name, + widget, + information.esta_id, + information.device_id, + serial, + GetProFrameLimit())); + return; + } + } + OLA_WARN << "Defaulting to a Usb Pro device"; + device_name = USBPRO_DEVICE_NAME; + AddDevice(new UsbProDevice( + m_plugin_adaptor, + this, + device_name, + widget, + ENTTEC_ESTA_ID, + 0, // assume device id is 0 + serial, + GetProFrameLimit())); +} + + +/* + * Add a new device to the list + * @param device the new UsbDevice + */ +void UsbProPlugin::AddDevice(UsbDevice *device) { + if (!device->Start()) { + delete device; + return; + } + + device->SetOnRemove(NewSingleClosure(this, + &UsbProPlugin::DeviceRemoved, + device)); + m_devices.push_back(device); + m_plugin_adaptor->RegisterDevice(device); +} + + +/* + * Start the plugin + */ +bool UsbProPlugin::StartHook() { + m_detector.SetListener(this); + vector::iterator it; + vector device_paths = FindCandiateDevices(); + + for (it = device_paths.begin(); it != device_paths.end(); ++it) + // NewWidget (above) will be called when discovery completes. + m_detector.Discover(*it); + return true; +} + + +/* + * Stop the plugin + * @return true on sucess, false on failure + */ +bool UsbProPlugin::StopHook() { + vector::iterator iter; + for (iter = m_devices.begin(); iter != m_devices.end(); ++iter) + DeleteDevice(*iter); + m_devices.clear(); + return true; +} + + +/* + * Default to sensible values + */ +bool UsbProPlugin::SetDefaultPreferences() { + if (!m_preferences) + return false; + + bool save = false; + + vector device_prefixes = + m_preferences->GetMultipleValue(DEVICE_PREFIX_KEY); + if (!device_prefixes.size()) { + m_preferences->SetMultipleValue(DEVICE_PREFIX_KEY, LINUX_DEVICE_PREFIX); + m_preferences->SetMultipleValue(DEVICE_PREFIX_KEY, MAC_DEVICE_PREFIX); + save = true; + } + + save |= m_preferences->SetDefaultValue(DEVICE_DIR_KEY, StringValidator(), + DEFAULT_DEVICE_DIR); + + save |= m_preferences->SetDefaultValue(USB_PRO_FPS_LIMIT_KEY, + IntValidator(0, MAX_PRO_FPS_LIMIT), + DEFAULT_PRO_FPS_LIMIT); + + if (save) + m_preferences->Save(); + + device_prefixes = m_preferences->GetMultipleValue(DEVICE_PREFIX_KEY); + if (!device_prefixes.size()) + return false; + return true; +} + + +void UsbProPlugin::DeleteDevice(UsbDevice *device) { + m_plugin_adaptor->UnregisterDevice(device); + device->Stop(); + delete device; +} + + +/* + * Look for candidate devices in /dev + * @returns a list of paths that may be usb pro devices + */ +vector UsbProPlugin::FindCandiateDevices() { + vector device_paths; + + vector device_prefixes = + m_preferences->GetMultipleValue(DEVICE_PREFIX_KEY); + string device_dir = m_preferences->GetValue(DEVICE_DIR_KEY); + + if (device_prefixes.size()) { + DIR *dp; + struct dirent dir_ent; + struct dirent *dir_ent_p; + if ((dp = opendir(device_dir.data())) == NULL) { + OLA_WARN << "Could not open " << device_dir << ":" << strerror(errno); + return device_paths; + } + + readdir_r(dp, &dir_ent, &dir_ent_p); + while (dir_ent_p != NULL) { + vector::const_iterator iter; + for (iter = device_prefixes.begin(); iter != device_prefixes.end(); + ++iter) { + if (!strncmp(dir_ent_p->d_name, iter->data(), iter->size())) { + stringstream str; + str << device_dir << "/" << dir_ent_p->d_name; + device_paths.push_back(str.str()); + OLA_INFO << "Found potential USB Pro like device at " << str.str(); + } + } + readdir_r(dp, &dir_ent, &dir_ent_p); + } + closedir(dp); + } + return device_paths; +} + + +/* + * Get the Frames per second limit for a pro device + */ +unsigned int UsbProPlugin::GetProFrameLimit() { + unsigned int fps_limit; + if (!StringToUInt(m_preferences->GetValue(USB_PRO_FPS_LIMIT_KEY) , + &fps_limit)) + StringToUInt(DEFAULT_PRO_FPS_LIMIT, &fps_limit); + return fps_limit; +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.h new file mode 100644 index 0000000..647a899 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbProPlugin.h @@ -0,0 +1,89 @@ +/* + * 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 Library 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. + * + * UsbProPlugin.h + * Interface for the usbpro plugin class + * Copyright (C) 2006 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_USBPROPLUGIN_H_ +#define PLUGINS_USBPRO_USBPROPLUGIN_H_ + +#include +#include +#include "ola/network/Socket.h" +#include "ola/plugin_id.h" +#include "olad/Plugin.h" +#include "plugins/usbpro/UsbDevice.h" +#include "plugins/usbpro/WidgetDetector.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +using ola::network::ConnectedSocket; + +class UsbProPlugin: public ola::Plugin, WidgetDetectorListener { + public: + explicit UsbProPlugin(const PluginAdaptor *plugin_adaptor): + Plugin(plugin_adaptor), + m_detector(plugin_adaptor) {} + + string Name() const { return PLUGIN_NAME; } + string Description() const; + ola_plugin_id Id() const { return OLA_PLUGIN_USBPRO; } + void DeviceRemoved(UsbDevice *device); + string PluginPrefix() const { return PLUGIN_PREFIX; } + + void NewWidget(class UsbWidget *widget, + const DeviceInformation &information); + void AddDevice(UsbDevice *device); + + private: + bool StartHook(); + bool StopHook(); + bool SetDefaultPreferences(); + void DeleteDevice(UsbDevice *device); + vector FindCandiateDevices(); + unsigned int GetProFrameLimit(); + + vector m_devices; // list of our devices + WidgetDetector m_detector; + + static const char DEFAULT_DEVICE_DIR[]; + static const char DEFAULT_PRO_FPS_LIMIT[]; + static const char DEVICE_DIR_KEY[]; + static const char DEVICE_PREFIX_KEY[]; + static const char LINUX_DEVICE_PREFIX[]; + static const char MAC_DEVICE_PREFIX[]; + static const char PLUGIN_NAME[]; + static const char PLUGIN_PREFIX[]; + static const char USBPRO_DEVICE_NAME[]; + static const char USB_PRO_FPS_LIMIT_KEY[]; + static const unsigned int MAX_PRO_FPS_LIMIT = 1000; + + // Open Lighting id is in BaseTypes.h + static const uint16_t JESE_ESTA_ID = 0x6864; + static const uint16_t DMX_KING_ESTA_ID = 0x6a6b; + static const uint16_t OPEN_LIGHTING_RGB_MIXER_ID = 1; + static const uint16_t OPEN_LIGHTING_PACKETHEADS_ID = 2; + static const uint16_t JESE_DMX_TRI_ID = 1; + static const uint16_t DMX_KING_DEVICE_ID = 0; + static const uint16_t ENTTEC_ESTA_ID = 0x454E; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_USBPROPLUGIN_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.cpp new file mode 100644 index 0000000..a4e86b8 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.cpp @@ -0,0 +1,173 @@ +/* + * 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 Library 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. + * + * UsbWidget.cpp + * Read and Write to a USB Widget. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include "ola/Logging.h" +#include "plugins/usbpro/UsbWidget.h" + +namespace ola { +namespace plugin { +namespace usbpro { + + +UsbWidget::UsbWidget(const SelectServerAdaptor &ss_adaptor, int fd) + : m_listener(NULL), + m_socket(NULL), + m_state(PRE_SOM), + m_bytes_received(0) { + m_socket = new ola::network::DeviceSocket(fd); + ss_adaptor.AddSocket(m_socket, true); + m_socket->SetOnData(NewClosure(this, &UsbWidget::SocketReady)); +} + + +UsbWidget::~UsbWidget() { + // don't delete because ownership is transferred to the ss so that device + // removal works correctly. If you delete the socket the OnClose closure will + // be deleted, which breaks if it's already running. + m_socket->Close(); + m_socket = NULL; +} + + +/* + * Set the onRemove handler + */ +void UsbWidget::SetOnRemove(ola::SingleUseClosure *on_close) { + m_socket->SetOnClose(on_close); +} + + +/* + * Read data from the widget + */ +void UsbWidget::SocketReady() { + while (m_socket->DataRemaining() > 0) { + ReceiveMessage(); + } +} + + +/* + * Send the msg + * @return true if successful, false otherwise + */ +bool UsbWidget::SendMessage(uint8_t label, + unsigned int length, + const uint8_t *data) const { + message_header header; + header.som = SOM; + header.label = label; + header.len = length & 0xFF; + header.len_hi = (length & 0xFF00) >> 8; + + // should really use writev here instead + ssize_t bytes_sent = m_socket->Send(reinterpret_cast(&header), + sizeof(header)); + if (bytes_sent != sizeof(header)) + // we've probably screwed framing at this point + return false; + + if (length) { + unsigned int bytes_sent = m_socket->Send(data, length); + if (bytes_sent != length) + // we've probably screwed framing at this point + return false; + } + + uint8_t eom = EOM; + bytes_sent = m_socket->Send(&eom, sizeof(EOM)); + if (bytes_sent != sizeof(EOM)) + return false; + return true; +} + + +/* + * Read the data and handle the messages. + */ +void UsbWidget::ReceiveMessage() { + unsigned int cnt, packet_length; + + switch (m_state) { + case PRE_SOM: + do { + m_socket->Receive(&m_header.som, 1, cnt); + if (cnt != 1) + return; + } while (m_header.som != SOM); + m_state = RECV_LABEL; + case RECV_LABEL: + m_socket->Receive(&m_header.label, 1, cnt); + if (cnt != 1) + return; + m_state = RECV_SIZE_LO; + case RECV_SIZE_LO: + m_socket->Receive(&m_header.len, 1, cnt); + if (cnt != 1) + return; + m_state = RECV_SIZE_HI; + case RECV_SIZE_HI: + m_socket->Receive(&m_header.len_hi, 1, cnt); + if (cnt != 1) + return; + + if ((m_header.len_hi << 8) + m_header.len > MAX_DATA_SIZE) { + m_state = PRE_SOM; + return; + } + m_bytes_received = 0; + m_state = RECV_BODY; + case RECV_BODY: + packet_length = (m_header.len_hi << 8) + m_header.len; + m_socket->Receive( + reinterpret_cast(&m_recv_buffer) + m_bytes_received, + packet_length - m_bytes_received, + cnt); + + if (!cnt) + return; + + m_bytes_received += cnt; + if (m_bytes_received != packet_length) + return; + + m_state = RECV_EOM; + case RECV_EOM: + // check this is a valid frame with an end byte + uint8_t eom; + m_socket->Receive(&eom, 1, cnt); + if (cnt != 1) + return; + + packet_length = (m_header.len_hi << 8) + m_header.len; + + if (eom == EOM && m_listener) + m_listener->HandleMessage(this, + m_header.label, + packet_length, + m_recv_buffer); + m_state = PRE_SOM; + } + return; +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.h new file mode 100644 index 0000000..7cb8d53 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/UsbWidget.h @@ -0,0 +1,114 @@ +/* + * 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 Library 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. + * + * UsbWidget.h + * Read and Write to a USB Widget. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_USBWIDGET_H_ +#define PLUGINS_USBPRO_USBWIDGET_H_ + +#include +#include +#include "ola/network/Socket.h" +#include "olad/PluginAdaptor.h" + +namespace ola { +namespace plugin { +namespace usbpro { + +class UsbWidget; + +/* + * Implement this to respond to widget messages. + */ +class WidgetListener { + public: + virtual ~WidgetListener() {} + virtual void HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data) = 0; +}; + + +/* + * Abstract away the interface to the select server + */ +class SelectServerAdaptor { + public: + virtual ~SelectServerAdaptor() {} + virtual bool AddSocket(ola::network::ConnectedSocket *socket, + bool delete_on_close = false) const = 0; +}; + + +/* + * The basic representation of a widget. This knows how to send and recieve usb + * pro messages. + */ +class UsbWidget { + public: + UsbWidget(const SelectServerAdaptor &ss_adaptor, int fd); + ~UsbWidget(); + void SetMessageHandler(WidgetListener *listener) { m_listener = listener; } + void SetOnRemove(ola::SingleUseClosure *on_close); + + void SocketReady(); + + bool SendMessage(uint8_t label, unsigned int length, + const uint8_t *data) const; + + static const uint8_t DMX_LABEL = 6; + static const uint8_t SERIAL_LABEL = 10; + static const uint8_t MANUFACTURER_LABEL = 77; + static const uint8_t DEVICE_LABEL = 78; + + private: + typedef enum { + PRE_SOM, + RECV_LABEL, + RECV_SIZE_LO, + RECV_SIZE_HI, + RECV_BODY, + RECV_EOM, + } receive_state; + + enum {MAX_DATA_SIZE = 600}; + + typedef struct { + uint8_t som; + uint8_t label; + uint8_t len; + uint8_t len_hi; + } message_header; + + WidgetListener *m_listener; + ola::network::DeviceSocket *m_socket; + receive_state m_state; + unsigned int m_bytes_received; + message_header m_header; + uint8_t m_recv_buffer[MAX_DATA_SIZE]; + + void ReceiveMessage(); + + static const uint8_t EOM = 0xe7; + static const uint8_t SOM = 0x7e; +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_USBWIDGET_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.cpp b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.cpp new file mode 100644 index 0000000..94c51df --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.cpp @@ -0,0 +1,242 @@ +/* + * 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 Library 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. + * + * WidgetDetector.cpp + * Handles creating UsbWidget objects. + * Copyright (C) 2010 Simon Newton + * + * The device represents the widget. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ola/Logging.h" +#include "ola/network/Socket.h" +#include "ola/network/NetworkUtils.h" +#include "plugins/usbpro/WidgetDetector.h" +#include "plugins/usbpro/UsbWidget.h" + +namespace ola { +namespace plugin { +namespace usbpro { + + +using std::set; +using ola::network::NetworkToHost; + +/* + * Delete any in-discovery widgets + */ +WidgetDetector::~WidgetDetector() { + map::iterator iter; + for (iter = m_widgets.begin(); iter != m_widgets.end(); ++iter) + delete iter->first; + m_widgets.clear(); + + if (m_timeout_id != ola::network::INVALID_TIMEOUT) + m_plugin_adaptor->RemoveTimeout(m_timeout_id); +} + + +/* + * Start the discovery process for a widget + * @param path the path to the device + * @return is the process begun ok, false otherwise. + */ +bool WidgetDetector::Discover(const string &path) { + struct termios newtio; + int fd = open(path.data(), O_RDWR | O_NONBLOCK | O_NOCTTY); + + if (fd == -1) { + OLA_WARN << "Failed to open " << path << " " << strerror(errno); + return false; + } + + bzero(&newtio, sizeof(newtio)); // clear struct for new port settings + cfsetispeed(&newtio, B115200); + cfsetospeed(&newtio, B115200); + tcsetattr(fd, TCSANOW, &newtio); + + UsbWidget *widget = new UsbWidget( + PluginAdaptorSelectServerAdaptor(m_plugin_adaptor), + fd); + widget->SetMessageHandler(this); + + bool ret = SendDiscoveryMessages(widget); + + if (!ret) { + delete widget; + return false; + } + + m_widgets[widget]; + + // Set delete_on_close here so that device removal works + /* + widget->SetOnClose(NewSingleClosure(this, + &WidgetDetector::DeviceClosed, + widget)); + */ + + // register a timeout for this widget + m_timeout_id = m_plugin_adaptor->RegisterSingleTimeout( + 1000, + NewSingleClosure(this, &WidgetDetector::DiscoveryTimeout, widget)); + return true; +} + + +/* + * Called by the widgets when they get messages + */ +void WidgetDetector::HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data) { + switch (label) { + case UsbWidget::MANUFACTURER_LABEL: + HandleIdResponse(widget, length, data, false); + break; + case UsbWidget::DEVICE_LABEL: + HandleIdResponse(widget, length, data, true); + break; + case UsbWidget::SERIAL_LABEL: + HandleSerialResponse(widget, length, data); + break; + default: + OLA_WARN << "Unknown response label"; + } +} + + +/* + * Called if a widget fails to respond in a given interval + */ +void WidgetDetector::DiscoveryTimeout(UsbWidget *widget) { + m_timeout_id = ola::network::INVALID_TIMEOUT; + map::iterator iter = m_widgets.find(widget); + + if (iter != m_widgets.end()) { + OLA_WARN << "Usb Widget didn't respond to messages, esta id " << + iter->second.esta_id << ", device id " << iter->second.device_id; + delete widget; + m_widgets.erase(iter); + } +} + + +/* + * Send the discovery messages to the widget + * @param widget the widget to send to + */ +bool WidgetDetector::SendDiscoveryMessages(UsbWidget *widget) { + if (!widget->SendMessage(UsbWidget::MANUFACTURER_LABEL, 0, NULL)) + return false; + + if (!widget->SendMessage(UsbWidget::DEVICE_LABEL, 0, NULL)) + return false; + + return widget->SendMessage(UsbWidget::SERIAL_LABEL, 0, NULL); +} + + +/* + * Handle a Device Manufacturer or Device Name response. + * @param widget the UsbWidget + * @param length length of the response + * @param data pointer to the response data + * @param is_device true if this is a device response, false if it's a + * manufactuer response. + */ +void WidgetDetector::HandleIdResponse(UsbWidget *widget, + unsigned int length, + const uint8_t *data, + bool is_device) { + id_response response; + memcpy(&response, data, length); + response.terminator = 0; + + map::iterator iter = m_widgets.find(widget); + + if (iter == m_widgets.end()) + return; + + uint16_t id = (response.id_high << 8) + response.id_low; + if (length < sizeof(id)) { + OLA_WARN << "Received small response packet"; + return; + } + + if (is_device) { + iter->second.device_id = id; + iter->second.device = string( + reinterpret_cast(response.text)); + } else { + iter->second.esta_id = id; + iter->second.manufactuer = string( + reinterpret_cast(response.text)); + } +} + + +/* + * Handle a serial response, this ends the device detection phase. + */ +void WidgetDetector::HandleSerialResponse(UsbWidget *widget, + unsigned int length, + const uint8_t *data) { + map::iterator iter = m_widgets.find(widget); + + if (iter == m_widgets.end()) + return; + DeviceInformation information = iter->second; + + if (length == DeviceInformation::SERIAL_LENGTH) + memcpy(information.serial, data, DeviceInformation::SERIAL_LENGTH); + else + OLA_WARN << "Serial number response size " << length << " != " << + DeviceInformation::SERIAL_LENGTH; + + m_widgets.erase(iter); + + OLA_INFO << "Detected USB Device: ESTA Id: 0x" << std::hex << + information.esta_id << " (" << information.manufactuer << "), device: " + << information.device_id << " (" << information.device << ")"; + + if (!m_listener) { + OLA_WARN << "No listener provided"; + return; + } + + m_listener->NewWidget(widget, information); + return; +} +} // usbpro +} // plugin +} // ola diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.h b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.h new file mode 100644 index 0000000..6cdbe2b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/WidgetDetector.h @@ -0,0 +1,134 @@ +/* + * 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 Library 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. + * + * WidgetDetector.h + * Handles creating UsbWidget objects. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef PLUGINS_USBPRO_WIDGETDETECTOR_H_ +#define PLUGINS_USBPRO_WIDGETDETECTOR_H_ + +#include +#include +#include +#include "olad/PluginAdaptor.h" +#include "plugins/usbpro/UsbWidget.h" + +namespace ola { +namespace plugin { +namespace usbpro { + + +/* + * Abstract away the interface to the select server + */ +class PluginAdaptorSelectServerAdaptor: public SelectServerAdaptor { + public: + explicit PluginAdaptorSelectServerAdaptor( + const ola::PluginAdaptor *plugin_adaptor): + m_plugin_adaptor(plugin_adaptor) { + } + + bool AddSocket(ola::network::ConnectedSocket *socket, + bool delete_on_close = false) const { + return m_plugin_adaptor->AddSocket(socket, delete_on_close); + } + + private: + const ola::PluginAdaptor *m_plugin_adaptor; +}; + + +/* + * Contains information about a usb device. + */ +class DeviceInformation { + public: + DeviceInformation(): + esta_id(0), + device_id(0) { + memset(serial, 0, SERIAL_LENGTH); + } + enum {SERIAL_LENGTH = 4}; + + uint16_t esta_id; + uint16_t device_id; + string manufactuer; + string device; + uint8_t serial[SERIAL_LENGTH]; +}; + + +/* + * Implement this to respond to widget discovery events + */ +class WidgetDetectorListener { + public: + virtual ~WidgetDetectorListener() {} + + /* + * Ownership of the widget is transferred here + */ + virtual void NewWidget(class UsbWidget *widget, + const DeviceInformation &info) = 0; +}; + + +/* + * Handles widget discovery + */ +class WidgetDetector: public WidgetListener { + public: + explicit WidgetDetector(const ola::PluginAdaptor *plugin_adaptor): + m_plugin_adaptor(plugin_adaptor), + m_timeout_id(ola::network::INVALID_TIMEOUT) { + } + ~WidgetDetector(); + + void SetListener(WidgetDetectorListener *listener) { + m_listener = listener; + } + bool Discover(const string &path); + + // called by the widgets + void HandleMessage(UsbWidget *widget, uint8_t label, unsigned int length, + const uint8_t *data); + void DiscoveryTimeout(UsbWidget *widget); + int DeviceClosed(UsbWidget *widget); + + private: + typedef struct { + uint8_t id_low; + uint8_t id_high; + uint8_t text[32]; + uint8_t terminator; + } id_response; + + WidgetDetectorListener *m_listener; + const ola::PluginAdaptor *m_plugin_adaptor; + std::map m_widgets; + timeout_id m_timeout_id; + + bool SendDiscoveryMessages(UsbWidget *widget); + void HandleIdResponse(UsbWidget *widget, unsigned int length, + const uint8_t *data, bool is_device); + void HandleSerialResponse(UsbWidget *widget, unsigned int length, + const uint8_t *data); +}; +} // usbpro +} // plugin +} // ola +#endif // PLUGINS_USBPRO_WIDGETDETECTOR_H_ diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.am b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.am new file mode 100644 index 0000000..1395618 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.am @@ -0,0 +1,19 @@ +include $(top_srcdir)/common.mk + +pkgincludedir = $(includedir)/ola/usbpro +lib_LTLIBRARIES = libolausbproconf.la +nodist_pkginclude_HEADERS = UsbProConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolausbproconf.pc + +BUILT_SOURCES = UsbProConfigMessages.pb.cc UsbProConfigMessages.pb.h + +nodist_libolausbproconf_la_SOURCES = UsbProConfigMessages.pb.cc + +EXTRA_DIST = UsbProConfigMessages.proto + +UsbProConfigMessages.pb.cc UsbProConfigMessages.pb.h: UsbProConfigMessages.proto + protoc --cpp_out ./ UsbProConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.in b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.in new file mode 100644 index 0000000..fb3db1d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/Makefile.in @@ -0,0 +1,553 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/libolausbproconf.pc.in $(top_srcdir)/common.mk +subdir = plugins/usbpro/messages +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = libolausbproconf.pc +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(pkgincludedir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libolausbproconf_la_LIBADD = +nodist_libolausbproconf_la_OBJECTS = UsbProConfigMessages.pb.lo +libolausbproconf_la_OBJECTS = $(nodist_libolausbproconf_la_OBJECTS) +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(nodist_libolausbproconf_la_SOURCES) +DIST_SOURCES = +pkgconfigDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgconfig_DATA) +nodist_pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER) +HEADERS = $(nodist_pkginclude_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkgincludedir = $(includedir)/ola/usbpro +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +lib_LTLIBRARIES = libolausbproconf.la +nodist_pkginclude_HEADERS = UsbProConfigMessages.pb.h +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libolausbproconf.pc +BUILT_SOURCES = UsbProConfigMessages.pb.cc UsbProConfigMessages.pb.h +nodist_libolausbproconf_la_SOURCES = UsbProConfigMessages.pb.cc +EXTRA_DIST = UsbProConfigMessages.proto +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .cc .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/usbpro/messages/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu plugins/usbpro/messages/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +libolausbproconf.pc: $(top_builddir)/config.status $(srcdir)/libolausbproconf.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + p=$(am__strip_dir) \ + echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ + $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolausbproconf.la: $(libolausbproconf_la_OBJECTS) $(libolausbproconf_la_DEPENDENCIES) + $(CXXLINK) -rpath $(libdir) $(libolausbproconf_la_OBJECTS) $(libolausbproconf_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UsbProConfigMessages.pb.Plo@am__quote@ + +.cc.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ + done +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(nodist_pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + $(nodist_pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \ + rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-nodist_pkgincludeHEADERS \ + install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man \ + install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgconfigDATA + + +UsbProConfigMessages.pb.cc UsbProConfigMessages.pb.h: UsbProConfigMessages.proto + protoc --cpp_out ./ UsbProConfigMessages.proto + +clean-local: + rm -f *.pb.{h,cc} +# 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/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/UsbProConfigMessages.proto b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/UsbProConfigMessages.proto new file mode 100644 index 0000000..34bcce5 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/UsbProConfigMessages.proto @@ -0,0 +1,62 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ConfigMessages.proto + * Defines the protocol buffers used to configure the Usb Pro device + * Copyright (C) 2005 - 2009 Simon Newton + */ + +package ola.plugin.usbpro; + +message ParameterReply { + required uint32 firmware_high = 1; + required uint32 firmware = 2; + required uint32 break_time = 3; + required uint32 mab_time = 4; + required uint32 rate = 5; +} + +/* + * Setting any one of these will update the widget, otherwise we just do a + * read. + */ +message ParameterRequest { + optional uint32 break_time = 1; + optional uint32 mab_time = 2; + optional uint32 rate = 3; +} + +message SerialNumberReply { + required string serial = 1; +} + +message Request { + enum RequestType { + USBPRO_PARAMETER_REQUEST = 1; + USBPRO_SERIAL_REQUEST = 2; + } + required RequestType type = 1; + optional ParameterRequest parameters = 2; +} + +message Reply { + enum ReplyType { + USBPRO_PARAMETER_REPLY = 1; + USBPRO_SERIAL_REPLY = 2; + } + required ReplyType type = 1; + optional ParameterReply parameters = 2; + optional SerialNumberReply serial_number = 3; +} diff --git a/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/libolausbproconf.pc.in b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/libolausbproconf.pc.in new file mode 100644 index 0000000..b962be7 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/plugins/usbpro/messages/libolausbproconf.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libolausbproconf +Version: @VERSION@ +Description: Open Lighting Architecture - UsbPro Config Messages +Libs: -lprotobuf diff --git a/open-lighting-architecture/ola-0.8.4/python/Makefile.am b/open-lighting-architecture/ola-0.8.4/python/Makefile.am new file mode 100644 index 0000000..7ed5eee --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/Makefile.am @@ -0,0 +1,33 @@ +# ola python client + +if BUILD_PYTHON_LIBS + +SUBDIRS = examples rpc + +artnet_path = ../plugins/artnet/messages +artnet_proto = $(artnet_path)/ArtnetConfigMessages.proto +ola_path = ../common/protocol +ola_proto = $(ola_path)/Ola.proto +usbpro_path = ../plugins/usbpro/messages +usbpro_proto = $(usbpro_path)/UsbProConfigMessages.proto + +output_files = ArtnetConfigMessages_pb2.py Ola_pb2.py \ + UsbProConfigMessages_pb2.py + +BUILT_SOURCES = $(output_files) +nodist_pkgpython_PYTHON = $(output_files) +pkgpython_PYTHON = OlaClient.py __init__.py + +ArtnetConfigMessages_pb2.py: $(artnet_proto) + protoc --python_out ./ -I $(artnet_path) $(artnet_proto) + +Ola_pb2.py: $(ola_proto) + protoc --python_out ./ -I $(ola_path) $(ola_proto) + +UsbProConfigMessages_pb2.py: $(usbpro_proto) + protoc --python_out ./ -I $(usbpro_path) $(usbpro_proto) + +clean-local: + rm -f ArtnetConfigMessages_pb2.* Ola_pb2.* UsbProConfigMessages_pb2.* + +endif diff --git a/open-lighting-architecture/ola-0.8.4/python/Makefile.in b/open-lighting-architecture/ola-0.8.4/python/Makefile.in new file mode 100644 index 0000000..0862574 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/Makefile.in @@ -0,0 +1,615 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# ola python client +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = python +DIST_COMMON = $(am__pkgpython_PYTHON_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgpythondir)" \ + "$(DESTDIR)$(pkgpythondir)" +nodist_pkgpythonPYTHON_INSTALL = $(INSTALL_DATA) +am__pkgpython_PYTHON_DIST = OlaClient.py __init__.py +pkgpythonPYTHON_INSTALL = $(INSTALL_DATA) +py_compile = $(top_srcdir)/config/py-compile +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = examples rpc +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +@BUILD_PYTHON_LIBS_TRUE@SUBDIRS = examples rpc +@BUILD_PYTHON_LIBS_TRUE@artnet_path = ../plugins/artnet/messages +@BUILD_PYTHON_LIBS_TRUE@artnet_proto = $(artnet_path)/ArtnetConfigMessages.proto +@BUILD_PYTHON_LIBS_TRUE@ola_path = ../common/protocol +@BUILD_PYTHON_LIBS_TRUE@ola_proto = $(ola_path)/Ola.proto +@BUILD_PYTHON_LIBS_TRUE@usbpro_path = ../plugins/usbpro/messages +@BUILD_PYTHON_LIBS_TRUE@usbpro_proto = $(usbpro_path)/UsbProConfigMessages.proto +@BUILD_PYTHON_LIBS_TRUE@output_files = ArtnetConfigMessages_pb2.py Ola_pb2.py \ +@BUILD_PYTHON_LIBS_TRUE@ UsbProConfigMessages_pb2.py + +@BUILD_PYTHON_LIBS_TRUE@BUILT_SOURCES = $(output_files) +@BUILD_PYTHON_LIBS_TRUE@nodist_pkgpython_PYTHON = $(output_files) +@BUILD_PYTHON_LIBS_TRUE@pkgpython_PYTHON = OlaClient.py __init__.py +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu python/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu python/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nodist_pkgpythonPYTHON: $(nodist_pkgpython_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(pkgpythondir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)" + @list='$(nodist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + f=$(am__strip_dir) \ + dlist="$$dlist $$f"; \ + echo " $(nodist_pkgpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pkgpythondir)/$$f'"; \ + $(nodist_pkgpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pkgpythondir)/$$f"; \ + else :; fi; \ + done; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(pkgpythondir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pkgpythondir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-nodist_pkgpythonPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkgpython_PYTHON)'; dlist=''; for p in $$list; do\ + f=$(am__strip_dir) \ + rm -f "$(DESTDIR)$(pkgpythondir)/$$f"; \ + rm -f "$(DESTDIR)$(pkgpythondir)/$${f}c"; \ + rm -f "$(DESTDIR)$(pkgpythondir)/$${f}o"; \ + done +install-pkgpythonPYTHON: $(pkgpython_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(pkgpythondir)" || $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)" + @list='$(pkgpython_PYTHON)'; dlist=''; for p in $$list; do\ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + f=$(am__strip_dir) \ + dlist="$$dlist $$f"; \ + echo " $(pkgpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(pkgpythondir)/$$f'"; \ + $(pkgpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(pkgpythondir)/$$f"; \ + else :; fi; \ + done; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(pkgpythondir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(pkgpythondir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-pkgpythonPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(pkgpython_PYTHON)'; dlist=''; for p in $$list; do\ + f=$(am__strip_dir) \ + rm -f "$(DESTDIR)$(pkgpythondir)/$$f"; \ + rm -f "$(DESTDIR)$(pkgpythondir)/$${f}c"; \ + rm -f "$(DESTDIR)$(pkgpythondir)/$${f}o"; \ + done + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgpythondir)" "$(DESTDIR)$(pkgpythondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +@BUILD_PYTHON_LIBS_FALSE@clean-local: +clean: clean-recursive + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-nodist_pkgpythonPYTHON \ + install-pkgpythonPYTHON + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-nodist_pkgpythonPYTHON \ + uninstall-pkgpythonPYTHON + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + clean-local ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-nodist_pkgpythonPYTHON \ + install-pdf install-pdf-am install-pkgpythonPYTHON install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-nodist_pkgpythonPYTHON \ + uninstall-pkgpythonPYTHON + + +@BUILD_PYTHON_LIBS_TRUE@ArtnetConfigMessages_pb2.py: $(artnet_proto) +@BUILD_PYTHON_LIBS_TRUE@ protoc --python_out ./ -I $(artnet_path) $(artnet_proto) + +@BUILD_PYTHON_LIBS_TRUE@Ola_pb2.py: $(ola_proto) +@BUILD_PYTHON_LIBS_TRUE@ protoc --python_out ./ -I $(ola_path) $(ola_proto) + +@BUILD_PYTHON_LIBS_TRUE@UsbProConfigMessages_pb2.py: $(usbpro_proto) +@BUILD_PYTHON_LIBS_TRUE@ protoc --python_out ./ -I $(usbpro_path) $(usbpro_proto) + +@BUILD_PYTHON_LIBS_TRUE@clean-local: +@BUILD_PYTHON_LIBS_TRUE@ rm -f ArtnetConfigMessages_pb2.* Ola_pb2.* UsbProConfigMessages_pb2.* +# 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/open-lighting-architecture/ola-0.8.4/python/OlaClient.py b/open-lighting-architecture/ola-0.8.4/python/OlaClient.py new file mode 100644 index 0000000..e1d3e33 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/OlaClient.py @@ -0,0 +1,471 @@ +# 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 Library 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. +# +# OlaClient.py +# Copyright (C) 2005-2009 Simon Newton + +"""The client used to communicate with the Ola Server.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import array +from ola.rpc.StreamRpcChannel import StreamRpcChannel +from ola.rpc.SimpleRpcController import SimpleRpcController +from ola import Ola_pb2 + +"""The port that the OLA server listens on.""" +OLA_PORT = 9010 + +class Plugin(object): + """Represents a plugin. + + Attributes: + id: the id of this plugin + name: the name of this plugin + description: the description of this plugin + """ + def __init__(self, plugin_id, name, description): + self.id = plugin_id + self.name = name + self.description = description + + def __cmp__(self, other): + return cmp(self.id, other.id) + +# Populate the Plugin class attributes from the protobuf +for value in Ola_pb2._PLUGINIDS.values: + setattr(Plugin, value.name, value.number) + + +class Device(object): + """Represents a device. + + Attributes: + id: the unique id of this device + alias: the integer alias for this device + name: the name of this device + plugin_id: the plugin that this device belongs to + input_ports: a list of Input Port objects + output_ports: a list of Output Port objects + """ + def __init__(self, device_id, alias, name, plugin_id, input_ports, + output_ports): + self.id = device_id + self.alias = alias + self.name = name + self.plugin_id = plugin_id + self.input_ports = sorted(input_ports) + self.output_ports = sorted(output_ports) + + def __cmp__(self, other): + return cmp(self.alias, other.alias) + + +class Port(object): + """Represents a port. + + Attributes: + id: the unique id of this port + universe: the universe that this port belongs to + active: True if this port is active + description: the description of the port + """ + def __init__(self, port_id, universe, active, description): + self.id = port_id + self.universe = universe + self.active = active + self.description = description + + def __cmp__(self, other): + return cmp(self.id, other.id) + + +class Universe(object): + """Represents a universe. + + Attributes: + id: the integer universe id + name: the name of this universe + merge_mode: the merge mode this universe is using + """ + + LTP = Ola_pb2.LTP + HTP = Ola_pb2.HTP + + def __init__(self, universe_id, name, merge_mode): + self.id = universe_id + self.name = name + self.merge_mode = merge_mode + + def __cmp__(self, other): + return cmp(self.id, other.id) + + +class RequestStatus(object): + """Represents the status of an reqeust. + + Attributes: + state: the state of the operation + message: an error message if it failed + """ + SUCCESS, FAILED, CANCELLED = range(3) + + def __init__(self, state=SUCCESS, message=None): + self.state = state + self.message = message + + def Succeeded(self): + """Returns true if this request succeeded.""" + return self.state == self.SUCCESS + + +class OlaClient(Ola_pb2.OlaClientService): + """The client used to communicate with olad.""" + def __init__(self, socket): + """Create a new client. + + Args: + socket: the socket to use for communications. + """ + self._socket = socket + self._channel = StreamRpcChannel(socket, self) + self._stub = Ola_pb2.OlaServerService_Stub(self._channel) + self._universe_callbacks = {} + + def SocketReady(self): + """Called when the socket has new data.""" + self._channel.SocketReady() + + def FetchPlugins(self, callback, + plugin_filter=Plugin.OLA_PLUGIN_ALL, + include_description=False): + """Fetch the list of plugins. + + Args: + callback: the function to call once complete, takes two arguments, a + RequestStatus object and a list of Plugin objects + filter: the id of the plugin if you want to filter the results + include_description: whether to include the plugin description or not + """ + controller = SimpleRpcController() + request = Ola_pb2.PluginInfoRequest() + request.plugin_id = plugin_filter + request.include_description = include_description + done = lambda x, y: self._PluginInfoComplete(callback, x, y) + self._stub.GetPluginInfo(controller, request, done) + + def FetchDevices(self, callback, plugin_filter=Plugin.OLA_PLUGIN_ALL): + """Fetch a list of devices from the server. + + Args: + callback: The function to call once complete, takes two arguments, a + RequestStatus object and a list of Device objects. + filter: a plugin id to filter by + """ + controller = SimpleRpcController() + request = Ola_pb2.DeviceInfoRequest() + request.plugin_id = plugin_filter + done = lambda x, y: self._DeviceInfoComplete(callback, x, y) + self._stub.GetDeviceInfo(controller, request, done) + + def FetchUniverses(self, callback): + """Fetch a list of universes from the server + + Args: + callback: The function to call once complete, takes two arguments, a + RequestStatus object and a list of Universe objects. + """ + controller = SimpleRpcController() + request = Ola_pb2.UniverseInfoRequest() + done = lambda x, y: self._UniverseInfoComplete(callback, x, y) + self._stub.GetUniverseInfo(controller, request, done) + + def FetchDmx(self, universe, callback): + """Fetch a list of universes from the server + + Args: + universe: the universe to fetch the data for + callback: The function to call once complete, takes three arguments, a + RequestStatus object, a universe number and a list of dmx data. + """ + controller = SimpleRpcController() + request = Ola_pb2.UniverseInfoRequest() + request.universe = universe + done = lambda x, y: self._GetDmxComplete(callback, x, y) + self._stub.GetDmx(controller, request, done) + + def SendDmx(self, universe, data, callback=None): + """Send DMX data to the server + + Args: + universe: the universe to fetch the data for + data: An array object with the DMX data + callback: The function to call once complete, takes one argument, a + RequestStatus object. + """ + controller = SimpleRpcController() + request = Ola_pb2.DmxData() + request.universe = universe + request.data = data.tostring() + done = lambda x, y: self._AckMessageComplete(callback, x, y) + self._stub.UpdateDmxData(controller, request, done) + + def SetUniverseName(self, universe, name, callback=None): + """Set the name of a universe. + + Args: + universe: the universe to set the name of + name: the new name for the universe + callback: The function to call once complete, takes one argument, a + RequestStatus object. + """ + controller = SimpleRpcController() + request = Ola_pb2.UniverseNameRequest() + request.universe = universe + request.name = name + done = lambda x, y: self._AckMessageComplete(callback, x, y) + self._stub.SetUniverseName(controller, request, done) + + def SetUniverseMergeMode(self, universe, merge_mode, callback=None): + """Set the merge_mode of a universe. + + Args: + universe: the universe to set the name of + merge_mode: either Universe.HTP or Universe.LTP + callback: The function to call once complete, takes one argument, a + RequestStatus object. + """ + controller = SimpleRpcController() + request = Ola_pb2.MergeModeRequest() + request.universe = universe + request.merge_mode = merge_mode + done = lambda x, y: self._AckMessageComplete(callback, x, y) + self._stub.SetMergeMode(controller, request, done) + + def RegisterUniverse(self, universe, action, data_callback, callback=None): + """Register to receive dmx updates for a universe. + + Args: + universe: the universe to set the name of + action: OlaClient.REGISTER or OlaClient.UNREGISTER + data_callback: the function to be called when there is new data, passed + a single argument of type array. + callback: The function to call once complete, takes one argument, a + RequestStatus object. + """ + controller = SimpleRpcController() + request = Ola_pb2.RegisterDmxRequest() + request.universe = universe + request.action = action + done = lambda x, y: self._AckMessageComplete(callback, x, y) + self._stub.RegisterForDmx(controller, request, done) + if action == self.PATCH: + self._universe_callbacks[universe] = data_callback + elif universe in self._universe_callbacks: + del self._universe_callbacks[universe] + + def PatchPort(self, device_alias, port, action, universe, callback=None): + """Patch a port to a universe. + + Args: + device_alias: the alias of the device to configure + port: the id of the port + action: OlaClient.PATCH or OlcClient.UNPATCH + universe: the universe to set the name of + callback: The function to call once complete, takes one argument, a + RequestStatus object. + """ + controller = SimpleRpcController() + request = Ola_pb2.PatchPortRequest() + request.device_alias = device_alias + request.port_id = port + request.action = action + request.universe = universe + done = lambda x, y: self._AckMessageComplete(callback, x, y) + self._stub.PatchPort(controller, request, done) + + def ConfigureDevice(self, device_alias, request_data, callback): + """Send a device config request. + + Args: + device_alias: the alias of the device to configure + request_data: the request to send to the device + callback: The function to call once complete, takes two arguments, a + RequestStatus object and a response. + """ + controller = SimpleRpcController() + request = Ola_pb2.DeviceConfigRequest() + request.device_alias = device_alias + request.data = request_data + done = lambda x, y: self._ConfigureDeviceComplete(callback, x, y) + self._stub.ConfigureDevice(controller, request, done) + + def UpdateDmxData(self, controller, request, callback): + """Called when we receive new DMX data. + + Args: + controller: An RpcController object + reqeust: A DmxData message + callback: The callback to run once complete + """ + if request.universe in self._universe_callbacks: + data = array.array('B') + data.fromstring(request.data) + self._universe_callbacks[request.universe](data) + response = Ola_pb2.Ack() + callback(response) + + def _CreateStateFromController(self, controller): + """Return a Status object given a RpcController object. + + Args: + controller: An RpcController object. + + Returns: + A RequestStatus object. + """ + if controller.Failed(): + return RequestStatus(RequestStatus.FAILED, controller.ErrorText()) + elif controller.IsCanceled(): + return RequestStatus(RequestStatus.CANCELLED, controller.ErrorText()) + else: + return RequestStatus() + + def _PluginInfoComplete(self, callback, controller, response): + """Called when the list of plugins is returned. + + Args: + callback: the callback to run + controller: an RpcController + response: a PluginInfoReply message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + + plugins = [Plugin(p.plugin_id, p.name, p.description) for p in + response.plugin] + callback(status, plugins) + + def _DeviceInfoComplete(self, callback, controller, response): + """Called when the Device info request returns. + + Args: + callback: the callback to run + controller: an RpcController + response: a DeviceInfoReply message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + + devices = [] + for device in response.device: + input_ports = [] + output_ports = [] + for port in device.input_port: + input_ports.append(Port(port.port_id, + port.universe, + port.active, + port.description)) + + for port in device.output_port: + output_ports.append(Port(port.port_id, + port.universe, + port.active, + port.description)) + + devices.append(Device(device.device_id, + device.device_alias, + device.device_name, + device.plugin_id, + input_ports, + output_ports)) + callback(status, devices) + + def _UniverseInfoComplete(self, callback, controller, response): + """Called when the Universe info request returns. + + Args: + callback: the callback to run + controller: an RpcController + response: a UniverseInfoReply message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + + universes = [Universe(u.universe, u.name, u.merge_mode) for u in + response.universe] + callback(status, universes) + + def _GetDmxComplete(self, callback, controller, response): + """Called when the Universe info request returns. + + Args: + callback: the callback to run + controller: an RpcController + response: a UniverseInfoReply message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + + data = array.array('B') + data.fromstring(response.data) + callback(status, response.universe, data) + + def _AckMessageComplete(self, callback, controller, response): + """Called when an rpc that returns an Ack completes. + + Args: + callback: the callback to run + controller: an RpcController + response: an Ack message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + callback(status) + + def _ConfigureDeviceComplete(self, callback, controller, response): + """Called when a ConfigureDevice request completes. + + Args: + callback: the callback to run + controller: an RpcController + response: an DeviceConfigReply message. + """ + if not callback: + return + status = self._CreateStateFromController(controller) + if not status.Succeeded(): + return + callback(status, response.data) + +# Populate the patch & register actions +for value in Ola_pb2._PATCHACTION.values: + setattr(OlaClient, value.name, value.number) +for value in Ola_pb2._REGISTERACTION.values: + setattr(OlaClient, value.name, value.number) diff --git a/open-lighting-architecture/ola-0.8.4/python/__init__.py b/open-lighting-architecture/ola-0.8.4/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.am b/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.am new file mode 100644 index 0000000..037e6c9 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.am @@ -0,0 +1,3 @@ +# example python scripts +EXTRA_DIST = client_wrapper.py ola_artnet_params.py ola_devices.py \ + ola_recv_dmx.py ola_send_dmx.py ola_universe_info.py diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.in b/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.in new file mode 100644 index 0000000..f21a541 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/Makefile.in @@ -0,0 +1,353 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = python/examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ + +# example python scripts +EXTRA_DIST = client_wrapper.py ola_artnet_params.py ola_devices.py \ + ola_recv_dmx.py ola_send_dmx.py ola_universe_info.py + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu python/examples/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu python/examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/client_wrapper.py b/open-lighting-architecture/ola-0.8.4/python/examples/client_wrapper.py new file mode 100755 index 0000000..d79ea76 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/client_wrapper.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# 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 Library 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. +# +# client_wrapper.py +# Copyright (C) 2005-2009 Simon Newton + +"""A simple client wrapper for the OlaClient.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import socket +import select +from ola.OlaClient import OlaClient, Universe + + +class ClientWrapper(object): + def __init__(self): + self._quit = False + self._sock = socket.socket() + self._sock.connect(('localhost', 9010)) + self._client = OlaClient(self._sock) + + def Stop(self): + self._quit = True + + def Client(self): + return self._client + + def Run(self): + while not self._quit: + i, o, e = select.select([self._sock], [], []) + if self._sock in i: + self._client.SocketReady() diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/ola_artnet_params.py b/open-lighting-architecture/ola-0.8.4/python/examples/ola_artnet_params.py new file mode 100755 index 0000000..8641701 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/ola_artnet_params.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# 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 Library 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. +# +# old_send_dmx.py +# Copyright (C) 2005-2009 Simon Newton + +"""Send some DMX data.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import client_wrapper +from ola import ArtnetConfigMessages_pb2 + +def ArtNetConfigureReply(state, response): + reply = ArtnetConfigMessages_pb2.Reply() + reply.ParseFromString(response) + print 'Short Name: %s' % reply.options.short_name + print 'Long Name: %s' % reply.options.long_name + print 'Subnet: %d' % reply.options.subnet + wrapper.Stop() + + +#Set this appropriately +device_alias = 1 +wrapper = client_wrapper.ClientWrapper() +client = wrapper.Client() +artnet_request = ArtnetConfigMessages_pb2.Request() +artnet_request.type = artnet_request.ARTNET_OPTIONS_REQUEST +client.ConfigureDevice(device_alias, artnet_request.SerializeToString(), + ArtNetConfigureReply) +wrapper.Run() diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/ola_devices.py b/open-lighting-architecture/ola-0.8.4/python/examples/ola_devices.py new file mode 100755 index 0000000..5b9fdfb --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/ola_devices.py @@ -0,0 +1,42 @@ +#!/usr/bin/python +# 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 Library 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. +# +# old_universe_info.py +# Copyright (C) 2005-2009 Simon Newton + +"""Lists the active universes.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import client_wrapper +from ola.OlaClient import Plugin + +def Devices(state, devices): + for device in sorted(devices): + print 'Device %d: %s' % (device.alias, device.name) + print 'Input ports:' + for port in device.input_ports: + print ' port %d, %s' % (port.id, port.description) + print 'Output ports:' + for port in device.output_ports: + print ' port %d, %s' % (port.id, port.description) + wrapper.Stop() + + +wrapper = client_wrapper.ClientWrapper() +client = wrapper.Client() +#client.FetchDevices(Devices, Plugin.OLA_PLUGIN_DUMMY) +client.FetchDevices(Devices) +wrapper.Run() diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/ola_recv_dmx.py b/open-lighting-architecture/ola-0.8.4/python/examples/ola_recv_dmx.py new file mode 100755 index 0000000..28b403b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/ola_recv_dmx.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +# 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 Library 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. +# +# old_universe_info.py +# Copyright (C) 2005-2009 Simon Newton + +"""Receive DMX data.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import client_wrapper + +def NewData(data): + print data + +wrapper = client_wrapper.ClientWrapper() +client = wrapper.Client() +client.RegisterUniverse(1, client.REGISTER, NewData) +wrapper.Run() diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/ola_send_dmx.py b/open-lighting-architecture/ola-0.8.4/python/examples/ola_send_dmx.py new file mode 100755 index 0000000..cc13b1b --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/ola_send_dmx.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +# 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 Library 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. +# +# old_send_dmx.py +# Copyright (C) 2005-2009 Simon Newton + +"""Send some DMX data.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import array +import client_wrapper + +def DmxSent(state): + wrapper.Stop() + +universe = 1 +data = array.array('B') +data.append(10) +data.append(50) +data.append(255) + +wrapper = client_wrapper.ClientWrapper() +client = wrapper.Client() +client.SendDmx(universe, data, DmxSent) +wrapper.Run() diff --git a/open-lighting-architecture/ola-0.8.4/python/examples/ola_universe_info.py b/open-lighting-architecture/ola-0.8.4/python/examples/ola_universe_info.py new file mode 100755 index 0000000..124867d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/examples/ola_universe_info.py @@ -0,0 +1,34 @@ +#!/usr/bin/python +# 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 Library 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. +# +# old_universe_info.py +# Copyright (C) 2005-2009 Simon Newton + +"""Lists the active universes.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import client_wrapper +from ola.OlaClient import Universe + +def Universes(state, universes): + for uni in universes: + print '%d %s %r' % (uni.id, uni.name, uni.merge_mode == Universe.LTP) + wrapper.Stop() + +wrapper = client_wrapper.ClientWrapper() +client = wrapper.Client() +client.FetchUniverses(Universes) +wrapper.Run() diff --git a/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.am b/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.am new file mode 100644 index 0000000..9dfe7f2 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.am @@ -0,0 +1,21 @@ +# ola python client + +if BUILD_PYTHON_LIBS + +rpcpythondir = $(pkgpythondir)/rpc +nodist_rpcpython_PYTHON = Rpc_pb2.py +rpcpython_PYTHON = SimpleRpcController.py StreamRpcChannel.py __init__.py + +BUILT_SOURCES = Rpc_pb2.py + +Rpc_pb2.py: ../../common/rpc/Rpc.proto + protoc --python_out ./ -I ../../common/rpc/ ../../common/rpc/Rpc.proto + +clean-local: + rm -f Rpc_pb2.* + +TESTS = SimpleRpcControllerTest.py + +endif + +EXTRA_DIST = SimpleRpcControllerTest.py diff --git a/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.in b/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.in new file mode 100644 index 0000000..091ff45 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/rpc/Makefile.in @@ -0,0 +1,518 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# ola python client +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = python/rpc +DIST_COMMON = $(am__rpcpython_PYTHON_DIST) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(rpcpythondir)" \ + "$(DESTDIR)$(rpcpythondir)" +nodist_rpcpythonPYTHON_INSTALL = $(INSTALL_DATA) +am__rpcpython_PYTHON_DIST = SimpleRpcController.py StreamRpcChannel.py \ + __init__.py +rpcpythonPYTHON_INSTALL = $(INSTALL_DATA) +py_compile = $(top_srcdir)/config/py-compile +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +@BUILD_PYTHON_LIBS_TRUE@rpcpythondir = $(pkgpythondir)/rpc +@BUILD_PYTHON_LIBS_TRUE@nodist_rpcpython_PYTHON = Rpc_pb2.py +@BUILD_PYTHON_LIBS_TRUE@rpcpython_PYTHON = SimpleRpcController.py StreamRpcChannel.py __init__.py +@BUILD_PYTHON_LIBS_TRUE@BUILT_SOURCES = Rpc_pb2.py +@BUILD_PYTHON_LIBS_TRUE@TESTS = SimpleRpcControllerTest.py +EXTRA_DIST = SimpleRpcControllerTest.py +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu python/rpc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu python/rpc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nodist_rpcpythonPYTHON: $(nodist_rpcpython_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(rpcpythondir)" || $(MKDIR_P) "$(DESTDIR)$(rpcpythondir)" + @list='$(nodist_rpcpython_PYTHON)'; dlist=''; for p in $$list; do\ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + f=$(am__strip_dir) \ + dlist="$$dlist $$f"; \ + echo " $(nodist_rpcpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(rpcpythondir)/$$f'"; \ + $(nodist_rpcpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(rpcpythondir)/$$f"; \ + else :; fi; \ + done; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(rpcpythondir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(rpcpythondir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-nodist_rpcpythonPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(nodist_rpcpython_PYTHON)'; dlist=''; for p in $$list; do\ + f=$(am__strip_dir) \ + rm -f "$(DESTDIR)$(rpcpythondir)/$$f"; \ + rm -f "$(DESTDIR)$(rpcpythondir)/$${f}c"; \ + rm -f "$(DESTDIR)$(rpcpythondir)/$${f}o"; \ + done +install-rpcpythonPYTHON: $(rpcpython_PYTHON) + @$(NORMAL_INSTALL) + test -z "$(rpcpythondir)" || $(MKDIR_P) "$(DESTDIR)$(rpcpythondir)" + @list='$(rpcpython_PYTHON)'; dlist=''; for p in $$list; do\ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + f=$(am__strip_dir) \ + dlist="$$dlist $$f"; \ + echo " $(rpcpythonPYTHON_INSTALL) '$$b$$p' '$(DESTDIR)$(rpcpythondir)/$$f'"; \ + $(rpcpythonPYTHON_INSTALL) "$$b$$p" "$(DESTDIR)$(rpcpythondir)/$$f"; \ + else :; fi; \ + done; \ + if test -n "$$dlist"; then \ + if test -z "$(DESTDIR)"; then \ + PYTHON=$(PYTHON) $(py_compile) --basedir "$(rpcpythondir)" $$dlist; \ + else \ + PYTHON=$(PYTHON) $(py_compile) --destdir "$(DESTDIR)" --basedir "$(rpcpythondir)" $$dlist; \ + fi; \ + else :; fi + +uninstall-rpcpythonPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(rpcpython_PYTHON)'; dlist=''; for p in $$list; do\ + f=$(am__strip_dir) \ + rm -f "$(DESTDIR)$(rpcpythondir)/$$f"; \ + rm -f "$(DESTDIR)$(rpcpythondir)/$${f}c"; \ + rm -f "$(DESTDIR)$(rpcpythondir)/$${f}o"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile +installdirs: + for dir in "$(DESTDIR)$(rpcpythondir)" "$(DESTDIR)$(rpcpythondir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +@BUILD_PYTHON_LIBS_FALSE@clean-local: +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-nodist_rpcpythonPYTHON \ + install-rpcpythonPYTHON + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nodist_rpcpythonPYTHON \ + uninstall-rpcpythonPYTHON + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + clean-libtool clean-local distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-nodist_rpcpythonPYTHON install-pdf install-pdf-am \ + install-ps install-ps-am install-rpcpythonPYTHON install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-nodist_rpcpythonPYTHON uninstall-rpcpythonPYTHON + + +@BUILD_PYTHON_LIBS_TRUE@Rpc_pb2.py: ../../common/rpc/Rpc.proto +@BUILD_PYTHON_LIBS_TRUE@ protoc --python_out ./ -I ../../common/rpc/ ../../common/rpc/Rpc.proto + +@BUILD_PYTHON_LIBS_TRUE@clean-local: +@BUILD_PYTHON_LIBS_TRUE@ rm -f Rpc_pb2.* +# 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/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcController.py b/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcController.py new file mode 100644 index 0000000..fb2ceaf --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcController.py @@ -0,0 +1,54 @@ +# 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 Library 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. +# +# SimpleRpcController.py +# Copyright (C) 2005-2009 Simon Newton + +"""An implementation of the RpcController interface.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +from google.protobuf import service + +class SimpleRpcController(service.RpcController): + """See google.protobuf.service.RpcController for documentation.""" + def __init__(self): + self.Reset() + + def Reset(self): + self._failed = False + self._cancelled = False + self._error = None + self._callback = None + + def Failed(self): + return self._failed + + def ErrorText(self): + return self._error + + def StartCancel(self): + self._cancelled = True + if self._callback: + self._callback() + + def SetFailed(self, reason): + self._failed = True + self._error = reason + + def IsCanceled(self): + return self._cancelled + + def NotifyOnCancel(self, callback): + self._callback = callback diff --git a/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcControllerTest.py b/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcControllerTest.py new file mode 100755 index 0000000..edb86f4 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/rpc/SimpleRpcControllerTest.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# 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 Library 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. +# +# SimpleRpcControllerTest.py +# Copyright (C) 2005-2009 Simon Newton + +"""Test cases for the SimpleRpcController.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import unittest +from SimpleRpcController import SimpleRpcController + +class SimpleRpcControllerTest(unittest.TestCase): + + def setUp(self): + self.callback_run = False + + def Callback(self): + self.callback_run = True + + def testSimpleRpcController(self): + controller = SimpleRpcController() + self.assertFalse(controller.Failed()) + self.assertFalse(controller.IsCanceled()) + self.assertEquals(None, controller.ErrorText()) + self.assertFalse(self.callback_run) + + # cancel + controller.NotifyOnCancel(self.Callback) + controller.StartCancel() + self.assertFalse(controller.Failed()) + self.assertFalse(not controller.IsCanceled()) + self.assertEquals(None, controller.ErrorText()) + self.assertFalse(not self.callback_run) + + self.callback_run = False + controller.Reset() + self.assertFalse(controller.Failed()) + self.assertFalse(controller.IsCanceled()) + self.assertEquals(None, controller.ErrorText()) + + # fail + failure_string = 'foo' + controller.SetFailed(failure_string) + self.assertFalse(not controller.Failed()) + self.assertFalse(controller.IsCanceled()) + self.assertEquals(failure_string, controller.ErrorText()) + + controller.Reset() + self.assertFalse(controller.Failed()) + self.assertFalse(controller.IsCanceled()) + self.assertEquals(None, controller.ErrorText()) + self.assertFalse(self.callback_run) + +if __name__ == '__main__': + unittest.main() diff --git a/open-lighting-architecture/ola-0.8.4/python/rpc/StreamRpcChannel.py b/open-lighting-architecture/ola-0.8.4/python/rpc/StreamRpcChannel.py new file mode 100644 index 0000000..5dc1de6 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/python/rpc/StreamRpcChannel.py @@ -0,0 +1,368 @@ +# 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 Library 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. +# +# StreamRpcChannel.py +# Copyright (C) 2005-2009 Simon Newton + +"""A RpcChannel that works over a TCP socket.""" + +__author__ = 'nomis52@gmail.com (Simon Newton)' + +import logging +import struct +from google.protobuf import service +import Rpc_pb2 +from SimpleRpcController import SimpleRpcController + + +class OutstandingRequest(object): + """These represent requests on the server side that haven't completed yet.""" + def __init__(self, request_id, controller): + self.controller = controller + self.id = request_id + + +class OutstandingResponse(object): + """These represent requests on the client side that haven't completed yet.""" + def __init__(self, response_id, controller, callback, reply_class): + self.callback = callback + self.controller = controller + self.id = response_id + self.reply = None + self.reply_class = reply_class + + +class StreamRpcChannel(service.RpcChannel): + """Implements a RpcChannel over a TCP socket.""" + PROTOCOL_VERSION = 1 + VERSION_MASK = 0xf0000000 + SIZE_MASK = 0x0fffffff + RECEIVE_BUFFER_SIZE = 8192 + + def __init__(self, socket, service_impl): + """Create a new StreamRpcChannel. + + Args: + socket: the socket to communicate on + service: the service to route incomming requests to + """ + self._service = service_impl + self._socket = socket + self._sequence = 0 + self._outstanding_requests = {} + self._outstanding_responses = {} + self._buffer = [] # the received data + self._expected_size = None # the size of the message we're receiving + self._skip_message = False # skip the current message + + def SocketReady(self): + """Read data from the socket and handle when we get a full message. + + Returns: + True if the socket remains connected, False if it was closed. + """ + data = self._socket.recv(self.RECEIVE_BUFFER_SIZE) + if data == '': + logging.info('Socket closed') + return False + + self._buffer.append(data) + self._ProcessIncommingData() + return True + + def CallMethod(self, method, controller, request, response_pb, done): + """Call a method. + + Don't use this directly, use the Stub object. + + Args: + method: The MethodDescriptor to call + controller: An RpcController object + request: The request message + response: The response class + done: A closure to call once complete. + """ + message = Rpc_pb2.RpcMessage() + message.type = Rpc_pb2.REQUEST + message.id = self._sequence + message.name = method.name + message.buffer = request.SerializeToString() + self._SendMessage(message) + self._sequence += 1 + + if message.id in self._outstanding_responses: + # fail any outstanding response with the same id, not the best approach + # but it'll do for now. + logging.warning('Response %d already pending, failing now', message.id) + response = self._outstanding_responses[message.id] + response.controller.SetFailed('Duplicate request found') + self._InvokeCallback(response) + + response = OutstandingResponse(message.id, controller, done, response_pb) + self._outstanding_responses[message.id] = response + + def RequestComplete(self, request, response): + """This is called on the server side when a request has completed. + + Args: + request: the OutstandingRequest object that has completed. + response: the response to send to the client + """ + message = Rpc_pb2.RpcMessage() + + if request.controller.Failed(): + self._SendRequestFailed(request) + return + + message.type = Rpc_pb2.RESPONSE + message.id = request.id + message.buffer = response.SerializeToString() + self._SendMessage(message) + del self._outstanding_requests[request.id] + + def _EncodeHeader(self, size): + """Encode a version and size into a header. + + Args: + size: the size of the rpc message + + Returns: + The header field + """ + header = (self.PROTOCOL_VERSION << 28) & self.VERSION_MASK + header |= size & self.SIZE_MASK + return struct.pack('=L', header) + + def _DecodeHeader(self, header): + """Decode a header into the version and size. + + Args: + header: the received header + + Return: + A tuple in the form (version, size) + """ + return ((header & self.VERSION_MASK) >> 28, header & self.SIZE_MASK) + + def _SendMessage(self, message): + """Send an RpcMessage. + + Args: + message: An RpcMessage object. + + Returns: + True if the send succeeded, False otherwise. + """ + data = message.SerializeToString() + header = self._EncodeHeader(len(data)) + if self._socket.send(header) < 1: + logging.warning('Failed to send header') + return False + + sent_bytes = self._socket.send(data) + if sent_bytes != len(data): + logging.warning('Failed to send full datagram') + return False + return True + + def _SendRequestFailed(self, request): + """Send a response indiciating this request failed. + + Args: + request: An OutstandingRequest object. + + """ + message = Rpc_pb2.RpcMessage() + message.type = Rpc_pb2.RESPONSE_FAILED + message.id = request.id + message.buffer = request.controller.ErrorText() + self._SendMessage(message) + del self._outstanding_requests[request.id] + + def _SendNotImplemented(self, message_id): + """Send a not-implemented response. + + Args: + message_id: The message number. + """ + message = Rpc_pb2.RpcMessage + message.type = Rpc_pb2.RESPONSE_NOT_IMPLEMENTED + message.id = message_id + self._SendMessage(message) + + def _GrabData(self, size): + """Fetch the next N bytes of data from the buffer. + + Args: + size: the amount of data to fetch. + + Returns: + The next size bytes of data, or None if there isn't enough. + """ + data_size = sum([len(s) for s in self._buffer]) + if data_size < size: + return None + + data = [] + size_left = size + while size_left > 0: + chunk = self._buffer.pop(0) + if len(chunk) > size_left: + # we only want part of it + data.append(chunk[0:size_left]) + self._buffer.insert(0, chunk[size_left:]) + size_left = 0 + else: + data.append(chunk) + size_left -= len(chunk) + + return ''.join(data) + + def _ProcessIncommingData(self): + """Process the received data.""" + + while True: + if not self._expected_size: + # this is a new msg + raw_header = self._GrabData(4) + if not raw_header: + # not enough data yet + return + header = struct.unpack('/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am check check-am clean clean-generic clean-libtool \ + ctags ctags-recursive distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.am b/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.am new file mode 100644 index 0000000..527bd2d --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.am @@ -0,0 +1,16 @@ +include $(top_srcdir)/common.mk + +EXTRA_DIST = usbpro-common.h + +bin_PROGRAMS = usbpro_rdm_sniffer usbpro_firmware +usbpro_firmware_SOURCES = usbpro-firmware.cpp usbpro-common.cpp +usbpro_firmware_LDFLAGS = +usbpro_firmware_LDADD = @LIBS@ -lprotobuf \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la + +usbpro_rdm_sniffer_SOURCES = usbpro-rdm.cpp usbpro-common.cpp +usbpro_rdm_sniffer_LDFLAGS = +usbpro_rdm_sniffer_LDADD = @LIBS@ -lprotobuf \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la diff --git a/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.in b/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.in new file mode 100644 index 0000000..ce5a811 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/Makefile.in @@ -0,0 +1,518 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.mk +bin_PROGRAMS = usbpro_rdm_sniffer$(EXEEXT) usbpro_firmware$(EXEEXT) +subdir = tools/usbpro +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/cppunit.m4 \ + $(top_srcdir)/config/ola.m4 $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_usbpro_firmware_OBJECTS = usbpro-firmware.$(OBJEXT) \ + usbpro-common.$(OBJEXT) +usbpro_firmware_OBJECTS = $(am_usbpro_firmware_OBJECTS) +usbpro_firmware_DEPENDENCIES = $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la +usbpro_firmware_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(usbpro_firmware_LDFLAGS) $(LDFLAGS) -o $@ +am_usbpro_rdm_sniffer_OBJECTS = usbpro-rdm.$(OBJEXT) \ + usbpro-common.$(OBJEXT) +usbpro_rdm_sniffer_OBJECTS = $(am_usbpro_rdm_sniffer_OBJECTS) +usbpro_rdm_sniffer_DEPENDENCIES = \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la +usbpro_rdm_sniffer_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(usbpro_rdm_sniffer_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(usbpro_firmware_SOURCES) $(usbpro_rdm_sniffer_SOURCES) +DIST_SOURCES = $(usbpro_firmware_SOURCES) \ + $(usbpro_rdm_sniffer_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ +CPPUNIT_CONFIG = @CPPUNIT_CONFIG@ +CPPUNIT_LIBS = @CPPUNIT_LIBS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MICROHTTPD_LIBS = @MICROHTTPD_LIBS@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +OLAD_DEFINES = @OLAD_DEFINES@ +OLA_SERVER_LIBS = @OLA_SERVER_LIBS@ +OSSP_UUID_CFLAGS = @OSSP_UUID_CFLAGS@ +OSSP_UUID_LIBS = @OSSP_UUID_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PLUGIN_LIBS = @PLUGIN_LIBS@ +PROTOC = @PROTOC@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_aux_dir = @ac_aux_dir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libusb_CFLAGS = @libusb_CFLAGS@ +libusb_LIBS = @libusb_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +plugindir = @plugindir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +www_datadir = @www_datadir@ +AM_CPPFLAGS = -I$(top_builddir)/include -Wall -Wformat -W -Werror -Wno-deprecated +EXTRA_DIST = usbpro-common.h +usbpro_firmware_SOURCES = usbpro-firmware.cpp usbpro-common.cpp +usbpro_firmware_LDFLAGS = +usbpro_firmware_LDADD = @LIBS@ -lprotobuf \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la + +usbpro_rdm_sniffer_SOURCES = usbpro-rdm.cpp usbpro-common.cpp +usbpro_rdm_sniffer_LDFLAGS = +usbpro_rdm_sniffer_LDADD = @LIBS@ -lprotobuf \ + $(top_builddir)/common/libolacommon.la \ + $(top_builddir)/plugins/usbpro/libolausbprowidget.la + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/usbpro/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tools/usbpro/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +usbpro_firmware$(EXEEXT): $(usbpro_firmware_OBJECTS) $(usbpro_firmware_DEPENDENCIES) + @rm -f usbpro_firmware$(EXEEXT) + $(usbpro_firmware_LINK) $(usbpro_firmware_OBJECTS) $(usbpro_firmware_LDADD) $(LIBS) +usbpro_rdm_sniffer$(EXEEXT): $(usbpro_rdm_sniffer_OBJECTS) $(usbpro_rdm_sniffer_DEPENDENCIES) + @rm -f usbpro_rdm_sniffer$(EXEEXT) + $(usbpro_rdm_sniffer_LINK) $(usbpro_rdm_sniffer_OBJECTS) $(usbpro_rdm_sniffer_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbpro-common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbpro-firmware.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/usbpro-rdm.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + +# 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/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.cpp b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.cpp new file mode 100644 index 0000000..3a6ac09 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.cpp @@ -0,0 +1,49 @@ +/* + * 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 Library 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. + * + * usbpro-common.cpp + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include + +#include "tools/usbpro/usbpro-common.h" + +using std::string; + +/* + * Open the widget device + */ +int ConnectToWidget(const string &path) { + struct termios newtio; + int fd = open(path.data(), O_RDWR | O_NONBLOCK | O_NOCTTY); + + if (fd == -1) { + OLA_WARN << "Failed to open " << path << " " << strerror(errno); + return -1; + } + + bzero(&newtio, sizeof(newtio)); // clear struct for new port settings + cfsetispeed(&newtio, B115200); + cfsetospeed(&newtio, B115200); + tcsetattr(fd, TCSANOW, &newtio); + return fd; +} diff --git a/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.h b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.h new file mode 100644 index 0000000..ad07621 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-common.h @@ -0,0 +1,50 @@ +/* + * 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 Library 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. + * + * usbpro-common.cpp + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include "plugins/usbpro/UsbWidget.h" + + +#ifndef TOOLS_USBPRO_USBPRO_COMMON_H_ +#define TOOLS_USBPRO_USBPRO_COMMON_H_ + +using std::string; +using ola::network::SelectServer; + +/* + * Abstract away the interface to the select server + */ +class MySelectServerAdaptor: public ola::plugin::usbpro::SelectServerAdaptor { + public: + explicit MySelectServerAdaptor(SelectServer *ss): + m_ss(ss) { + } + + bool AddSocket(ola::network::ConnectedSocket *socket, + bool delete_on_close = false) const { + return m_ss->AddSocket(socket, delete_on_close); + } + private: + SelectServer *m_ss; +}; + + +int ConnectToWidget(const string &path); +#endif // TOOLS_USBPRO_USBPRO_COMMON_H_ diff --git a/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-firmware.cpp b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-firmware.cpp new file mode 100644 index 0000000..07c1878 --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-firmware.cpp @@ -0,0 +1,292 @@ +/* + * 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 Library 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. + * + * usbpro-firmware.cpp + * Copyright (C) 2005 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "plugins/usbpro/UsbWidget.h" +#include "tools/usbpro/usbpro-common.h" + +using std::cout; +using std::endl; +using std::ifstream; +using std::string; +using ola::plugin::usbpro::UsbWidget; +using ola::network::SelectServer; + +static const char DEFAULT_DEVICE[] = "/dev/ttyUSB0"; +static const char DEFAULT_FIRMWARE[] = "main.bin"; +static const int PAUSE_DELAY = 1000; // ms before starting upload +static const int ABORT_TIMEOUT = 10 * 1000; // ms seconds before aborting + +typedef struct { + bool help; + ola::log_level log_level; + string firmware; + string device; +} options; + + +class FirmwareTransferer: public ola::plugin::usbpro::WidgetListener { + public: + FirmwareTransferer(ifstream *file, + UsbWidget *widget, + ola::network::SelectServer *ss): + m_sucessful(false), + m_firmware(file), + m_widget(widget), + m_ss(ss) { + widget->SetMessageHandler(this); + } + + bool SendReprogram(); + + void HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data); + bool SendNextChunk(); + void AbortTransfer() { + m_ss->Terminate(); + } + void StartTransfer() { + SendNextChunk(); + } + bool WasSucessfull() const { return m_sucessful; } + + private: + enum { FLASH_STATUS_LENGTH = 4 }; + enum { FLASH_PAGE_LENGTH = 64 }; + + bool m_sucessful; + ifstream *m_firmware; + UsbWidget *m_widget; + SelectServer *m_ss; + + static const uint8_t REPROGRAM_LABEL = 1; + static const uint8_t FLASH_PAGE_LABEL = 2; + static const char REPLY_SUCCESS[]; +}; + + +const char FirmwareTransferer::REPLY_SUCCESS[] = "TRUE"; + + +/* + * Send the re-program request + */ +bool FirmwareTransferer::SendReprogram() { + return m_widget->SendMessage(REPROGRAM_LABEL, 0, NULL); +} + + +/* + * Handle the flash page replies + */ +void FirmwareTransferer::HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data) { + if (widget != m_widget) { + OLA_WARN << "Something went really wrong..."; + return; + } + + if (label != FLASH_PAGE_LABEL || length != FLASH_STATUS_LENGTH) + return; + + if (0 == memcmp(data, REPLY_SUCCESS, sizeof(FLASH_STATUS_LENGTH))) { + if (!SendNextChunk() || m_sucessful) + m_ss->Terminate(); + } else { + OLA_FATAL << "Bad response from widget:" << string((const char*) data, 4); + m_ss->Terminate(); + } +} + + +/* + * Send the next chunk of the firmware file + */ +bool FirmwareTransferer::SendNextChunk() { + uint8_t page[FLASH_PAGE_LENGTH]; + m_firmware->read(reinterpret_cast(page), + FLASH_PAGE_LENGTH); + std::streamsize size = m_firmware->gcount(); + + if (!size) { + m_sucessful = true; + cout << endl; + return true; + } + cout << "."; + fflush(stdout); + return m_widget->SendMessage(FLASH_PAGE_LABEL, size, page); +} + + +/* + * Parse our command line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"device", required_argument, 0, 'd'}, + {"firmware", required_argument, 0, 'f'}, + {"help", no_argument, 0, 'h'}, + {"log-level", required_argument, 0, 'l'}, + {0, 0, 0, 0} + }; + + int option_index = 0; + + while (1) { + int c = getopt_long(argc, argv, "d:f:hl:", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + + case 'd': + opts->device = optarg; + break; + + case 'f': + opts->firmware = optarg; + break; + + case 'h': + opts->help = true; + break; + + case 'l': + switch (atoi(optarg)) { + case 0: + // nothing is written at this level + // so this turns logging off + opts->log_level = ola::OLA_LOG_NONE; + break; + case 1: + opts->log_level = ola::OLA_LOG_FATAL; + break; + case 2: + opts->log_level = ola::OLA_LOG_WARN; + break; + case 3: + opts->log_level = ola::OLA_LOG_INFO; + break; + case 4: + opts->log_level = ola::OLA_LOG_DEBUG; + break; + default : + break; + } + break; + case '?': + break; + default: + break; + } + } + return; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(char *argv[]) { + cout << "Usage: " << argv[0] << + " -d -f \n" + "\n" + "Flash the firmware on an Enttec USB Pro device.\n" + "\n" + " -d The path to the device.\n" + " -f The path to the firmware to use.\n" + " -h, --help Display this help message and exit.\n" + " -l, --log-level Set the loggging level 0 .. 4.\n" + << endl; + exit(0); +} + + +/* + * Flashes the device + */ +int main(int argc, char *argv[]) { + options opts; + opts.log_level = ola::OLA_LOG_WARN; + opts.help = false; + opts.firmware = DEFAULT_FIRMWARE; + opts.device = DEFAULT_DEVICE; + ParseOptions(argc, argv, &opts); + + if (opts.help) + DisplayHelpAndExit(argv); + ola::InitLogging(opts.log_level, ola::OLA_LOG_STDERR); + + ifstream firmware_file(opts.firmware.data()); + + if (!firmware_file.is_open()) { + OLA_FATAL << "Can't open the firmware file " << opts.firmware << ": " << + strerror(errno); + exit(1); + } + + ola::network::SelectServer ss; + + int fd = ConnectToWidget(opts.device); + if (fd < 0) + exit(EX_UNAVAILABLE); + + UsbWidget widget(MySelectServerAdaptor(&ss), fd); + + FirmwareTransferer transferer(&firmware_file, &widget, &ss); + + if (!transferer.SendReprogram()) { + OLA_FATAL << "Send message failed"; + exit(1); + } + + ss.RegisterSingleTimeout( + PAUSE_DELAY, + ola::NewSingleClosure(&transferer, &FirmwareTransferer::StartTransfer)); + widget.SetOnRemove( + ola::NewSingleClosure(&transferer, &FirmwareTransferer::AbortTransfer)); + ss.RegisterSingleTimeout( + ABORT_TIMEOUT, + ola::NewSingleClosure(&transferer, &FirmwareTransferer::AbortTransfer)); + ss.Run(); + + firmware_file.close(); + return !transferer.WasSucessfull(); +} diff --git a/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-rdm.cpp b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-rdm.cpp new file mode 100644 index 0000000..d93311a --- /dev/null +++ b/open-lighting-architecture/ola-0.8.4/tools/usbpro/usbpro-rdm.cpp @@ -0,0 +1,348 @@ +/* + * 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 Library 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. + * + * usbpro-rdm.cpp + * A very simple RDM sniffer for USB Pro like devices + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "plugins/usbpro/UsbWidget.h" +#include "tools/usbpro/usbpro-common.h" + +using std::cout; +using std::endl; +using std::string; +using ola::network::SelectServer; +using ola::plugin::usbpro::UsbWidget; +using ola::rdm::RDMCommand; +using ola::rdm::RDMRequest; +using ola::rdm::RDMResponse; + +static const char DEFAULT_DEVICE[] = "/dev/ttyUSB0"; + +typedef struct { + bool help; + bool dump_all; + bool verbose; + ola::log_level log_level; + string device; +} options; + + +class RDMSniffer: public ola::plugin::usbpro::WidgetListener { + public: + RDMSniffer(UsbWidget *widget, + ola::network::SelectServer *ss, + bool dump_all, + bool verbose): + m_widget(widget), + m_ss(ss), + m_dump_all(dump_all), + m_verbose(verbose) { + widget->SetMessageHandler(this); + } + + void HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data); + void Stop() { + m_ss->Terminate(); + } + + private: + UsbWidget *m_widget; + SelectServer *m_ss; + bool m_dump_all; + bool m_verbose; + + void DumpRawPacket(unsigned int length, const uint8_t *data); + void DumpRequest(unsigned int length, const uint8_t *data); + void DumpResponse(unsigned int length, const uint8_t *data); + void DumpDiscover(unsigned int length, const uint8_t *data); + + static const uint8_t RECEIVED_DMX_LABEL = 5; + static const uint8_t DRAFT_START_CODE = 0xf0; +}; + + +/* + * Handle the widget replies + */ +void RDMSniffer::HandleMessage(UsbWidget *widget, + uint8_t label, + unsigned int length, + const uint8_t *data) { + if (widget != m_widget) { + OLA_WARN << "Something went really wrong..."; + return; + } + + if (label != RECEIVED_DMX_LABEL) { + OLA_INFO << "Not a RECEIVED_DMX_LABEL, was " << static_cast(label); + return; + } + + if (!length) { + if (m_dump_all) + OLA_INFO << "Zero sized packet"; + return; + } + + if (data[0]) { + OLA_INFO << "Error: " << static_cast(data[0]); + return; + } + + length--; + data++; + + if (!length) { + if (m_dump_all) + OLA_INFO << "Zero sized packet"; + return; + } + + switch (data[0]) { + case 0: + if (m_dump_all) + OLA_INFO << "DMX packet"; + return; + case DRAFT_START_CODE: + if (m_dump_all) { + cout << "Draft RDM packet: "; + DumpRawPacket(length, data); + } + return; + case RDMCommand::START_CODE: + break; + default: + if (m_dump_all) + OLA_INFO << "Packet with start code " << static_cast(data[0]); + return; + } + + if (length < 21) { + cout << "Short packet: "; + DumpRawPacket(length, data); + return; + } + + uint8_t command_class = data[20]; + cout << static_cast(command_class) << endl; + + switch (command_class) { + case RDMCommand::GET_COMMAND: + case RDMCommand::SET_COMMAND: + DumpRequest(length - 1, data + 1); + return; + case RDMCommand::GET_COMMAND_RESPONSE: + case RDMCommand::SET_COMMAND_RESPONSE: + DumpResponse(length - 1, data + 1); + return; + case RDMCommand::DISCOVER_COMMAND: + DumpDiscover(length - 1, data + 1); + return; + default: + DumpRawPacket(length -1, data + 1); + } +} + + +void RDMSniffer::DumpRawPacket(unsigned int length, const uint8_t *data) { + for (unsigned int i = 0; i < length; ++i) + cout << std::hex << static_cast(data[i]) << " "; + cout << endl; +} + + +void RDMSniffer::DumpRequest(unsigned int length, const uint8_t *data) { + RDMRequest *request = RDMRequest::InflateFromData(data, length); + if (request) { + cout << (request->CommandClass() == RDMCommand::GET_COMMAND ? "GET" : + "SET"); + if (m_verbose) + cout << " src: " << request->SourceUID() << ", dst: " << + request->DestinationUID() << ", transaction: " << + request->TransactionNumber() << ", port: " << request->PortId() << + ", PID " << std::hex << request->ParamId() << endl; + else + cout << " src: " << request->SourceUID() << ", dst: " << + request->DestinationUID() << ", PID " << std::hex << + request->ParamId() << endl; + } else { + DumpRawPacket(length, data); + } +} + + +void RDMSniffer::DumpResponse(unsigned int length, const uint8_t *data) { + RDMResponse *response = RDMResponse::InflateFromData(data, length); + if (response) { + cout << (response->CommandClass() == RDMCommand::GET_COMMAND_RESPONSE ? + "GET_RESPONSE" : "SET_RESPONSE"); + if (m_verbose) + cout << " src: " << response->SourceUID() << ", dst: " << + response->DestinationUID() << ", transaction: " << + response->TransactionNumber() << ", response type: " << + response->ResponseType() << ", PID " << std::hex << response->ParamId() + << endl; + else + cout << " src: " << response->SourceUID() << ", dst: " << + response->DestinationUID() << ", PID " << std::hex << + response->ParamId() << endl; + } + DumpRawPacket(length, data); +} + + +void RDMSniffer::DumpDiscover(unsigned int length, const uint8_t *data) { + DumpRawPacket(length, data); +} + + +/* + * Parse our command line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"dump-all", no_argument, 0, 'a'}, + {"device", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"log-level", required_argument, 0, 'l'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} + }; + + int option_index = 0; + + while (1) { + int c = getopt_long(argc, argv, "ad:hl:v", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'a': + opts->dump_all = true; + break; + case 'd': + opts->device = optarg; + break; + case 'h': + opts->help = true; + break; + case 'l': + switch (atoi(optarg)) { + case 0: + // nothing is written at this level + // so this turns logging off + opts->log_level = ola::OLA_LOG_NONE; + break; + case 1: + opts->log_level = ola::OLA_LOG_FATAL; + break; + case 2: + opts->log_level = ola::OLA_LOG_WARN; + break; + case 3: + opts->log_level = ola::OLA_LOG_INFO; + break; + case 4: + opts->log_level = ola::OLA_LOG_DEBUG; + break; + default : + break; + } + break; + case 'v': + opts->verbose = true; + break; + case '?': + break; + default: + break; + } + } + return; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(char *argv[]) { + cout << "Usage: " << argv[0] << + " -d \n" + "\n" + "Dump RDM traffic from a Enttec USB Pro device.\n" + "\n" + " -a, --dump-all Dump all packets (default is just RDM)\n" + " -d The path to the device.\n" + " -h, --help Display this help message and exit.\n" + " -l, --log-level Set the loggging level 0 .. 4.\n" + " -v, --verbose Show more packet details\n" + << endl; + exit(0); +} + + +/* + * Dump RDM data + */ +int main(int argc, char *argv[]) { + options opts; + opts.dump_all = false; + opts.verbose = false; + opts.log_level = ola::OLA_LOG_INFO; + opts.help = false; + opts.device = DEFAULT_DEVICE; + ParseOptions(argc, argv, &opts); + + if (opts.help) + DisplayHelpAndExit(argv); + ola::InitLogging(opts.log_level, ola::OLA_LOG_STDERR); + + int fd = ConnectToWidget(opts.device); + if (fd < 0) + exit(EX_UNAVAILABLE); + + ola::network::SelectServer ss; + UsbWidget widget(MySelectServerAdaptor(&ss), fd); + RDMSniffer sniffer(&widget, &ss, opts.dump_all, opts.verbose); + + widget.SetOnRemove( + ola::NewSingleClosure(&sniffer, &RDMSniffer::Stop)); + ss.Run(); + + return EX_OK; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/AUTHORS b/open-lighting-architecture/ola-examples-0.8.4/AUTHORS new file mode 100644 index 0000000..25a983d --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/AUTHORS @@ -0,0 +1,6 @@ + +Please do not email the author directly, instead use +linux-lighting@googlegroups.com + +Simon Newton +nomis52@gmail.com diff --git a/open-lighting-architecture/ola-examples-0.8.4/COPYING b/open-lighting-architecture/ola-examples-0.8.4/COPYING new file mode 100644 index 0000000..5b6e7c6 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/COPYING @@ -0,0 +1,340 @@ + 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 + + 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/open-lighting-architecture/ola-examples-0.8.4/ChangeLog b/open-lighting-architecture/ola-examples-0.8.4/ChangeLog new file mode 100644 index 0000000..91a9db8 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/ChangeLog @@ -0,0 +1,8 @@ +23/12/2006 Simon Newton + + * Added the usbpro example + +26/11/2006 Simon Newton + + * Updated examples to use the new API + * Consolidated (most) functionallity into one program diff --git a/open-lighting-architecture/ola-examples-0.8.4/INSTALL b/open-lighting-architecture/ola-examples-0.8.4/INSTALL new file mode 100644 index 0000000..5458714 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/INSTALL @@ -0,0 +1,234 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + 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, 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 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.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You 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: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. 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. 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: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +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 can use 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 `..'. + + With a non-GNU `make', it is safer 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' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +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. + + 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' 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 + +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 machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +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 +================ + +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. + +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 + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--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' + 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. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/open-lighting-architecture/ola-examples-0.8.4/Makefile.am b/open-lighting-architecture/ola-examples-0.8.4/Makefile.am new file mode 100644 index 0000000..b5e7a98 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/Makefile.am @@ -0,0 +1,5 @@ + +CLOCAL = aclocal -I $(auxdir) +ACLOCAL_AMFLAGS = -I config + +SUBDIRS = src diff --git a/open-lighting-architecture/ola-examples-0.8.4/Makefile.in b/open-lighting-architecture/ola-examples-0.8.4/Makefile.in new file mode 100644 index 0000000..559977d --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/Makefile.in @@ -0,0 +1,635 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + config/config.guess config/config.sub config/depcomp \ + config/install-sh config/ltmain.sh config/missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libola_CFLAGS = @libola_CFLAGS@ +libola_LIBS = @libola_LIBS@ +libolaartnetconf_CFLAGS = @libolaartnetconf_CFLAGS@ +libolaartnetconf_LIBS = @libolaartnetconf_LIBS@ +libolausbproconf_CFLAGS = @libolausbproconf_CFLAGS@ +libolausbproconf_LIBS = @libolausbproconf_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +CLOCAL = aclocal -I $(auxdir) +ACLOCAL_AMFLAGS = -I config +SUBDIRS = src +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool + +# 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. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + 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) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/open-lighting-architecture/ola-examples-0.8.4/NEWS b/open-lighting-architecture/ola-examples-0.8.4/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/open-lighting-architecture/ola-examples-0.8.4/README b/open-lighting-architecture/ola-examples-0.8.4/README new file mode 100644 index 0000000..71f4890 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/README @@ -0,0 +1,9 @@ +ola-examples: + +This package contains example programs which use OLA. For installation notes, +see the INSTALL file. + +If you are having problems please email open-lighting@googlegroups.com + +Project Page: http://code.google.com/p/linux-lighting/ +Wiki: http://opendmx.net/index.php/OLA diff --git a/open-lighting-architecture/ola-examples-0.8.4/aclocal.m4 b/open-lighting-architecture/ola-examples-0.8.4/aclocal.m4 new file mode 100644 index 0000000..339f401 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/aclocal.m4 @@ -0,0 +1,7252 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 48 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_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 + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +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_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([config/pkg.m4]) diff --git a/open-lighting-architecture/ola-examples-0.8.4/config.h.in b/open-lighting-architecture/ola-examples-0.8.4/config.h.in new file mode 100644 index 0000000..9d9e678 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config.h.in @@ -0,0 +1,134 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ +#undef HAVE_DOPRNT + +/* Define to 1 if you have the header file. */ +#undef HAVE_ENDIAN_H + +/* Define to 1 if you have the `ftime' function. */ +#undef HAVE_FTIME + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `inet_ntoa' function. */ +#undef HAVE_INET_NTOA + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PPC_ENDIAN_H + +/* Define to 1 if you have the `select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vprintf' function. */ +#undef HAVE_VPRINTF + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to the type of arg 1 for `select'. */ +#undef SELECT_TYPE_ARG1 + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#undef SELECT_TYPE_ARG234 + +/* Define to the type of arg 5 for `select'. */ +#undef SELECT_TYPE_ARG5 + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to `unsigned int' if does not define. */ +#undef size_t diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/config.guess b/open-lighting-architecture/ola-examples-0.8.4/config/config.guess new file mode 100755 index 0000000..396482d --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/config.guess @@ -0,0 +1,1500 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-07-02' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# 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 build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[3456]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[3456]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +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\n"); 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`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%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) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# 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_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# 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 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/config.sub b/open-lighting-architecture/ola-examples-0.8.4/config/config.sub new file mode 100755 index 0000000..fab0aa3 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/config.sub @@ -0,0 +1,1616 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, +# Inc. + +timestamp='2006-09-20' + +# 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# 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. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -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* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/depcomp b/open-lighting-architecture/ola-examples-0.8.4/config/depcomp new file mode 100755 index 0000000..ca5ea4e --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/depcomp @@ -0,0 +1,584 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2006-10-15.18 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/install-sh b/open-lighting-architecture/ola-examples-0.8.4/config/install-sh new file mode 100755 index 0000000..4fbbae7 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/install-sh @@ -0,0 +1,507 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-10-14.15 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +posix_glob= +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chmodcmd=$chmodprog +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + shift + shift + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac +done + +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; + esac + + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac + + oIFS=$IFS + IFS=/ + $posix_glob && set -f + set fnord $dstdir + shift + $posix_glob && set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/ltmain.sh b/open-lighting-architecture/ola-examples-0.8.4/config/ltmain.sh new file mode 100644 index 0000000..06823e0 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/ltmain.sh @@ -0,0 +1,6863 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +basename="s,^.*/,,g" + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +progname=`echo "$progpath" | $SED $basename` +modename="$progname" + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.5.22 +TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes. +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +duplicate_deps=no +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed +} + + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + CC_quoted="$CC_quoted $arg" + done + case "$@ " in + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit $EXIT_FAILURE +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi +} + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" +} +# End of Shell function definitions +##################################### + +# Darwin sucks +eval std_shrext=\"$shrext_cmds\" + +disable_libs=no + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + preserve_args="${preserve_args}=$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2005 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit $? + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + done + exit $? + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + preserve_args="$preserve_args $arg" + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit $? + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + preserve_args="$preserve_args $arg" + ;; + + --tag) + prevopt="--tag" + prev=tag + preserve_args="$preserve_args --tag" + ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + preserve_args="$preserve_args --tag" + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE +fi + +case $disable_libs in +no) + ;; +shared) + build_libtool_libs=no + build_old_libs=yes + ;; +static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; +esac + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit $EXIT_FAILURE + fi + arg_mode=target + continue + ;; + + -static | -prefer-pic | -prefer-non-pic) + later="$later $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, and some SunOS ksh mistreat backslash-escaping + # in scan sets (worked around with variable expansion), + # and furthermore cannot handle '|' '&' '(' ')' in scan sets + # at all, so we specify them separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit $EXIT_FAILURE + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit $EXIT_FAILURE + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$progpath" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + $echo "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + fi + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit $EXIT_FAILURE + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit $EXIT_FAILURE + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit $EXIT_FAILURE + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + notinst_path="$notinst_path $dir" + 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*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m* pass through architecture-specific compiler args for GCC + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -pg pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ + -t[45]*|-txscale*|@*) + + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit $EXIT_FAILURE + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit $EXIT_FAILURE + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit $EXIT_FAILURE + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then + exit $exit_status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + if eval $echo \"$deplib\" 2>/dev/null \ + | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 + exit $EXIT_FAILURE + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit $EXIT_FAILURE + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit $EXIT_FAILURE + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $absdir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on + # some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$extract_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + cmds=$old_archive_from_expsyms_cmds + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against + # it, someone is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | + $EGREP ": [^:]* bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit $EXIT_FAILURE + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + if test "$absdir" != "$libdir"; then + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, + # but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + fi + path="" + ;; + *) + path="-L$path" + ;; + esac + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$depdepl $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit $EXIT_FAILURE + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit $EXIT_FAILURE + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` + deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$libobjs $func_extract_archives_result" + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadable object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~\$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit $EXIT_FAILURE + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + cmds=$reload_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + 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*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + else + $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +" + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ +/* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ +struct { +" + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ +const struct { +" + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -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. + case $host in + *cygwin* | *mingw* ) + if test -f "$output_objdir/${outputname}.def" ; then + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` + else + 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}%"` + fi + ;; + * ) + 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}%"` + ;; + esac + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit $EXIT_FAILURE + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + exit_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 $exit_status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + output_name=`basename $output` + output_path=`dirname $output` + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +/* -DDEBUG is fairly common in CFLAGS. */ +#undef DEBUG +#if defined DEBUGWRAPPER +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) +#else +# define DEBUG(format, ...) +#endif + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +const char * base_name (const char *name); +char * find_executable(const char *wrapper); +int check_executable(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup (base_name (argv[0])); + DEBUG("(main) argv[0] : %s\n",argv[0]); + DEBUG("(main) program_name : %s\n",program_name); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = find_executable(argv[0]); + if (newargz[1] == NULL) + lt_fatal("Couldn't find %s", argv[0]); + DEBUG("(main) found exe at : %s\n",newargz[1]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" + return 127; +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +const char * +base_name (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha ((unsigned char)name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return base; +} + +int +check_executable(const char * path) +{ + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ +#if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || +#endif +#if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || +#endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ +char * +find_executable (const char* wrapper) +{ + int has_slash = 0; + const char* p; + const char* p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; + + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char* path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char* q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR(*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen(tmp); + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable(concat_name)) + return concat_name; + XFREE(concat_name); + return NULL; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit $EXIT_FAILURE + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit $EXIT_FAILURE + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit $EXIT_FAILURE + fi +fi\ +" + chmod +x $output + fi + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + eval cmd=\"$cmd\" + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit $EXIT_FAILURE + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit $EXIT_SUCCESS + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) prev=$arg ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit $EXIT_FAILURE + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit $EXIT_FAILURE + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + cmds=$postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit $EXIT_FAILURE + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # Note that it is not necessary on cygwin/mingw to append a dot to + # foo even if both foo and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing + # `FILE.' does not work on cygwin managed mounts. + # + # If there is no directory component, then add one. + case $wrapper in + */* | *\\*) . ${wrapper} ;; + *) . ./${wrapper} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir=`func_mktempdir` + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$old_striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + cmds=$old_postinstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + cmds=$finish_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit $EXIT_SUCCESS + + $echo "X----------------------------------------------------------------------" | $Xsed + $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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit $EXIT_FAILURE + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit $EXIT_FAILURE + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit $EXIT_SUCCESS + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + cmds=$postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + cmds=$old_postuninstall_cmds + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit $EXIT_FAILURE + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit $EXIT_FAILURE +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit $EXIT_SUCCESS + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit $EXIT_FAILURE + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit $? + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +disable_libs=shared +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +disable_libs=static +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/missing b/open-lighting-architecture/ola-examples-0.8.4/config/missing new file mode 100755 index 0000000..1c8ff70 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/open-lighting-architecture/ola-examples-0.8.4/config/pkg.m4 b/open-lighting-architecture/ola-examples-0.8.4/config/pkg.m4 new file mode 100644 index 0000000..a0b9cd4 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/config/pkg.m4 @@ -0,0 +1,155 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/open-lighting-architecture/ola-examples-0.8.4/configure b/open-lighting-architecture/ola-examples-0.8.4/configure new file mode 100755 index 0000000..6a192fb --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/configure @@ -0,0 +1,22840 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="configure.ac" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CXX +CXXFLAGS +ac_ct_CXX +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +LN_S +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +GREP +EGREP +ECHO +AR +RANLIB +CPP +CXXCPP +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +HAVE_NCURSES_TRUE +HAVE_NCURSES_FALSE +LIBOBJS +PKG_CONFIG +libola_CFLAGS +libola_LIBS +libolausbproconf_CFLAGS +libolausbproconf_LIBS +libolaartnetconf_CFLAGS +libolaartnetconf_LIBS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +CXXCPP +F77 +FFLAGS +PKG_CONFIG +libola_CFLAGS +libola_LIBS +libolausbproconf_CFLAGS +libolausbproconf_LIBS +libolaartnetconf_CFLAGS +libolaartnetconf_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] include additional configurations [automatic] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + PKG_CONFIG path to pkg-config utility + libola_CFLAGS + C compiler flags for libola, overriding pkg-config + libola_LIBS linker flags for libola, overriding pkg-config + libolausbproconf_CFLAGS + C compiler flags for libolausbproconf, overriding pkg-config + libolausbproconf_LIBS + linker flags for libolausbproconf, overriding pkg-config + libolaartnetconf_CFLAGS + C compiler flags for libolaartnetconf, overriding pkg-config + libolaartnetconf_LIBS + linker flags for libolaartnetconf, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in config "$srcdir"/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.10' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=ola-examples + VERSION=0.8.4 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_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. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 4901 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_prog_f77_g=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } +else + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } +fi + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7155: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7159: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7423: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7427: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7527: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:7531: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* 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 +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* 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 +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which library types will actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" +fi + + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12271: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:12275: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:12375: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:12379: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" + +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13945: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13949: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14049: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14053: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16247: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16251: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16515: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:16519: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:16619: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:16623: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext ${libname}${release}${versuffix}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +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 + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +# Check for ncurses +{ echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5 +echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6; } +if test "${ac_cv_lib_ncurses_initscr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char initscr (); +int +main () +{ +return initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ncurses_initscr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ncurses_initscr=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_initscr" >&6; } +if test $ac_cv_lib_ncurses_initscr = yes; then + have_ncurses="yes" +fi + + if test "${have_ncurses}" = "yes"; then + HAVE_NCURSES_TRUE= + HAVE_NCURSES_FALSE='#' +else + HAVE_NCURSES_TRUE='#' + HAVE_NCURSES_FALSE= +fi + + +# Checks for header files. +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + + + + + + + + + + +for ac_header in endian.h ppc/endian.h arpa/inet.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +#define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } +if test "${ac_cv_header_stdbool_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#ifndef bool + "error: bool is not defined" +#endif +#ifndef false + "error: false is not defined" +#endif +#if false + "error: false is not 0" +#endif +#ifndef true + "error: true is not defined" +#endif +#if true != 1 + "error: true is not 1" +#endif +#ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" +#endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + bool e = &s; + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdbool_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdbool_h=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef _Bool ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type__Bool=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type__Bool=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +if test $ac_cv_type__Bool = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF + +fi + + +# Checks for library functions. +if test $ac_cv_c_compiler_gnu = yes; then + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + + +for ac_header in stdlib.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } +if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_malloc_0_nonnull=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H +# include +#else +char *malloc (); +#endif + +int +main () +{ +return ! malloc (0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_malloc_0_nonnull=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } +if test $ac_cv_func_malloc_0_nonnull = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 1 +_ACEOF + +else + cat >>confdefs.h <<\_ACEOF +#define HAVE_MALLOC 0 +_ACEOF + + case " $LIBOBJS " in + *" malloc.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; +esac + + +cat >>confdefs.h <<\_ACEOF +#define malloc rpl_malloc +_ACEOF + +fi + + + +{ echo "$as_me:$LINENO: checking for working memcmp" >&5 +echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_working=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memcmp_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 +echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + + + +for ac_header in sys/select.h sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } +if test "${ac_cv_func_select_args+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + for ac_arg234 in 'fd_set *' 'int *' 'void *'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do + for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +int +main () +{ +extern int select ($ac_arg1, + $ac_arg234, $ac_arg234, $ac_arg234, + $ac_arg5); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + done +done +# Provide a safe default value. +: ${ac_cv_func_select_args='int,int *,struct timeval *'} + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6; } +ac_save_IFS=$IFS; IFS=',' +set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` +IFS=$ac_save_IFS +shift + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG1 $1 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG234 ($2) +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SELECT_TYPE_ARG5 ($3) +_ACEOF + +rm -f conftest* + + +for ac_func in vprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +{ echo "$as_me:$LINENO: checking for _doprnt" >&5 +echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; } +if test "${ac_cv_func__doprnt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define _doprnt to an innocuous variant, in case declares _doprnt. + For example, HP-UX 11i declares gettimeofday. */ +#define _doprnt innocuous__doprnt + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef _doprnt + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char _doprnt (); +/* 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__doprnt || defined __stub____doprnt +choke me +#endif + +int +main () +{ +return _doprnt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func__doprnt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func__doprnt=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 +echo "${ECHO_T}$ac_cv_func__doprnt" >&6; } +if test $ac_cv_func__doprnt = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_DOPRNT 1 +_ACEOF + +fi + +fi +done + + + + + + + + + +for ac_func in gettimeofday ftime inet_ntoa memset select socket strerror +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for libola" >&5 +echo $ECHO_N "checking for libola... $ECHO_C" >&6; } + +if test -n "$libola_CFLAGS"; then + pkg_cv_libola_CFLAGS="$libola_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libola >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libola >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libola_CFLAGS=`$PKG_CONFIG --cflags "libola >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$libola_LIBS"; then + pkg_cv_libola_LIBS="$libola_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libola >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libola >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libola_LIBS=`$PKG_CONFIG --libs "libola >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + libola_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libola >= 0.3.0" 2>&1` + else + libola_PKG_ERRORS=`$PKG_CONFIG --print-errors "libola >= 0.3.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libola_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (libola >= 0.3.0) were not met: + +$libola_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libola_CFLAGS +and libola_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (libola >= 0.3.0) were not met: + +$libola_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libola_CFLAGS +and libola_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libola_CFLAGS +and libola_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libola_CFLAGS +and libola_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + libola_CFLAGS=$pkg_cv_libola_CFLAGS + libola_LIBS=$pkg_cv_libola_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + : +fi + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for libolausbproconf" >&5 +echo $ECHO_N "checking for libolausbproconf... $ECHO_C" >&6; } + +if test -n "$libolausbproconf_CFLAGS"; then + pkg_cv_libolausbproconf_CFLAGS="$libolausbproconf_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libolausbproconf >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libolausbproconf >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libolausbproconf_CFLAGS=`$PKG_CONFIG --cflags "libolausbproconf >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$libolausbproconf_LIBS"; then + pkg_cv_libolausbproconf_LIBS="$libolausbproconf_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libolausbproconf >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libolausbproconf >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libolausbproconf_LIBS=`$PKG_CONFIG --libs "libolausbproconf >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + libolausbproconf_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libolausbproconf >= 0.3.0" 2>&1` + else + libolausbproconf_PKG_ERRORS=`$PKG_CONFIG --print-errors "libolausbproconf >= 0.3.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libolausbproconf_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (libolausbproconf >= 0.3.0) were not met: + +$libolausbproconf_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libolausbproconf_CFLAGS +and libolausbproconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (libolausbproconf >= 0.3.0) were not met: + +$libolausbproconf_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libolausbproconf_CFLAGS +and libolausbproconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libolausbproconf_CFLAGS +and libolausbproconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libolausbproconf_CFLAGS +and libolausbproconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + libolausbproconf_CFLAGS=$pkg_cv_libolausbproconf_CFLAGS + libolausbproconf_LIBS=$pkg_cv_libolausbproconf_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + : +fi + +pkg_failed=no +{ echo "$as_me:$LINENO: checking for libolaartnetconf" >&5 +echo $ECHO_N "checking for libolaartnetconf... $ECHO_C" >&6; } + +if test -n "$libolaartnetconf_CFLAGS"; then + pkg_cv_libolaartnetconf_CFLAGS="$libolaartnetconf_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libolaartnetconf >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libolaartnetconf >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libolaartnetconf_CFLAGS=`$PKG_CONFIG --cflags "libolaartnetconf >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$libolaartnetconf_LIBS"; then + pkg_cv_libolaartnetconf_LIBS="$libolaartnetconf_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libolaartnetconf >= 0.3.0\"") >&5 + ($PKG_CONFIG --exists --print-errors "libolaartnetconf >= 0.3.0") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_libolaartnetconf_LIBS=`$PKG_CONFIG --libs "libolaartnetconf >= 0.3.0" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + libolaartnetconf_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libolaartnetconf >= 0.3.0" 2>&1` + else + libolaartnetconf_PKG_ERRORS=`$PKG_CONFIG --print-errors "libolaartnetconf >= 0.3.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$libolaartnetconf_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (libolaartnetconf >= 0.3.0) were not met: + +$libolaartnetconf_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libolaartnetconf_CFLAGS +and libolaartnetconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (libolaartnetconf >= 0.3.0) were not met: + +$libolaartnetconf_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables libolaartnetconf_CFLAGS +and libolaartnetconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libolaartnetconf_CFLAGS +and libolaartnetconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables libolaartnetconf_CFLAGS +and libolaartnetconf_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + libolaartnetconf_CFLAGS=$pkg_cv_libolaartnetconf_CFLAGS + libolaartnetconf_LIBS=$pkg_cv_libolaartnetconf_LIBS + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + : +fi + + + + +ac_config_files="$ac_config_files Makefile src/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${HAVE_NCURSES_TRUE}" && test -z "${HAVE_NCURSES_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"HAVE_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"HAVE_NCURSES\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +LN_S!$LN_S$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ECHO!$ECHO$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +CPP!$CPP$ac_delim +CXXCPP!$CXXCPP$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +HAVE_NCURSES_TRUE!$HAVE_NCURSES_TRUE$ac_delim +HAVE_NCURSES_FALSE!$HAVE_NCURSES_FALSE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +PKG_CONFIG!$PKG_CONFIG$ac_delim +libola_CFLAGS!$libola_CFLAGS$ac_delim +libola_LIBS!$libola_LIBS$ac_delim +libolausbproconf_CFLAGS!$libolausbproconf_CFLAGS$ac_delim +libolausbproconf_LIBS!$libolausbproconf_LIBS$ac_delim +libolaartnetconf_CFLAGS!$libolaartnetconf_CFLAGS$ac_delim +libolaartnetconf_LIBS!$libolaartnetconf_LIBS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| . 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/open-lighting-architecture/ola-examples-0.8.4/configure.ac b/open-lighting-architecture/ola-examples-0.8.4/configure.ac new file mode 100644 index 0000000..920a7f3 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/configure.ac @@ -0,0 +1,49 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(configure.ac) +AC_CONFIG_AUX_DIR(config) +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(ola-examples, 0.8.4) + +# Checks for programs. +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +# Check for ncurses +AC_CHECK_LIB([ncurses], [initscr], [have_ncurses="yes"]) +AM_CONDITIONAL(HAVE_NCURSES, test "${have_ncurses}" = "yes") + +# Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS([endian.h ppc/endian.h arpa/inet.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_HEADER_TIME +AC_HEADER_STDBOOL + +# Checks for library functions. +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([gettimeofday ftime inet_ntoa memset select socket strerror]) + +PKG_CHECK_MODULES(libola, [libola >= 0.3.0]) +PKG_CHECK_MODULES(libolausbproconf, [libolausbproconf >= 0.3.0]) +PKG_CHECK_MODULES(libolaartnetconf, [libolaartnetconf >= 0.3.0]) + +AC_SUBST(libola_CFLAGS) +AC_SUBST(libola_LIBS) + +AC_OUTPUT( Makefile \ + src/Makefile \ + ) diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.am b/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.am new file mode 100644 index 0000000..a7dd47a --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.am @@ -0,0 +1,45 @@ + +AM_CXXFLAGS = -Wall -Werror $(libola_CFLAGS) +AM_LDFLAGS = $(libola_LIBS) + +if HAVE_NCURSES +NCURSES_PROGS = ola_dmxconsole ola_dmxmonitor +ola_dmxconsole_SOURCES = ola-dmxconsole.cpp +ola_dmxconsole_LDADD = @LIBS@ -lcurses +ola_dmxmonitor_SOURCES = ola-dmxmonitor.cpp +ola_dmxmonitor_LDADD = @LIBS@ -lcurses +endif + +bin_PROGRAMS = ola_dev_info ola_usbpro ola_artnet ola_e131 \ + ola_streaming_client ola_rdm_discover ola_rdm_get \ + $(NCURSES_PROGS) + +ola_artnet_SOURCES = ola-artnet.cpp +ola_artnet_LDADD = @LIBS@ -lolaartnetconf libolaconfig.la +ola_dev_info_SOURCES = ola-client.cpp +ola_e131_SOURCES = ola-e131.cpp +ola_e131_LDADD = @LIBS@ -lolae131conf libolaconfig.la +ola_streaming_client_SOURCES = ola-streaming-client.cpp +ola_usbpro_SOURCES = ola-usbpro.cpp +ola_usbpro_LDADD = @LIBS@ -lolausbproconf libolaconfig.la +ola_rdm_get_SOURCES = RDMController.cpp RDMHandler.cpp ola-rdm.cpp +ola_rdm_discover_SOURCES = ola-rdm-discover.cpp + +noinst_PROGRAMS = ola_throughput +ola_throughput_SOURCES = ola-throughput.cpp +ola_throughput_LDADD = @LIBS@ + +noinst_LTLIBRARIES = libolaconfig.la +libolaconfig_la_SOURCES = OlaConfigurator.cpp + +EXTRA_DIST = OlaConfigurator.h RDMController.h RDMHandler.h + +install-exec-hook: + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_plugin_info + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_info + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_patch + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_name + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_merge + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_set_dmx + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_set_priority + $(LN_S) -f $(bindir)/ola_rdm_get $(DESTDIR)$(bindir)/ola_rdm_set diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.in b/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.in new file mode 100644 index 0000000..db66082 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/Makefile.in @@ -0,0 +1,608 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = ola_dev_info$(EXEEXT) ola_usbpro$(EXEEXT) \ + ola_artnet$(EXEEXT) ola_e131$(EXEEXT) \ + ola_streaming_client$(EXEEXT) ola_rdm_discover$(EXEEXT) \ + ola_rdm_get$(EXEEXT) $(am__EXEEXT_1) +noinst_PROGRAMS = ola_throughput$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/config/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libolaconfig_la_LIBADD = +am_libolaconfig_la_OBJECTS = OlaConfigurator.lo +libolaconfig_la_OBJECTS = $(am_libolaconfig_la_OBJECTS) +@HAVE_NCURSES_TRUE@am__EXEEXT_1 = ola_dmxconsole$(EXEEXT) \ +@HAVE_NCURSES_TRUE@ ola_dmxmonitor$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_ola_artnet_OBJECTS = ola-artnet.$(OBJEXT) +ola_artnet_OBJECTS = $(am_ola_artnet_OBJECTS) +ola_artnet_DEPENDENCIES = libolaconfig.la +am_ola_dev_info_OBJECTS = ola-client.$(OBJEXT) +ola_dev_info_OBJECTS = $(am_ola_dev_info_OBJECTS) +ola_dev_info_LDADD = $(LDADD) +am__ola_dmxconsole_SOURCES_DIST = ola-dmxconsole.cpp +@HAVE_NCURSES_TRUE@am_ola_dmxconsole_OBJECTS = \ +@HAVE_NCURSES_TRUE@ ola-dmxconsole.$(OBJEXT) +ola_dmxconsole_OBJECTS = $(am_ola_dmxconsole_OBJECTS) +ola_dmxconsole_DEPENDENCIES = +am__ola_dmxmonitor_SOURCES_DIST = ola-dmxmonitor.cpp +@HAVE_NCURSES_TRUE@am_ola_dmxmonitor_OBJECTS = \ +@HAVE_NCURSES_TRUE@ ola-dmxmonitor.$(OBJEXT) +ola_dmxmonitor_OBJECTS = $(am_ola_dmxmonitor_OBJECTS) +ola_dmxmonitor_DEPENDENCIES = +am_ola_e131_OBJECTS = ola-e131.$(OBJEXT) +ola_e131_OBJECTS = $(am_ola_e131_OBJECTS) +ola_e131_DEPENDENCIES = libolaconfig.la +am_ola_rdm_discover_OBJECTS = ola-rdm-discover.$(OBJEXT) +ola_rdm_discover_OBJECTS = $(am_ola_rdm_discover_OBJECTS) +ola_rdm_discover_LDADD = $(LDADD) +am_ola_rdm_get_OBJECTS = RDMController.$(OBJEXT) RDMHandler.$(OBJEXT) \ + ola-rdm.$(OBJEXT) +ola_rdm_get_OBJECTS = $(am_ola_rdm_get_OBJECTS) +ola_rdm_get_LDADD = $(LDADD) +am_ola_streaming_client_OBJECTS = ola-streaming-client.$(OBJEXT) +ola_streaming_client_OBJECTS = $(am_ola_streaming_client_OBJECTS) +ola_streaming_client_LDADD = $(LDADD) +am_ola_throughput_OBJECTS = ola-throughput.$(OBJEXT) +ola_throughput_OBJECTS = $(am_ola_throughput_OBJECTS) +ola_throughput_DEPENDENCIES = +am_ola_usbpro_OBJECTS = ola-usbpro.$(OBJEXT) +ola_usbpro_OBJECTS = $(am_ola_usbpro_OBJECTS) +ola_usbpro_DEPENDENCIES = libolaconfig.la +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libolaconfig_la_SOURCES) $(ola_artnet_SOURCES) \ + $(ola_dev_info_SOURCES) $(ola_dmxconsole_SOURCES) \ + $(ola_dmxmonitor_SOURCES) $(ola_e131_SOURCES) \ + $(ola_rdm_discover_SOURCES) $(ola_rdm_get_SOURCES) \ + $(ola_streaming_client_SOURCES) $(ola_throughput_SOURCES) \ + $(ola_usbpro_SOURCES) +DIST_SOURCES = $(libolaconfig_la_SOURCES) $(ola_artnet_SOURCES) \ + $(ola_dev_info_SOURCES) $(am__ola_dmxconsole_SOURCES_DIST) \ + $(am__ola_dmxmonitor_SOURCES_DIST) $(ola_e131_SOURCES) \ + $(ola_rdm_discover_SOURCES) $(ola_rdm_get_SOURCES) \ + $(ola_streaming_client_SOURCES) $(ola_throughput_SOURCES) \ + $(ola_usbpro_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +libola_CFLAGS = @libola_CFLAGS@ +libola_LIBS = @libola_LIBS@ +libolaartnetconf_CFLAGS = @libolaartnetconf_CFLAGS@ +libolaartnetconf_LIBS = @libolaartnetconf_LIBS@ +libolausbproconf_CFLAGS = @libolausbproconf_CFLAGS@ +libolausbproconf_LIBS = @libolausbproconf_LIBS@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CXXFLAGS = -Wall -Werror $(libola_CFLAGS) +AM_LDFLAGS = $(libola_LIBS) +@HAVE_NCURSES_TRUE@NCURSES_PROGS = ola_dmxconsole ola_dmxmonitor +@HAVE_NCURSES_TRUE@ola_dmxconsole_SOURCES = ola-dmxconsole.cpp +@HAVE_NCURSES_TRUE@ola_dmxconsole_LDADD = @LIBS@ -lcurses +@HAVE_NCURSES_TRUE@ola_dmxmonitor_SOURCES = ola-dmxmonitor.cpp +@HAVE_NCURSES_TRUE@ola_dmxmonitor_LDADD = @LIBS@ -lcurses +ola_artnet_SOURCES = ola-artnet.cpp +ola_artnet_LDADD = @LIBS@ -lolaartnetconf libolaconfig.la +ola_dev_info_SOURCES = ola-client.cpp +ola_e131_SOURCES = ola-e131.cpp +ola_e131_LDADD = @LIBS@ -lolae131conf libolaconfig.la +ola_streaming_client_SOURCES = ola-streaming-client.cpp +ola_usbpro_SOURCES = ola-usbpro.cpp +ola_usbpro_LDADD = @LIBS@ -lolausbproconf libolaconfig.la +ola_rdm_get_SOURCES = RDMController.cpp RDMHandler.cpp ola-rdm.cpp +ola_rdm_discover_SOURCES = ola-rdm-discover.cpp +ola_throughput_SOURCES = ola-throughput.cpp +ola_throughput_LDADD = @LIBS@ +noinst_LTLIBRARIES = libolaconfig.la +libolaconfig_la_SOURCES = OlaConfigurator.cpp +EXTRA_DIST = OlaConfigurator.h RDMController.h RDMHandler.h +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libolaconfig.la: $(libolaconfig_la_OBJECTS) $(libolaconfig_la_DEPENDENCIES) + $(CXXLINK) $(libolaconfig_la_OBJECTS) $(libolaconfig_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +ola_artnet$(EXEEXT): $(ola_artnet_OBJECTS) $(ola_artnet_DEPENDENCIES) + @rm -f ola_artnet$(EXEEXT) + $(CXXLINK) $(ola_artnet_OBJECTS) $(ola_artnet_LDADD) $(LIBS) +ola_dev_info$(EXEEXT): $(ola_dev_info_OBJECTS) $(ola_dev_info_DEPENDENCIES) + @rm -f ola_dev_info$(EXEEXT) + $(CXXLINK) $(ola_dev_info_OBJECTS) $(ola_dev_info_LDADD) $(LIBS) +ola_dmxconsole$(EXEEXT): $(ola_dmxconsole_OBJECTS) $(ola_dmxconsole_DEPENDENCIES) + @rm -f ola_dmxconsole$(EXEEXT) + $(CXXLINK) $(ola_dmxconsole_OBJECTS) $(ola_dmxconsole_LDADD) $(LIBS) +ola_dmxmonitor$(EXEEXT): $(ola_dmxmonitor_OBJECTS) $(ola_dmxmonitor_DEPENDENCIES) + @rm -f ola_dmxmonitor$(EXEEXT) + $(CXXLINK) $(ola_dmxmonitor_OBJECTS) $(ola_dmxmonitor_LDADD) $(LIBS) +ola_e131$(EXEEXT): $(ola_e131_OBJECTS) $(ola_e131_DEPENDENCIES) + @rm -f ola_e131$(EXEEXT) + $(CXXLINK) $(ola_e131_OBJECTS) $(ola_e131_LDADD) $(LIBS) +ola_rdm_discover$(EXEEXT): $(ola_rdm_discover_OBJECTS) $(ola_rdm_discover_DEPENDENCIES) + @rm -f ola_rdm_discover$(EXEEXT) + $(CXXLINK) $(ola_rdm_discover_OBJECTS) $(ola_rdm_discover_LDADD) $(LIBS) +ola_rdm_get$(EXEEXT): $(ola_rdm_get_OBJECTS) $(ola_rdm_get_DEPENDENCIES) + @rm -f ola_rdm_get$(EXEEXT) + $(CXXLINK) $(ola_rdm_get_OBJECTS) $(ola_rdm_get_LDADD) $(LIBS) +ola_streaming_client$(EXEEXT): $(ola_streaming_client_OBJECTS) $(ola_streaming_client_DEPENDENCIES) + @rm -f ola_streaming_client$(EXEEXT) + $(CXXLINK) $(ola_streaming_client_OBJECTS) $(ola_streaming_client_LDADD) $(LIBS) +ola_throughput$(EXEEXT): $(ola_throughput_OBJECTS) $(ola_throughput_DEPENDENCIES) + @rm -f ola_throughput$(EXEEXT) + $(CXXLINK) $(ola_throughput_OBJECTS) $(ola_throughput_LDADD) $(LIBS) +ola_usbpro$(EXEEXT): $(ola_usbpro_OBJECTS) $(ola_usbpro_DEPENDENCIES) + @rm -f ola_usbpro$(EXEEXT) + $(CXXLINK) $(ola_usbpro_OBJECTS) $(ola_usbpro_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OlaConfigurator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMController.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RDMHandler.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-artnet.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-dmxconsole.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-dmxmonitor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-e131.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-rdm-discover.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-rdm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-streaming-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-throughput.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ola-usbpro.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-exec-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS + + +install-exec-hook: + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_plugin_info + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_info + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_patch + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_name + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_uni_merge + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_set_dmx + $(LN_S) -f $(bindir)/ola_dev_info $(DESTDIR)$(bindir)/ola_set_priority + $(LN_S) -f $(bindir)/ola_rdm_get $(DESTDIR)$(bindir)/ola_rdm_set +# 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/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.cpp new file mode 100644 index 0000000..d07dd73 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.cpp @@ -0,0 +1,108 @@ +/* + * 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 Library 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. + * + * OlaConfigurator.cpp + * Makes configuring devices easy + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include + +#include "src/OlaConfigurator.h" + +using ola::NewSingleCallback; +using ola::OlaCallbackClient; +using ola::OlaDevice; +using ola::network::SelectServer; +using std::cout; +using std::endl; +using std::string; +using std::vector; + + +/* + * Clean up + */ +OlaConfigurator::~OlaConfigurator() { + delete m_client_wrapper; +} + + +/* + * Setup the configurator + * @return true on success, false on failure + */ +bool OlaConfigurator::Setup() { + m_client_wrapper = new ola::OlaCallbackClientWrapper(); + if (!m_client_wrapper->Setup()) { + delete m_client_wrapper; + m_client_wrapper = NULL; + return false; + } + + m_client = m_client_wrapper->GetClient(); + m_ss = m_client_wrapper->GetSelectServer(); + + // fire off a DeviceInfo request + m_client->FetchDeviceInfo( + m_plugin_id, + NewSingleCallback(this, &OlaConfigurator::HandleDevices)); + return true; +} + + +/* + * Send a ConfigureDevice() request + * @param message the request to send + */ +bool OlaConfigurator::SendMessage(const google::protobuf::Message &message) { + string request_string; + message.SerializeToString(&request_string); + return m_client->ConfigureDevice( + m_alias, + request_string, + NewSingleCallback(this, &OlaConfigurator::HandleConfigResponse)); +} + + +/* + * Handle the DeviceInfo response. We do this to ensure that the plugin this + * device corresponds to is the one we expect. + * + * @param devices a vector of OlaDevice objects + * @param error an error string + */ +void OlaConfigurator::HandleDevices(const vector &devices, + const string &error) { + if (!error.empty()) { + cout << "Error: " << error << endl; + m_ss->Terminate(); + return; + } + + vector ::const_iterator iter; + for (iter = devices.begin(); iter != devices.end(); ++iter) { + if (iter->Alias() == m_alias && iter->PluginId() == m_plugin_id) { + SendConfigRequest(); + return; + } + } + cout << "Device " << m_alias << " is of the wrong type or missing." << endl; + m_ss->Terminate(); +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.h b/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.h new file mode 100644 index 0000000..d03637c --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/OlaConfigurator.h @@ -0,0 +1,91 @@ +/* + * 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 Library 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. + * + * OlaConfigurator.h + * Makes configuring devices easy + * Copyright (C) 2005-2009 Simon Newton + * + * The Configurator makes it easy to use the device specific ConfigureDevice() + * rpc. For each device type you want to manage, subclass the Configurator and + * implement the SendConfigRequest() and HandleConfigResponse() methods. + * Upon calling Setup() the Configurator will send a DeviceInfo + * request to check that the device type matches the plugin_id given in the + * constructor. On successfull match, it will call SendConfigRequest() which + * the subclass uses to send the desired request. + * + * Once the response is returned, HandleConfigResponse() is called in the + * subclass. + */ + +#include +#include +#include +#include +#include + +#include +#include + +using std::string; +using std::vector; + +#ifndef SRC_OLACONFIGURATOR_H_ +#define SRC_OLACONFIGURATOR_H_ + +class OlaConfigurator; + + +/* + * Inherit from this and implement HandleResponse() + */ +class OlaConfigurator { + public: + /* + * @param device_id the device id to configure + * @param plugin_id the expected plugin id for this device + */ + OlaConfigurator(unsigned int device_id, ola::ola_plugin_id plugin_id): + m_alias(device_id), + m_plugin_id(plugin_id), + m_client_wrapper(NULL), + m_client(NULL), + m_ss(NULL) {} + virtual ~OlaConfigurator(); + + /* + * Setup the configurator + */ + bool Setup(); + void Run() { m_ss->Run(); } + void Terminate() { m_ss->Terminate(); } + void HandleDevices(const vector &devices, + const string &error); + bool SendMessage(const google::protobuf::Message &message); + + // Subclasses implement this + virtual void HandleConfigResponse(const string &reply, + const string &error) = 0; + virtual void SendConfigRequest() = 0; + + protected: + unsigned int m_alias; + ola::ola_plugin_id m_plugin_id; + + private: + ola::OlaCallbackClientWrapper *m_client_wrapper; + ola::OlaCallbackClient *m_client; + ola::network::SelectServer *m_ss; +}; +#endif // SRC_OLACONFIGURATOR_H_ diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.cpp new file mode 100644 index 0000000..1453c0f --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.cpp @@ -0,0 +1,1884 @@ +/* + * 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 Library 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. + * + * RDMController.cpp + * A command line based RDM controller + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "src/RDMController.h" +#include "src/RDMHandler.h" + +using std::map; +using std::string; +using std::vector; +using ola::rdm::RDMAPI; +using ola::rdm::UID; + + +PidDescriptor::PidDescriptor(ExecuteMethod get_execute, + ExecuteMethod set_execute): + m_get_execute(get_execute), + m_set_execute(set_execute) { +} + +PidDescriptor *PidDescriptor::AddGetVerify(CheckMethod method) { + m_get_verify.push_back(method); + return this; +} + + +PidDescriptor *PidDescriptor::AddSetVerify(CheckMethod method) { + m_set_verify.push_back(method); + return this; +} + +bool PidDescriptor::Run(RDMController *controller, + const UID &uid, + uint16_t sub_device, + bool set, + uint16_t pid, + const vector ¶ms, + string *error) { + vector &methods = set ? m_set_verify : m_get_verify; + vector::const_iterator iter; + for (iter = methods.begin(); iter != methods.end(); ++iter) { + if (!(controller->*(*iter))(uid, sub_device, params, error)) + return false; + } + + ExecuteMethod exec_method = set ? m_set_execute : m_get_execute; + + if (!exec_method) { + *error = set ? "Set" : "Get"; + *error += " not permitted"; + return false; + } + return (controller->*exec_method)(uid, sub_device, params, error); +} + + +RDMController::~RDMController() { + map::iterator iter; + for (iter = m_pid_map.begin(); iter != m_pid_map.end(); ++iter) { + delete iter->second; + } + m_pid_map.clear(); +} + + +/* + * Make a GET/SET PID request + * @param uid + * @param sub_device + * @param set, true if this is a set request, false for a get request + * @param pid_name, the name of the pid to get/set + * @param params, optional data for the request + * @param error, a pointer to a string which is updated with the error + * @returns true if ok, false otherwise + */ +bool RDMController::RequestPID(const UID &uid, + uint16_t sub_device, + bool is_set, + uint16_t pid, + const vector ¶ms, + string *error) { + map::const_iterator iter = + m_pid_map.find(pid); + + if (iter == m_pid_map.end()) { + *error = "Unknown PID"; + return false; + } + return iter->second->Run(this, uid, sub_device, is_set, pid, params, error); +} + + +/* + * Populate the pid maps + */ +void RDMController::LoadMap() { + if (m_pid_map.size()) + return; + + // populate the PID descriptor map + MakeDescriptor(ola::rdm::PID_PROXIED_DEVICES, + &RDMController::GetProxiedDevices, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PROXIED_DEVICE_COUNT, + &RDMController::GetProxiedDeviceCount, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_COMMS_STATUS, + &RDMController::GetCommStatus, + &RDMController::ClearCommStatus)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::RootDeviceCheck)->AddSetVerify( + &RDMController::NoArgsCheck)->AddSetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_STATUS_MESSAGES, + &RDMController::GetStatusMessage, + NULL)->AddGetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_STATUS_ID_DESCRIPTION, + &RDMController::GetStatusIdDescription, + NULL)->AddGetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_CLEAR_STATUS_ID, + NULL, + &RDMController::ClearStatusId)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD, + &RDMController::GetSubDeviceReporting, + &RDMController::SetSubDeviceReporting)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SUPPORTED_PARAMETERS, + &RDMController::GetSupportedParameters, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PARAMETER_DESCRIPTION, + &RDMController::GetParameterDescription, + NULL)->AddGetVerify( + &RDMController::RootDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEVICE_INFO, + &RDMController::GetDeviceInfo, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PRODUCT_DETAIL_ID_LIST, + &RDMController::GetProductDetailIdList, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEVICE_MODEL_DESCRIPTION, + &RDMController::GetDeviceModelDescription, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_MANUFACTURER_LABEL, + &RDMController::GetManufacturerLabel, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEVICE_LABEL, + &RDMController::GetDeviceLabel, + &RDMController::SetDeviceLabel)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + // DONE UP TO HERE!!! + + MakeDescriptor(ola::rdm::PID_FACTORY_DEFAULTS, + &RDMController::GetFactoryDefaults, + &RDMController::ResetToFactoryDefaults)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::NoArgsCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LANGUAGE_CAPABILITIES, + &RDMController::GetLanguageCapabilities, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LANGUAGE, + &RDMController::GetLanguage, + &RDMController::SetLanguage)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SOFTWARE_VERSION_LABEL, + &RDMController::GetSoftwareVersionLabel, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_BOOT_SOFTWARE_VERSION_ID, + &RDMController::GetBootSoftwareVersion, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_BOOT_SOFTWARE_VERSION_LABEL, + &RDMController::GetBootSoftwareVersionLabel, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DMX_PERSONALITY, + &RDMController::GetDMXPersonality, + &RDMController::SetDMXPersonality)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + + MakeDescriptor(ola::rdm::PID_DMX_PERSONALITY_DESCRIPTION, + &RDMController::GetDMXPersonalityDescription, + NULL)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DMX_START_ADDRESS, + &RDMController::GetDMXAddress, + &RDMController::SetDMXAddress)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SLOT_INFO, + &RDMController::GetSlotInfo, + NULL)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SLOT_DESCRIPTION, + &RDMController::GetSlotDescription, + NULL)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEFAULT_SLOT_VALUE, + &RDMController::GetSlotDefaultValues, + NULL)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SENSOR_DEFINITION, + &RDMController::GetSensorDefinition, + NULL)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SENSOR_VALUE, + &RDMController::GetSensorValue, + &RDMController::SetSensorValue)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_RECORD_SENSORS, + NULL, + &RDMController::RecordSensors)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEVICE_HOURS, + &RDMController::GetDeviceHours, + &RDMController::SetDeviceHours)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LAMP_HOURS, + &RDMController::GetLampHours, + &RDMController::SetLampHours)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LAMP_STRIKES, + &RDMController::GetLampStrikes, + &RDMController::SetLampStrikes)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LAMP_STATE, + &RDMController::GetLampState, + &RDMController::SetLampState)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_LAMP_ON_MODE, + &RDMController::GetLampMode, + &RDMController::SetLampMode)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DEVICE_POWER_CYCLES, + &RDMController::GetDevicePowerCycles, + &RDMController::SetDevicePowerCycles)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + // done up to here + MakeDescriptor(ola::rdm::PID_DISPLAY_INVERT, + &RDMController::GetDisplayInvert, + &RDMController::SetDisplayInvert)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_DISPLAY_LEVEL, + &RDMController::GetDisplayLevel, + &RDMController::SetDisplayLevel)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PAN_INVERT, + &RDMController::GetPanInvert, + &RDMController::SetPanInvert)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_TILT_INVERT, + &RDMController::GetTiltInvert, + &RDMController::SetTiltInvert)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PAN_TILT_SWAP, + &RDMController::GetPanTiltSwap, + &RDMController::SetPanTiltSwap)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_REAL_TIME_CLOCK, + &RDMController::GetClock, + &RDMController::SetClock)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_IDENTIFY_DEVICE, + &RDMController::GetIdentifyMode, + &RDMController::IdentifyDevice)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_RESET_DEVICE, + NULL, + &RDMController::ResetDevice)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_POWER_STATE, + &RDMController::GetPowerState, + &RDMController::SetPowerState)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PERFORM_SELFTEST, + &RDMController::GetSelfTest, + &RDMController::SetSelfTest)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_SELF_TEST_DESCRIPTION, + &RDMController::GetSelfTestDescription, + NULL)->AddGetVerify( + &RDMController::ValidSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_CAPTURE_PRESET, + NULL, + &RDMController::CapturePreset)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); + + MakeDescriptor(ola::rdm::PID_PRESET_PLAYBACK, + &RDMController::GetPresetPlayback, + &RDMController::SetPresetPlayback)->AddGetVerify( + &RDMController::NoArgsCheck)->AddGetVerify( + &RDMController::ValidSubDeviceCheck)->AddSetVerify( + &RDMController::ValidBroadcastSubDeviceCheck); +} + + +//----------------------------------------------------------------------------- +PidDescriptor *RDMController::MakeDescriptor(uint16_t pid, + ExecuteMethod get_execute, + ExecuteMethod set_execute) { + PidDescriptor *d = new PidDescriptor(get_execute, set_execute); + m_pid_map.insert(std::pair(pid, d)); + return d; +} + +//----------------------------------------------------------------------------- + +// First up are generic check methods + + +/* + * Check that the sub device is 0 + */ +bool RDMController::RootDeviceCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (sub_device) { + *error = "Sub device must be 0 (root device)"; + return false; + } + return true; +} + + +/* + * Check the sub device is valid + */ +bool RDMController::ValidSubDeviceCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (sub_device > ola::rdm::MAX_SUBDEVICE_NUMBER) { + std::stringstream str; + str << "Sub device must be <= " << ola::rdm::MAX_SUBDEVICE_NUMBER; + *error = str.str(); + return false; + } + return true; +} + + +/* + * Check the sub device is valid or broadcast + */ +bool RDMController::ValidBroadcastSubDeviceCheck( + const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (sub_device > ola::rdm::MAX_SUBDEVICE_NUMBER && + sub_device != ola::rdm::ALL_RDM_SUBDEVICES) { + std::stringstream str; + str << "Sub device must be <= " << ola::rdm::MAX_SUBDEVICE_NUMBER << + " or " << ola::rdm::ALL_RDM_SUBDEVICES << " (all subdevices)"; + *error = str.str(); + return false; + } + return true; +} + + + +/* + * Check that no arguments were supplied + */ +bool RDMController::NoArgsCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (args.size()) { + *error = "No args required"; + return false; + } + return true; +} + + +/* + * Check for no args, and the root device + */ +bool RDMController::NoArgsRootDeviceSetCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (sub_device) { + *error = "Sub device must be 0 (root device)"; + return false; + } + if (args.size()) { + *error = "No args required"; + return false; + } + return true; +} + + +// Now we have the get/ set methods +//----------------------------------------------------------------------------- + +bool RDMController::GetProxiedDeviceCount(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetProxiedDeviceCount( + m_universe, + uid, + ola::NewSingleCallback(m_handler, &ResponseHandler::ProxiedDeviceCount), + error); +} + + +bool RDMController::GetProxiedDevices(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetProxiedDevices( + m_universe, + uid, + ola::NewSingleCallback(m_handler, &ResponseHandler::ProxiedDevices), + error); +} + + +bool RDMController::GetCommStatus(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetCommStatus( + m_universe, + uid, + ola::NewSingleCallback(m_handler, &ResponseHandler::CommStatus), + error); +} + + +bool RDMController::ClearCommStatus(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->ClearCommStatus( + m_universe, + uid, + ola::NewSingleCallback(m_handler, &ResponseHandler::ClearCommStatus), + error); +} + + +bool RDMController::GetStatusMessage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + ola::rdm::rdm_status_type status_type; + if (args.size() != 1 || (!StringToStatusType(args[0], &status_type))) { + *error = "arg must be one of {none, last, error, warning, advisory}"; + return false; + } + return m_api->GetStatusMessage( + m_universe, + uid, + status_type, + ola::NewSingleCallback(m_handler, + &ResponseHandler::StatusMessages), + error); +} + + +bool RDMController::GetStatusIdDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint16_t status_id; + if (!CheckForUInt16(&status_id, error, args)) + return false; + return m_api->GetStatusIdDescription( + m_universe, + uid, + status_id, + ola::NewSingleCallback(m_handler, &ResponseHandler::StatusIdDescription), + error); +} + + +bool RDMController::ClearStatusId(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->ClearStatusId( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::ClearStatusId), + error); +} + + +bool RDMController::GetSubDeviceReporting(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetSubDeviceReporting( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::SubDeviceReporting), + error); +} + + +bool RDMController::SetSubDeviceReporting(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + ola::rdm::rdm_status_type status_type; + if (args.size() != 1 || (!StringToStatusType(args[0], &status_type))) { + *error = "arg must be one of {none, error, warning, advisory}"; + return false; + } + if (status_type == ola::rdm::STATUS_GET_LAST_MESSAGE) { + *error = "arg must be one of {none, error, warning, advisory}"; + return false; + } + return m_api->SetSubDeviceReporting( + m_universe, + uid, + sub_device, + status_type, + ola::NewSingleCallback(m_handler, + &ResponseHandler::SetSubDeviceReporting), + error); +} + + +bool RDMController::GetSupportedParameters(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetSupportedParameters( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::SupportedParameters), + error); +} + + +bool RDMController::GetParameterDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint16_t pid; + if (!CheckForUInt16(&pid, error, args)) + return false; + return m_api->GetParameterDescription( + m_universe, + uid, + pid, + ola::NewSingleCallback(m_handler, + &ResponseHandler::ParameterDescription), + error); +} + + +bool RDMController::GetDeviceInfo(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDeviceInfo( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DeviceInfo), + error); +} + + +bool RDMController::GetProductDetailIdList(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetProductDetailIdList( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::ProductDetailIdList), + error); +} + + +bool RDMController::GetDeviceModelDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDeviceModelDescription( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::DeviceModelDescription), + error); +} + + +bool RDMController::GetManufacturerLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetManufacturerLabel( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::ManufacturerLabel), + error); +} + + +bool RDMController::GetDeviceLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDeviceLabel( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DeviceLabel), + error); +} + + +bool RDMController::SetDeviceLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (args.size() != 1) { + *error = "Argument must be supplied, the first 32 characters will be used"; + return false; + } + return m_api->SetDeviceLabel( + m_universe, + uid, + sub_device, + args[0], + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDeviceLabel), + error); +} + + +bool RDMController::GetFactoryDefaults(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetFactoryDefaults( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::FactoryDefaults), + error); +} + + +bool RDMController::ResetToFactoryDefaults(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->ResetToFactoryDefaults( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::ResetToFactoryDefaults), + error); +} + + +bool RDMController::GetLanguageCapabilities(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLanguageCapabilities( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::LanguageCapabilities), + error); +} + + +bool RDMController::GetLanguage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLanguage( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::Language), + error); +} + + +bool RDMController::SetLanguage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + if (args.size() != 1 || args[0].size() != 2) { + *error = "Argument must be a 2 char string"; + return false; + } + string language = args[0].substr(0, 2); + return m_api->SetLanguage( + m_universe, + uid, + sub_device, + language, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetLanguage), + error); +} + + +bool RDMController::GetSoftwareVersionLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetSoftwareVersionLabel( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::SoftwareVersionLabel), + error); +} + + +bool RDMController::GetBootSoftwareVersion(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetBootSoftwareVersion( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::BootSoftwareVersion), + error); +} + + +bool RDMController::GetBootSoftwareVersionLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetBootSoftwareVersionLabel( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::BootSoftwareVersionLabel), + error); +} + + +bool RDMController::GetDMXPersonality(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDMXPersonality( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DMXPersonality), + error); +} + + +bool RDMController::SetDMXPersonality(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t personality; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &personality))) { + *error = "Argument must be an integer between 1 and 255"; + return false; + } + if (personality == 0) { + *error = "Personality can't be 0"; + return false; + } + return m_api->SetDMXPersonality( + m_universe, + uid, + sub_device, + personality, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDMXPersonality), + error); +} + + +bool RDMController::GetDMXPersonalityDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t personality; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &personality))) { + *error = "Argument must be an integer between 1 and 255"; + return false; + } + if (personality == 0) { + *error = "Personality can't be 0"; + return false; + } + return m_api->GetDMXPersonalityDescription( + m_universe, + uid, + sub_device, + personality, + ola::NewSingleCallback(m_handler, + &ResponseHandler::DMXPersonalityDescription), + error); +} + + +bool RDMController::GetDMXAddress(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDMXAddress( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DMXAddress), + error); +} + + +bool RDMController::SetDMXAddress(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint16_t dmx_address = 0; + if (args.size() != 1 || (!ola::StringToUInt16(args[0], &dmx_address))) { + *error = "Argument must be a uint16"; + return false; + } + if (dmx_address == 0 || dmx_address > DMX_UNIVERSE_SIZE) { + *error = "Dmx address must be between 1 and 512"; + return false; + } + return m_api->SetDMXAddress( + m_universe, + uid, + sub_device, + dmx_address, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDMXAddress), + error); +} + + +bool RDMController::GetSlotInfo(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetSlotInfo( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::SlotInfo), + error); +} + + +bool RDMController::GetSlotDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint16_t slot_id = 0; + if (!CheckForUInt16(&slot_id, error, args)) + return false; + return m_api->GetSlotDescription( + m_universe, + uid, + sub_device, + slot_id, + ola::NewSingleCallback(m_handler, &ResponseHandler::SlotDescription), + error); +} + + +bool RDMController::GetSlotDefaultValues(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetSlotDefaultValues( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::SlotDefaultValues), + error); +} + + +bool RDMController::GetSensorDefinition(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t sensor; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &sensor))) { + *error = "Argument must be a uint8"; + return false; + } + return m_api->GetSensorDefinition( + m_universe, + uid, + sub_device, + sensor, + ola::NewSingleCallback(m_handler, &ResponseHandler::SensorDefinition), + error); +} + + +bool RDMController::GetSensorValue(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t sensor; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &sensor))) { + *error = "Argument must be a uint8"; + return false; + } + return m_api->GetSensorValue( + m_universe, + uid, + sub_device, + sensor, + ola::NewSingleCallback(m_handler, &ResponseHandler::SensorValue), + error); +} + + +bool RDMController::SetSensorValue(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t sensor; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &sensor))) { + *error = "Argument must be a uint8"; + return false; + } + return m_api->SetSensorValue( + m_universe, + uid, + sub_device, + sensor, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetSensorValue), + error); +} + + +bool RDMController::RecordSensors(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t sensor; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &sensor))) { + *error = "Argument must be a uint8"; + return false; + } + return m_api->RecordSensors( + m_universe, + uid, + sub_device, + sensor, + ola::NewSingleCallback(m_handler, &ResponseHandler::RecordSensors), + error); +} + + +bool RDMController::GetDeviceHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDeviceHours( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DeviceHours), + error); +} + + +bool RDMController::SetDeviceHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint32_t device_hours = 0; + if (args.size() != 1 || (!ola::StringToUInt(args[0], &device_hours))) { + *error = "Argument must be a uint32"; + return false; + } + return m_api->SetDeviceHours( + m_universe, + uid, + sub_device, + device_hours, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDeviceHours), + error); +} + + +bool RDMController::GetLampHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLampHours( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::LampHours), + error); +} + + +bool RDMController::SetLampHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint32_t lamp_hours = 0; + if (args.size() != 1 || (!ola::StringToUInt(args[0], &lamp_hours))) { + *error = "Argument must be a uint32"; + return false; + } + return m_api->SetLampHours( + m_universe, + uid, + sub_device, + lamp_hours, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetLampHours), + error); +} + + +bool RDMController::GetLampStrikes(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLampStrikes( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::LampStrikes), + error); +} + + +bool RDMController::SetLampStrikes(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint32_t lamp_strikes = 0; + if (args.size() != 1 || (!ola::StringToUInt(args[0], &lamp_strikes))) { + *error = "Argument must be a uint32"; + return false; + } + return m_api->SetLampStrikes( + m_universe, + uid, + sub_device, + lamp_strikes, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetLampStrikes), + error); +} + + +bool RDMController::GetLampState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLampState( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, + &ResponseHandler::LampState), + error); +} + + +bool RDMController::SetLampState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + ola::rdm::rdm_lamp_state state; + if (args.size() != 1 || (!StringToLampState(args[0], &state))) { + *error = "Argument must be one of {off, on, strike, standby}"; + return false; + } + return m_api->SetLampState( + m_universe, + uid, + sub_device, + state, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetLampState), + error); +} + + +bool RDMController::GetLampMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetLampMode( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::LampMode), + error); +} + + +bool RDMController::SetLampMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + ola::rdm::rdm_lamp_mode mode; + if (args.size() != 1 || (!StringToLampMode(args[0], &mode))) { + *error = "Argument must be one of {off, dmx, on, calibration}"; + return false; + } + return m_api->SetLampMode( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetLampMode), + error); +} + + +bool RDMController::GetDevicePowerCycles(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDevicePowerCycles( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DevicePowerCycles), + error); +} + + +bool RDMController::SetDevicePowerCycles(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint32_t power_cycles = 0; + if (args.size() != 1 || (!ola::StringToUInt(args[0], &power_cycles))) { + *error = " Argument must be a uint32"; + return false; + } + return m_api->SetDevicePowerCycles( + m_universe, + uid, + sub_device, + power_cycles, + ola::NewSingleCallback(m_handler, + &ResponseHandler::SetDevicePowerCycles), + error); +} + + +bool RDMController::GetDisplayInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDisplayInvert( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DisplayInvert), + error); +} + + +bool RDMController::SetDisplayInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToOnOffAuto(args[0], &mode))) { + *error = "Argument must be one of {on, off, auto}"; + return false; + } + return m_api->SetDisplayInvert( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDisplayInvert), + error); +} + + +bool RDMController::GetDisplayLevel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetDisplayLevel( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::DisplayLevel), + error); +} + + +bool RDMController::SetDisplayLevel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t level; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &level))) { + *error = "Argument must be a uint8"; + return false; + } + return m_api->SetDisplayLevel( + m_universe, + uid, + sub_device, + level, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetDisplayLevel), + error); +} + + +bool RDMController::GetPanInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetPanInvert( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::PanInvert), + error); +} + + +bool RDMController::SetPanInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToOnOff(args[0], &mode))) { + *error = "Argument must be on of {on, off}"; + return false; + } + return m_api->SetPanInvert( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetPanInvert), + error); +} + + +bool RDMController::GetTiltInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetTiltInvert( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::TiltInvert), + error); +} + + +bool RDMController::SetTiltInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToOnOff(args[0], &mode))) { + *error = "Argument must be on of {on, off}"; + return false; + } + return m_api->SetTiltInvert( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetTiltInvert), + error); +} + + +bool RDMController::GetPanTiltSwap(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetPanTiltSwap( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::PanTiltSwap), + error); +} + + +bool RDMController::SetPanTiltSwap(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToOnOff(args[0], &mode))) { + *error = "Argument must be on of {on, off}"; + return false; + } + return m_api->SetPanTiltSwap( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetPanTiltSwap), + error); +} + + +bool RDMController::GetClock(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetClock( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::Clock), + error); +} + + +bool RDMController::SetClock(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + const string invalid_format_error = + "Requires an argument in the form YYYY-MM-DD hh:mm:ss"; + if (args.size() != 1) { + *error = invalid_format_error; + return false; + } + struct tm time_spec; + char *result = strptime(args[0].data(), "%Y-%m-%d %H:%M:%S", &time_spec); + if (!result) { + *error = invalid_format_error; + return false; + } + ola::rdm::ClockValue clock; + clock.year = time_spec.tm_year + 1900; + clock.month = time_spec.tm_mon + 1; + clock.day = time_spec.tm_mday; + clock.hour = time_spec.tm_hour; + clock.minute = time_spec.tm_min; + clock.second = time_spec.tm_sec; + return m_api->SetClock( + m_universe, + uid, + sub_device, + clock, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetClock), + error); +} + + +bool RDMController::GetIdentifyMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetIdentifyMode( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::IdentifyMode), + error); +} + + +bool RDMController::IdentifyDevice(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToOnOff(args[0], &mode))) { + *error = "Argument must be on of {on, off}"; + return false; + } + return m_api->IdentifyDevice( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::IdentifyDevice), + error); +} + + +bool RDMController::ResetDevice(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t mode; + if (args.size() != 1 || (!StringToWarmCold(args[0], &mode))) { + *error = "Argument must be one of {warm, cold}"; + return false; + } + return m_api->ResetDevice( + m_universe, + uid, + sub_device, + mode, + ola::NewSingleCallback(m_handler, &ResponseHandler::ResetDevice), + error); +} + + +bool RDMController::GetPowerState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->GetPowerState( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::PowerState), + error); +} + + +bool RDMController::SetPowerState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + ola::rdm::rdm_power_state state; + if (args.size() != 1 || (!StringToPowerState(args[0], &state))) { + *error = "Argument must be one of {off, shutdown, standby, normal}"; + return false; + } + return m_api->SetPowerState( + m_universe, + uid, + sub_device, + state, + ola::NewSingleCallback(m_handler, &ResponseHandler::SetPowerState), + error); +} + + +bool RDMController::GetSelfTest(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->SelfTestEnabled( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::SelfTestEnabled), + error); +} + + +bool RDMController::SetSelfTest(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t self_test; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &self_test))) { + *error = "Argument must be an integer between 0 and 255. Use 0 for OFF " + "and 255 for ALL"; + return false; + } + return m_api->PerformSelfTest( + m_universe, + uid, + sub_device, + self_test, + ola::NewSingleCallback(m_handler, &ResponseHandler::PerformSelfTest), + error); +} + + +bool RDMController::GetSelfTestDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint8_t self_test; + if (args.size() != 1 || (!ola::StringToUInt8(args[0], &self_test))) { + *error = "Argument must be an integer between 0 and 255. Use 0 for OFF " + "and 255 for ALL"; + return false; + } + return m_api->SelfTestDescription( + m_universe, + uid, + sub_device, + self_test, + ola::NewSingleCallback(m_handler, &ResponseHandler::SelfTestDescription), + error); +} + + +bool RDMController::CapturePreset(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + enum { kArgsSize = 4 }; + uint16_t int_args[kArgsSize]; + if (args.size() != kArgsSize) { + *error = "Requires 4 arguments: " + " "; + return false; + } + for (unsigned int i = 0; i < kArgsSize; i++) { + if (!ola::StringToUInt16(args[0], &int_args[i])) { + *error = "Argument must be an integer between 0 and 65535"; + return false; + } + } + + return m_api->CapturePreset( + m_universe, + uid, + sub_device, + int_args[0], + int_args[1], + int_args[2], + int_args[3], + ola::NewSingleCallback(m_handler, &ResponseHandler::CapturePreset), + error); +} + + +bool RDMController::GetPresetPlayback(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + return m_api->PresetPlaybackMode( + m_universe, + uid, + sub_device, + ola::NewSingleCallback(m_handler, &ResponseHandler::PresetPlaybackMode), + error); +} + + +bool RDMController::SetPresetPlayback(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error) { + uint16_t mode; + uint8_t level; + if (args.size() != 2) { + *error = "Requires 2 arguments: [mode] [level]"; + return false; + } + if (!ola::StringToUInt16(args[0], &mode)) { + *error = "First argument must be an integer between 0 and 65535"; + return false; + } + if (!ola::StringToUInt8(args[1], &level)) { + *error = "Second Argument must be an integer between 0 and 255"; + return false; + } + return m_api->SetPresetPlaybackMode( + m_universe, + uid, + sub_device, + mode, + level, + ola::NewSingleCallback(m_handler, + &ResponseHandler::SetPresetPlaybackMode), + error); +} + + +//----------------------------------------------------------------------------- +// Util methods + +bool RDMController::CheckForUInt16(uint16_t *value, + string *error, + const vector &args) { + const string error_message = + "Argument must be a value between 0 - 65535. Use 0x for hex values"; + const string hex_prefix = "0x"; + if (args.size() == 1) { + if (hex_prefix == args[0].substr(0, hex_prefix.size())) { + const string digit = args[0].substr(hex_prefix.size(), + args[0].size() - hex_prefix.size()); + if (ola::HexStringToUInt16(digit, value)) { + return true; + } else { + *error = error_message; + return false; + } + } else if (ola::StringToUInt16(args[0], value)) { + return true; + } + } + *error = error_message; + return false; +} + + +bool RDMController::StringToStatusType( + const string &arg, + ola::rdm::rdm_status_type *status_type) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "none") { + *status_type = ola::rdm::STATUS_NONE; + return true; + } else if (lower_arg == "last") { + *status_type = ola::rdm::STATUS_GET_LAST_MESSAGE; + return true; + } else if (lower_arg == "error") { + *status_type = ola::rdm::STATUS_ERROR; + return true; + } else if (lower_arg == "warning") { + *status_type = ola::rdm::STATUS_WARNING; + return true; + } else if (lower_arg == "advisory") { + *status_type = ola::rdm::STATUS_ADVISORY; + return true; + } + return false; +} + +bool RDMController::StringToLampState(const string &arg, + ola::rdm::rdm_lamp_state *state) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "off") { + *state = ola::rdm::LAMP_OFF; + return true; + } else if (lower_arg == "on") { + *state = ola::rdm::LAMP_ON; + return true; + } else if (lower_arg == "strike") { + *state = ola::rdm::LAMP_STRIKE; + return true; + } else if (lower_arg == "standby") { + *state = ola::rdm::LAMP_STANDBY; + return true; + } + return false; +} + + +bool RDMController::StringToLampMode(const string &arg, + ola::rdm::rdm_lamp_mode *mode) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "off") { + *mode = ola::rdm::LAMP_ON_MODE_OFF; + return true; + } else if (lower_arg == "dmx") { + *mode = ola::rdm::LAMP_ON_MODE_DMX; + return true; + } else if (lower_arg == "on") { + *mode = ola::rdm::LAMP_ON_MODE_ON; + return true; + } else if (lower_arg == "calibration") { + *mode = ola::rdm::LAMP_ON_MODE_AFTER_CAL; + return true; + } + return false; +} + + +bool RDMController::StringToOnOffAuto(const string &arg, uint8_t *mode) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "off") { + *mode = 0; + return true; + } else if (lower_arg == "on") { + *mode = 1; + return true; + } else if (lower_arg == "auto") { + *mode = 2; + return true; + } + return false; +} + +bool RDMController::StringToOnOff(const string &arg, uint8_t *mode) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "off") { + *mode = 0; + return true; + } else if (lower_arg == "on") { + *mode = 1; + return true; + } + return false; +} + + +bool RDMController::StringToWarmCold(const string &arg, uint8_t *mode) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "warm") { + *mode = 1; + return true; + } else if (lower_arg == "cold") { + *mode = 0xff; + return true; + } + return false; +} + + +bool RDMController::StringToPowerState(const string &arg, + ola::rdm::rdm_power_state *mode) { + string lower_arg = arg; + ola::ToLower(&lower_arg); + if (arg == "off") { + *mode = ola::rdm::POWER_STATE_FULL_OFF; + return true; + } else if (lower_arg == "shutdown") { + *mode = ola::rdm::POWER_STATE_SHUTDOWN; + return true; + } else if (lower_arg == "standby") { + *mode = ola::rdm::POWER_STATE_STANDBY; + return true; + } else if (lower_arg == "normal") { + *mode = ola::rdm::POWER_STATE_NORMAL; + return true; + } + return false; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.h b/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.h new file mode 100644 index 0000000..5a507de --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/RDMController.h @@ -0,0 +1,501 @@ +/* + * 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 Library 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. + * + * RDMController.h + * A command line based RDM controller + * Copyright (C) 2010 Simon Newton + */ + +#ifndef SRC_RDMCONTROLLER_H_ +#define SRC_RDMCONTROLLER_H_ + +#include +#include + +#include +#include +#include +#include + +#include "src/RDMHandler.h" + +using std::map; +using std::string; +using std::vector; +using ola::rdm::UID; + + +class RDMController; + +typedef bool (RDMController::*CheckMethod)(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); +typedef bool (RDMController::*ExecuteMethod)(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); +class PidDescriptor { + public: + PidDescriptor(ExecuteMethod get_execute, ExecuteMethod set_execute); + PidDescriptor *AddGetVerify(CheckMethod method); + PidDescriptor *AddSetVerify(CheckMethod method); + + bool Run(RDMController *controller, + const UID &uid, + uint16_t sub_device, + bool set, + uint16_t pid, + const vector ¶ms, + string *error); + + private: + vector m_get_verify; + vector m_set_verify; + ExecuteMethod m_get_execute; + ExecuteMethod m_set_execute; +}; + +class RDMController { + public: + RDMController(unsigned int universe, + ola::rdm::RDMAPI *api, + ResponseHandler *handler): + m_universe(universe), + m_api(api), + m_handler(handler) { + RDMController::LoadMap(); + } + ~RDMController(); + + bool RequestPID(const UID &uid, + uint16_t sub_device, + bool set, + uint16_t pid, + const vector ¶ms, + string *error); + + private: + map m_pid_map; + unsigned int m_universe; + ola::rdm::RDMAPI *m_api; + ResponseHandler *m_handler; + + void LoadMap(); + PidDescriptor* MakeDescriptor(uint16_t pid, + ExecuteMethod get_execute, + ExecuteMethod set_execute); + + // generic methods + bool RootDeviceCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + bool ValidSubDeviceCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + bool ValidBroadcastSubDeviceCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + bool NoArgsCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + + bool NoArgsRootDeviceSetCheck(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + // pid specific methods + bool GetProxiedDeviceCount(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetProxiedDevices(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetCommStatus(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool ClearCommStatus(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetStatusMessage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetStatusIdDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool ClearStatusId(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSubDeviceReporting(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetSubDeviceReporting(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSupportedParameters(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetParameterDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDeviceInfo(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetProductDetailIdList(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDeviceModelDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetManufacturerLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDeviceLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDeviceLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetFactoryDefaults(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool ResetToFactoryDefaults(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLanguageCapabilities(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLanguage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetLanguage(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSoftwareVersionLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetBootSoftwareVersion(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetBootSoftwareVersionLabel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDMXPersonality(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDMXPersonality(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDMXPersonalityDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDMXAddress(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDMXAddress(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSlotInfo(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSlotDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSlotDefaultValues(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSensorDefinition(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSensorValue(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetSensorValue(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool RecordSensors(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDeviceHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDeviceHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLampHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetLampHours(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLampStrikes(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetLampStrikes(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLampState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetLampState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetLampMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetLampMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDevicePowerCycles(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDevicePowerCycles(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDisplayInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDisplayInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetDisplayLevel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetDisplayLevel(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetPanInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetPanInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetTiltInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetTiltInvert(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetPanTiltSwap(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetPanTiltSwap(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetClock(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetClock(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetIdentifyMode(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool IdentifyDevice(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool ResetDevice(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetPowerState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetPowerState(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSelfTest(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetSelfTest(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetSelfTestDescription(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool CapturePreset(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool GetPresetPlayback(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + bool SetPresetPlayback(const UID &uid, + uint16_t sub_device, + const vector &args, + string *error); + + // util methods + bool CheckForUInt16(uint16_t *value, + string *error, + const vector &args); + bool StringToStatusType(const string &arg, + ola::rdm::rdm_status_type *status_type); + bool StringToLampState(const string &arg, + ola::rdm::rdm_lamp_state *state); + bool StringToLampMode(const string &arg, + ola::rdm::rdm_lamp_mode *mode); + bool StringToOnOffAuto(const string &arg, uint8_t *mode); + bool StringToOnOff(const string &arg, uint8_t *mode); + bool StringToWarmCold(const string &arg, uint8_t *mode); + bool StringToPowerState(const string &arg, ola::rdm::rdm_power_state *mode); +}; +#endif // SRC_RDMCONTROLLER_H_ diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.cpp new file mode 100644 index 0000000..784aaaa --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.cpp @@ -0,0 +1,770 @@ +/* + * 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 Library 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. + * + * RDMHandler.h + * This class defines the actions to take for RDM responses. + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "src/RDMHandler.h" + +using std::cout; +using std::endl; +using std::map; +using std::string; +using std::vector; +using ola::rdm::UID; +using ola::network::SelectServer; +using ola::rdm::RDMAPI; +using ola::rdm::ResponseStatus; + + +ResponseHandler::ResponseHandler(RDMAPI *api, SelectServer *ss, + const map &pid_to_name_map) + : m_api(api), + m_ss(ss), + m_exit_code(EX_OK), + m_pid_to_name_map(pid_to_name_map) { +} + + +void ResponseHandler::ProxiedDeviceCount(const ResponseStatus &status, + uint16_t device_count, + bool list_changed) { + if (!CheckForSuccess(status)) + return; + cout << "Proxied Devices: " << device_count << endl; + cout << (list_changed ? "List has changed" : "List hasn't changed") << endl; +} + + +void ResponseHandler::ProxiedDevices(const ResponseStatus &status, + const vector &uids) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = uids.begin(); + cout << "Proxied PIDs" << endl; + for (; iter != uids.end(); ++iter) + cout << *iter << endl; +} + + +void ResponseHandler::CommStatus(const ResponseStatus &status, + uint16_t short_message, + uint16_t length_mismatch, + uint16_t checksum_fail) { + if (!CheckForSuccess(status)) + return; + cout << "Communication Status" << endl; + cout << " Short Messages: " << short_message << endl; + cout << " Length Mismatch: " << length_mismatch << endl; + cout << " Checksum Failed: " << checksum_fail << endl; +} + + +void ResponseHandler::StatusMessages( + const ResponseStatus &status, + const vector &messages) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = messages.begin(); + cout << "Status Messages" << endl; + cout << "------------------" << endl; + for (; iter != messages.end(); ++iter) { + cout << "Sub Device: " << iter->sub_device << endl; + cout << "Status Type: " << ola::rdm::StatusTypeToString(iter->status_type) + << endl; + cout << "Message ID: " << + ola::rdm::StatusMessageIdToString(iter->status_message_id) << endl; + cout << "Value 1: " << iter->value1 << endl; + cout << "Value 2: " << iter->value2 << endl; + cout << "------------------" << endl; + } +} + + +void ResponseHandler::StatusIdDescription(const ResponseStatus &status, + const string &status_id) { + if (!CheckForSuccess(status)) + return; + cout << "Status ID: " << status_id << endl; +} + + +void ResponseHandler::SubDeviceReporting(const ResponseStatus &status, + uint8_t status_type) { + if (!CheckForSuccess(status)) + return; + + cout << "Sub device reporting: "; + switch (status_type) { + case ola::rdm::STATUS_NONE: + cout << "Status None"; + break; + case ola::rdm::STATUS_GET_LAST_MESSAGE: + cout << "Get last message"; + break; + case ola::rdm::STATUS_ADVISORY: + cout << "Advisory"; + break; + case ola::rdm::STATUS_WARNING: + cout << "Warning"; + break; + case ola::rdm::STATUS_ERROR: + cout << "Error"; + break; + case ola::rdm::STATUS_ADVISORY_CLEARED: + cout << "Advisory cleared"; + break; + case ola::rdm::STATUS_WARNING_CLEARED: + cout << "Warning cleared"; + break; + case ola::rdm::STATUS_ERROR_CLEARED: + cout << "Error cleared"; + break; + } + cout << endl; +} + + +void ResponseHandler::SupportedParameters( + const ResponseStatus &status, + const vector ¶meters) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = parameters.begin(); + cout << "Supported Parameters" << endl; + for (; iter != parameters.end(); ++iter) { + cout << " 0x" << std::hex << *iter; + map::const_iterator pid_to_name_iter = + m_pid_to_name_map.find(*iter); + if (pid_to_name_iter != m_pid_to_name_map.end()) + cout << " (" << pid_to_name_iter->second << ")"; + cout << endl; + } +} + + +void ResponseHandler::ParameterDescription( + const ResponseStatus &status, + const ola::rdm::ParameterDescriptor &description) { + if (!CheckForSuccess(status)) + return; + cout << "PID: 0x" << std::hex << description.pid << endl; + cout << "PDL Size: " << static_cast(description.pdl_size) << + endl; + + cout << "Data Type: " << ola::rdm::DataTypeToString(description.data_type) << + endl; + cout << "Command class: "; + switch (description.command_class) { + case ola::rdm::CC_GET: + cout << "Get"; + break; + case ola::rdm::CC_SET: + cout << "Set"; + break; + case ola::rdm::CC_GET_SET: + cout << "Get/Set"; + break; + default: + cout << "Unknown, was 0x" << std::hex << + static_cast(description.command_class); + } + cout << endl; + cout << "Unit: " << ola::rdm::UnitToString(description.unit) << endl; + cout << "Prefix: " << ola::rdm::PrefixToString(description.prefix) << endl; + cout << "Min Value: " << description.min_value << endl; + cout << "Default Value: " << description.default_value << endl; + cout << "Max Value: " << description.max_value << endl; + cout << "Description: " << description.description << endl; +} + + +void ResponseHandler::DeviceInfo( + const ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device_info) { + if (!CheckForSuccess(status)) + return; + + cout << "Device Info" << endl; + cout << "RDM Protocol Version: " << device_info.protocol_version_high << + "." << device_info.protocol_version_low << endl; + cout << "Device Model: 0x" << std::hex << device_info.device_model << endl; + cout << "Product Category: " << + ola::rdm::ProductCategoryToString(device_info.product_category) << endl; + cout << "Software Version: 0x" << std::hex << device_info.software_version + << endl; + cout << "DMX Footprint: " << std::dec << device_info.dmx_footprint << endl; + cout << "DMX Personality: " << + static_cast(device_info.current_personality) << " / " << + static_cast(device_info.personaility_count) << endl; + cout << "DMX Start Address: "; + if (device_info.dmx_start_address > DMX_UNIVERSE_SIZE) { + cout << "N/A"; + } else { + cout << std::dec << + static_cast(device_info.dmx_start_address); + } + cout << endl; + cout << "# of Subdevices: " << device_info.sub_device_count << endl; + cout << "Sensor Count: " << static_cast(device_info.sensor_count) << + endl; +} + + +void ResponseHandler::ProductDetailIdList( + const ResponseStatus &status, + const vector &ids) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = ids.begin(); + cout << "Product Detail IDs" << endl; + for (; iter != ids.end(); ++iter) { + cout << " " << ola::rdm::ProductDetailToString(*iter) << endl; + } +} + + +void ResponseHandler::DeviceModelDescription(const ResponseStatus &status, + const string &description) { + if (!CheckForSuccess(status)) + return; + cout << "Device Model Description: " << description << endl; +} + + +void ResponseHandler::ManufacturerLabel(const ResponseStatus &status, + const string &label) { + if (!CheckForSuccess(status)) + return; + cout << "Manufacturer Label: " << label << endl; +} + + +void ResponseHandler::DeviceLabel(const ResponseStatus &status, + const string &label) { + if (!CheckForSuccess(status)) + return; + cout << "Device Label: " << label << endl; +} + + +void ResponseHandler::FactoryDefaults(const ResponseStatus &status, + bool using_defaults) { + if (!CheckForSuccess(status)) + return; + cout << "Using Factory Defaults: " << (using_defaults ? "Yes" : "No") << + endl; +} + + +void ResponseHandler::LanguageCapabilities(const ResponseStatus &status, + const vector &langs) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = langs.begin(); + cout << "Supported Languages" << endl; + for (; iter != langs.end(); ++iter) { + cout << " " << *iter << endl; + } +} + + +void ResponseHandler::Language(const ResponseStatus &status, + const string &language) { + if (!CheckForSuccess(status)) + return; + cout << "Current language: " << language << endl; +} + + +void ResponseHandler::SoftwareVersionLabel(const ResponseStatus &status, + const string &label) { + if (!CheckForSuccess(status)) + return; + cout << "Software Version Label: " << label << endl; +} + + +void ResponseHandler::BootSoftwareVersion(const ResponseStatus &status, + uint32_t version) { + if (!CheckForSuccess(status)) + return; + cout << "Boot Software Version: 0x" << std::hex << version << endl; +} + + +void ResponseHandler::BootSoftwareVersionLabel(const ResponseStatus &status, + const string &label) { + if (!CheckForSuccess(status)) + return; + cout << "Boot Software Version Label: " << label << endl; +} + + +void ResponseHandler::DMXPersonality(const ResponseStatus &status, + uint8_t current_personality, + uint8_t personality_count) { + if (!CheckForSuccess(status)) + return; + cout << "Current Personality: " << static_cast(current_personality) << + endl; + cout << "Personality Count: " << static_cast(personality_count) << endl; +} + + +void ResponseHandler::DMXPersonalityDescription( + const ResponseStatus &status, + uint8_t personality, + uint16_t slots_required, + const string &label) { + if (!CheckForSuccess(status)) + return; + cout << "Personality #: " << static_cast(personality) << endl; + cout << "Slots required: " << slots_required << endl; + cout << "Description: " << label << endl; +} + + +void ResponseHandler::DMXAddress(const ResponseStatus &status, + uint16_t start_address) { + if (!CheckForSuccess(status)) + return; + cout << "DMX Start Address: "; + if (start_address > DMX_UNIVERSE_SIZE) { + cout << "N/A"; + } else { + cout << std::dec << + static_cast(start_address); + } + cout << endl; +} + + +void ResponseHandler::SlotInfo( + const ResponseStatus &status, + const vector &slots) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = slots.begin(); + for (; iter != slots.end(); ++iter) { + cout << "Slot " << iter->slot_offset << endl; + cout << " "; + cout << "Slot Type: " << + ola::rdm::SlotInfoToString(iter->slot_type, iter->slot_label) << endl; + } +} + + +void ResponseHandler::SlotDescription(const ResponseStatus &status, + uint16_t slot_offset, + const string &description) { + if (!CheckForSuccess(status)) + return; + cout << "Slot #: " << slot_offset << endl; + cout << "Description: " << description << endl; +} + + +void ResponseHandler::SlotDefaultValues( + const ResponseStatus &status, + const vector &defaults) { + if (!CheckForSuccess(status)) + return; + vector::const_iterator iter = defaults.begin(); + cout << "Default Slot Values" << endl; + for (; iter != defaults.end(); ++iter) { + cout << " Slot " << iter->slot_offset << ", default " << + static_cast(iter->default_value) << endl; + } +} + + +void ResponseHandler::SensorDefinition( + const ResponseStatus &status, + const ola::rdm::SensorDescriptor &descriptor) { + if (!CheckForSuccess(status)) + return; + cout << "Sensor #: " << static_cast(descriptor.sensor_number) << endl; + cout << "Type: " << ola::rdm::SensorTypeToString(descriptor.type) << endl; + cout << "Unit: " << ola::rdm::UnitToString(descriptor.unit) << endl; + cout << "Prefix: " << ola::rdm::PrefixToString(descriptor.prefix) << endl; + cout << "Range: " << descriptor.range_min << " - " << descriptor.range_max + << endl; + cout << "Normal: " << descriptor.normal_min << " - " << descriptor.normal_max + << endl; + cout << "Recording support: " << + ((descriptor.recorded_value_support & 0x2) ? "Highest/Lowest" : "") << + ((descriptor.recorded_value_support == 0x3) ? "/" : "") << + ((descriptor.recorded_value_support & 0x1) ? "Snapshot" : "") << + endl; + cout << "Description: " << descriptor.description << endl; +} + + +void ResponseHandler::SensorValue( + const ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &descriptor) { + if (!CheckForSuccess(status)) + return; + cout << "Sensor #: " << static_cast(descriptor.sensor_number) << endl; + cout << "Present Value: " << descriptor.present_value << endl; + cout << "Lowest Value: " << descriptor.lowest << endl; + cout << "Highest Value: " << descriptor.highest << endl; + cout << "Recorded Value: " << descriptor.recorded << endl; +} + + +void ResponseHandler::DeviceHours(const ResponseStatus &status, + uint32_t hours) { + if (!CheckForSuccess(status)) + return; + cout << "Device Hours: " << hours << endl; +} + + +void ResponseHandler::LampHours(const ResponseStatus &status, + uint32_t hours) { + if (!CheckForSuccess(status)) + return; + cout << "Lamp Hours: " << hours << endl; +} + + +void ResponseHandler::LampStrikes(const ResponseStatus &status, + uint32_t strikes) { + if (!CheckForSuccess(status)) + return; + cout << "Lamp Strikes: " << strikes << endl; +} + +void ResponseHandler::LampState(const ResponseStatus &status, + uint8_t state) { + if (!CheckForSuccess(status)) + return; + cout << "Lamp State: " << ola::rdm::LampStateToString(state) << endl; +} + +void ResponseHandler::LampMode(const ResponseStatus &status, uint8_t mode) { + if (!CheckForSuccess(status)) + return; + cout << "Lamp Mode: " << ola::rdm::LampModeToString(mode) << endl; +} + +void ResponseHandler::DevicePowerCycles(const ResponseStatus &status, + uint32_t power_cycles) { + if (!CheckForSuccess(status)) + return; + cout << "Device power cycles: " << power_cycles << endl; +} + +void ResponseHandler::DisplayInvert(const ResponseStatus &status, + uint8_t invert_mode) { + if (!CheckForSuccess(status)) + return; + cout << "Display Invert: "; + switch (invert_mode) { + case 0: + cout << "Off"; + break; + case 1: + cout << "On"; + break; + case 2: + cout << "Auto"; + break; + default: + cout << "Unknown, was " << static_cast(invert_mode); + } + cout << endl; +} + +void ResponseHandler::DisplayLevel(const ResponseStatus &status, + uint8_t level) { + if (!CheckForSuccess(status)) + return; + cout << "Display level: " << static_cast(level) << endl; +} + +void ResponseHandler::PanInvert(const ResponseStatus &status, + uint8_t inverted) { + if (!CheckForSuccess(status)) + return; + cout << "Pan Invert: " << (inverted ? "Yes" : "No") << endl; +} + +void ResponseHandler::TiltInvert(const ResponseStatus &status, + uint8_t inverted) { + if (!CheckForSuccess(status)) + return; + cout << "Tilt Invert: " << (inverted ? "Yes" : "No") << endl; +} + +void ResponseHandler::PanTiltSwap(const ResponseStatus &status, + uint8_t inverted) { + if (!CheckForSuccess(status)) + return; + cout << "Pan/Tilt Swap: " << (inverted ? "Yes" : "No") << endl; +} + +void ResponseHandler::Clock(const ResponseStatus &status, + const ola::rdm::ClockValue &clock) { + if (!CheckForSuccess(status)) + return; + cout << "Current time:" << endl; + cout << "d/m/y: " << static_cast(clock.day) << "/" << + static_cast(clock.month) << "/" << + static_cast(clock.year) << ", " << static_cast(clock.hour) << + ":" << static_cast(clock.minute) << ":" << + static_cast(clock.second) << endl; +} + +void ResponseHandler::IdentifyMode(const ResponseStatus &status, bool mode) { + if (!CheckForSuccess(status)) + return; + cout << (mode ? "Identify on" : "Identify off") << endl; +} + + +void ResponseHandler::PowerState(const ResponseStatus &status, + uint8_t power_state) { + if (!CheckForSuccess(status)) + return; + cout << "Power State: " << ola::rdm::PowerStateToString(power_state) << endl; +} + + +void ResponseHandler::SelfTestEnabled(const ResponseStatus &status, + bool is_enabled) { + if (!CheckForSuccess(status)) + return; + cout << "Self Test Mode: " << (is_enabled ? "On" : "Off") << endl; +} + + +void ResponseHandler::SelfTestDescription(const ResponseStatus &status, + uint8_t self_test_number, + const string &description) { + if (!CheckForSuccess(status)) + return; + cout << "Self Test Number: " << static_cast(self_test_number) << endl; + cout << description << endl; +} + + +void ResponseHandler::PresetPlaybackMode(const ResponseStatus &status, + uint16_t preset_mode, + uint8_t level) { + if (!CheckForSuccess(status)) + return; + cout << "Preset Mode: "; + if (preset_mode == ola::rdm::PRESET_PLAYBACK_OFF) + cout << "Off (DMX Input)"; + else if (preset_mode == ola::rdm::PRESET_PLAYBACK_ALL) + cout << "All (plays scenes in a sequence)"; + else + cout << static_cast(preset_mode); + cout << endl; + cout << "Level: " << static_cast(level) << endl; +} + +void ResponseHandler::ClearCommStatus(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::ClearStatusId(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetSubDeviceReporting(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetDeviceLabel(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::ResetToFactoryDefaults(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetLanguage(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetDMXPersonality(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetDMXAddress(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetSensorValue( + const ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &descriptor) { + if (!CheckForSuccess(status)) + return; + // The labpack returns a sensor definition even when it nacks. This behaviour + // isn't guaranteed however. + cout << "Sensor #: " << static_cast(descriptor.sensor_number) << endl; + cout << "Present Value: " << descriptor.present_value << endl; + cout << "Lowest Value: " << descriptor.lowest << endl; + cout << "Highest Value: " << descriptor.highest << endl; + cout << "Recorded Value: " << descriptor.recorded << endl; +} + + +void ResponseHandler::RecordSensors(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetDeviceHours(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetLampHours(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetLampStrikes(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetDevicePowerCycles(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetLampState(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetLampMode(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetDisplayInvert(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetDisplayLevel(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetPanInvert(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetPanTiltSwap(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetTiltInvert(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::IdentifyDevice(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::SetClock(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::ResetDevice(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetPowerState(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::PerformSelfTest(const ResponseStatus &status) { + CheckForSuccess(status); +} + +void ResponseHandler::CapturePreset(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +void ResponseHandler::SetPresetPlaybackMode(const ResponseStatus &status) { + CheckForSuccess(status); +} + + +/* + * Check if a request completed sucessfully, if not display the errors. + */ +bool ResponseHandler::CheckForSuccess(const ResponseStatus &status) { + // always terminate for now + m_ss->Terminate(); + switch (status.ResponseType()) { + case ResponseStatus::TRANSPORT_ERROR: + std::cerr << status.Error() << endl; + m_exit_code = EX_SOFTWARE; + return false; + case ResponseStatus::BROADCAST_REQUEST: + return false; + case ResponseStatus::REQUEST_NACKED: + cout << "Request was NACKED with code: "; + cout << ola::rdm::NackReasonToString(status.NackReason()) << endl; + cout << endl; + return false; + case ResponseStatus::MALFORMED_RESPONSE: + std::cerr << status.Error() << endl; + m_exit_code = EX_SOFTWARE; + return false; + case ResponseStatus::VALID_RESPONSE: + return true; + default: + cout << "Unknown response status " << + static_cast(status.ResponseType()); + return false; + } +} +// End implementation diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.h b/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.h new file mode 100644 index 0000000..baf3a5a --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/RDMHandler.h @@ -0,0 +1,177 @@ +/* + * 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 Library 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. + * + * RDMHandler.h + * The interface for a RDM Handler class. + * This class defines the actions to take for RDM responses. + * Copyright (C) 2010 Simon Newton + */ + +#ifndef SRC_RDMHANDLER_H_ +#define SRC_RDMHANDLER_H_ + +#include +#include +#include +#include + +#include +#include +#include + +using ola::network::SelectServer; +using ola::rdm::RDMAPI; +using ola::rdm::ResponseStatus; +using ola::rdm::UID; +using std::map; +using std::string; +using std::vector; + +class ResponseHandler: public ola::rdm::QueuedMessageHandler { + public: + ResponseHandler(RDMAPI *api, SelectServer *ss, + const map &pid_to_name_map); + + void ProxiedDeviceCount(const ResponseStatus &status, + uint16_t device_count, + bool list_changed); + void ProxiedDevices(const ResponseStatus &status, + const vector &uids); + void CommStatus(const ResponseStatus &status, + uint16_t short_message, + uint16_t length_mismatch, + uint16_t checksum_fail); + void StatusMessages(const ResponseStatus &status, + const vector &messages); + void StatusIdDescription(const ResponseStatus &status, + const string &status_id); + void SubDeviceReporting(const ResponseStatus &status, + uint8_t status_type); + void SupportedParameters(const ResponseStatus &status, + const vector ¶meters); + void ParameterDescription( + const ResponseStatus &status, + const ola::rdm::ParameterDescriptor &description); + void DeviceInfo(const ResponseStatus &status, + const ola::rdm::DeviceDescriptor &device_info); + void ProductDetailIdList(const ResponseStatus &status, + const vector &ids); + void DeviceModelDescription(const ResponseStatus &status, + const string &description); + void ManufacturerLabel(const ResponseStatus &status, + const string &label); + void DeviceLabel(const ResponseStatus &status, + const string &label); + void FactoryDefaults(const ResponseStatus &status, + bool using_defaults); + void LanguageCapabilities(const ResponseStatus &status, + const vector &langs); + void Language(const ResponseStatus &status, + const string &language); + void SoftwareVersionLabel(const ResponseStatus &status, + const string &label); + void BootSoftwareVersion(const ResponseStatus &status, + uint32_t version); + void BootSoftwareVersionLabel(const ResponseStatus &status, + const string &label); + void DMXPersonality(const ResponseStatus &status, + uint8_t current_personality, + uint8_t personality_count); + void DMXPersonalityDescription(const ResponseStatus &status, + uint8_t personality, + uint16_t slots_requires, + const string &label); + void DMXAddress(const ResponseStatus &status, + uint16_t start_address); + void SlotInfo(const ResponseStatus &status, + const vector &slots); + void SlotDescription(const ResponseStatus &status, + uint16_t slot_offset, + const string &description); + void SlotDefaultValues(const ResponseStatus &status, + const vector &defaults); + void SensorDefinition(const ResponseStatus &status, + const ola::rdm::SensorDescriptor &descriptor); + void SensorValue(const ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &descriptor); + void DeviceHours(const ResponseStatus &status, uint32_t hours); + void LampHours(const ResponseStatus &status, uint32_t hours); + void LampStrikes(const ResponseStatus &status, uint32_t hours); + void LampState(const ResponseStatus &status, uint8_t state); + void LampMode(const ResponseStatus &status, uint8_t mode); + void DevicePowerCycles(const ResponseStatus &status, uint32_t hours); + void DisplayInvert(const ResponseStatus &status, uint8_t invert_mode); + void DisplayLevel(const ResponseStatus &status, uint8_t level); + void PanInvert(const ResponseStatus &status, uint8_t inverted); + void TiltInvert(const ResponseStatus &status, uint8_t inverted); + void PanTiltSwap(const ResponseStatus &status, uint8_t inverted); + void Clock(const ResponseStatus &status, + const ola::rdm::ClockValue &clock); + void IdentifyMode(const ResponseStatus &status, bool mode); + void PowerState(const ResponseStatus &status, + uint8_t power_state); + void SelfTestEnabled(const ResponseStatus &status, + bool is_enabled); + void SelfTestDescription(const ResponseStatus &status, + uint8_t self_test_number, + const string &description); + void PresetPlaybackMode(const ResponseStatus &status, + uint16_t preset_mode, + uint8_t level); + + // Define these here so we can use the same object to handle non-queued + // messages + void ClearCommStatus(const ResponseStatus &status); + void ClearStatusId(const ResponseStatus &status); + void SetSubDeviceReporting(const ResponseStatus &status); + void SetDeviceLabel(const ResponseStatus &status); + void ResetToFactoryDefaults(const ResponseStatus &status); + void SetLanguage(const ResponseStatus &status); + void SetDMXPersonality(const ResponseStatus &status); + void SetDMXAddress(const ResponseStatus &status); + void SetSensorValue(const ResponseStatus &status, + const ola::rdm::SensorValueDescriptor &descriptor); + void RecordSensors(const ResponseStatus &status); + void SetDeviceHours(const ResponseStatus &status); + void SetLampHours(const ResponseStatus &status); + void SetLampStrikes(const ResponseStatus &status); + void SetDevicePowerCycles(const ResponseStatus &status); + void SetLampState(const ResponseStatus &status); + void SetLampMode(const ResponseStatus &status); + void SetDisplayInvert(const ResponseStatus &status); + void SetDisplayLevel(const ResponseStatus &status); + void SetPanInvert(const ResponseStatus &status); + void SetPanTiltSwap(const ResponseStatus &status); + void SetTiltInvert(const ResponseStatus &status); + void SetClock(const ResponseStatus &status); + void IdentifyDevice(const ResponseStatus &status); + void ResetDevice(const ResponseStatus &status); + void SetPowerState(const ResponseStatus &status); + void PerformSelfTest(const ResponseStatus &status); + void CapturePreset(const ResponseStatus &status); + void SetPresetPlaybackMode(const ResponseStatus &status); + + // this returns the exit code once all is said and done + uint8_t ExitCode() const { return m_exit_code; } + + private: + RDMAPI *m_api; + SelectServer *m_ss; + uint8_t m_exit_code; + map m_pid_to_name_map; + + bool CheckForSuccess(const ResponseStatus &status); +}; +#endif // SRC_RDMHANDLER_H_ diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-artnet.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-artnet.cpp new file mode 100644 index 0000000..a96aed2 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-artnet.cpp @@ -0,0 +1,208 @@ +/* + * 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 Library 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. + * + * ola-artnet.cpp + * Configure an ArtNet device + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include "src/OlaConfigurator.h" + +using std::cout; +using std::endl; +using std::string; + +typedef struct { + string command; // argv[0] + int device_id; // device id + bool help; // help + bool has_name; + string name; // short name + bool has_long_name; + string long_name; // long name + bool has_subnet; + int subnet; // the subnet +} options; + + +/* + * A class that configures Artnet devices + */ +class ArtnetConfigurator: public OlaConfigurator { + public: + explicit ArtnetConfigurator(const options &opts): + OlaConfigurator(opts.device_id, ola::OLA_PLUGIN_ARTNET), + m_options(opts) {} + void HandleConfigResponse(const string &reply, const string &error); + void SendConfigRequest(); + private: + void DisplayOptions(const ola::plugin::artnet::OptionsReply &reply); + options m_options; +}; + + +/* + * Handle the device config reply + */ +void ArtnetConfigurator::HandleConfigResponse(const string &reply, + const string &error) { + Terminate(); + if (!error.empty()) { + cout << error << endl; + return; + } + ola::plugin::artnet::Reply reply_pb; + if (!reply_pb.ParseFromString(reply)) { + cout << "Protobuf parsing failed" << endl; + return; + } + if (reply_pb.type() == ola::plugin::artnet::Reply::ARTNET_OPTIONS_REPLY && + reply_pb.has_options()) { + DisplayOptions(reply_pb.options()); + return; + } + cout << "Invalid response type or missing options field" << endl; +} + + +/* + * Send a get parameters request + * @param device_id the device to send the request to + * @param client the OLAClient + */ +void ArtnetConfigurator::SendConfigRequest() { + ola::plugin::artnet::Request request; + request.set_type(ola::plugin::artnet::Request::ARTNET_OPTIONS_REQUEST); + ola::plugin::artnet::OptionsRequest *options = request.mutable_options(); + + if (m_options.has_name) + options->set_short_name(m_options.name); + if (m_options.has_long_name) + options->set_long_name(m_options.long_name); + if (m_options.has_subnet) + options->set_subnet(m_options.subnet); + SendMessage(request); +} + + +/* + * Display the widget parameters + */ +void ArtnetConfigurator::DisplayOptions( + const ola::plugin::artnet::OptionsReply &reply) { + cout << "Name: " << reply.short_name() << endl; + cout << "Long Name: " << reply.long_name() << endl; + cout << "Subnet: " << reply.subnet() << endl; +} + + +/* + * Parse our cmd line options + */ +int ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"dev", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"long_name", required_argument, 0, 'l'}, + {"name", required_argument, 0, 'n'}, + {"subnet", required_argument, 0, 's'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "d:hl:n:s:v", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->device_id = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'l': + opts->long_name = optarg; + opts->has_long_name = true; + break; + case 'n': + opts->name = optarg; + opts->has_name = true; + break; + case 's': + opts->subnet = atoi(optarg); + opts->has_subnet = true; + break; + case '?': + break; + } + } + return 0; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(const options &opts) { + cout << "Usage: " << opts.command << + " -d -n -l -s \n\n" + "Configure ArtNet Devices managed by OLA.\n\n" + " -h, --help Display this help message and exit.\n" + " -l, --long_name Set the long name of the ArtNet device\n" + " -n, --name Set the name of the ArtNet device\n" + " -s, --subnet Set the subnet of the ArtNet device\n" << + endl; + exit(0); +} + + +/* + * The main function + */ +int main(int argc, char*argv[]) { + options opts; + opts.command = argv[0]; + opts.device_id = -1; + opts.help = false; + opts.has_name = false; + opts.has_long_name = false; + opts.has_subnet = false; + + ParseOptions(argc, argv, &opts); + + if (opts.help || opts.device_id < 0) + DisplayHelpAndExit(opts); + + ArtnetConfigurator configurator(opts); + if (!configurator.Setup()) { + cout << "error: " << strerror(errno) << endl; + exit(1); + } + + configurator.Run(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-client.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-client.cpp new file mode 100644 index 0000000..7a467ad --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-client.cpp @@ -0,0 +1,844 @@ +/* + * 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 Library 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. + * + * ola-client.cpp + * The multi purpose ola client. + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + +using std::cout; +using std::endl; +using std::setw; +using std::string; +using std::vector; +using ola::OlaPlugin; +using ola::OlaUniverse; +using ola::OlaDevice; +using ola::OlaInputPort; +using ola::OlaOutputPort; +using ola::SimpleClient; +using ola::OlaClient; +using ola::network::SelectServer; + +static const int INVALID_VALUE = -1; + +/* + * The mode is determined by the name in which we were called + */ +typedef enum { + DEVICE_INFO, + DEVICE_PATCH, + PLUGIN_INFO, + UNIVERSE_INFO, + UNIVERSE_NAME, + UNI_MERGE, + SET_DMX, + SET_PORT_PRIORITY, +} mode; + + +typedef struct { + mode m; // mode + int uni; // universe id + unsigned int plugin_id; // plugin id + bool help; // show the help + int device_id; // device id + int port_id; // port id + ola::PortDirection port_direction; // input or output + ola::PatchAction patch_action; // patch or unpatch + OlaUniverse::merge_mode merge_mode; // the merge mode + string cmd; // argv[0] + string uni_name; // universe name + string dmx; // dmx string + ola::port_priority_mode priority_mode; // port priority mode + uint8_t priority_value; // port priority value +} options; + + +/* + * The observer class which repsonds to events + */ +class Observer: public ola::OlaClientObserver { + public: + Observer(options *opts, SelectServer *ss): m_opts(opts), m_ss(ss) {} + + void Plugins(const vector &plugins, const string &error); + void PluginDescription(ola::ola_plugin_id plugin_id, + const string &description, + const string &error); + void Devices(const vector &devices, const string &error); + void Universes(const vector &universes, const string &error); + void PatchComplete(unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + const string &error); + void UniverseNameComplete(unsigned int universe, + const string &error); + void UniverseMergeModeComplete(unsigned int universe, + const string &error); + void SendDmxComplete(unsigned int universe, + const string &error); + void SetPortPriorityComplete(unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + const string &error); + + private: + options *m_opts; + SelectServer *m_ss; + + template + void ListPorts(const vector &ports, bool input); +}; + + +/* + * This is called when we recieve universe results from the client + * @param universes a vector of OlaUniverses + */ +void Observer::Universes(const vector &universes, + const string &error) { + vector::const_iterator iter; + + if (!error.empty()) { + cout << error << endl; + m_ss->Terminate(); + return; + } + + cout << setw(5) << "Id" << "\t" << setw(30) << "Name" << "\t\tMerge Mode" << + endl; + cout << "----------------------------------------------------------" << endl; + + for (iter = universes.begin(); iter != universes.end(); ++iter) { + cout << setw(5) << iter->Id() << "\t" << setw(30) << iter->Name() << "\t\t" + << (iter->MergeMode() == OlaUniverse::MERGE_HTP ? "HTP" : "LTP") << endl; + } + cout << "----------------------------------------------------------" << endl; + m_ss->Terminate(); +} + + +/* + * @params plugins a vector of OlaPlugins + */ +void Observer::Plugins(const vector &plugins, + const string &error) { + vector::const_iterator iter; + + if (!error.empty()) { + cout << error << endl; + m_ss->Terminate(); + return; + } + + cout << setw(5) << "Id" << "\tPlugin Name" << endl; + cout << "--------------------------------------" << endl; + for (iter = plugins.begin(); iter != plugins.end(); ++iter) + cout << setw(5) << iter->Id() << "\t" << iter->Name() << endl; + cout << "--------------------------------------" << endl; + m_ss->Terminate(); +} + + +/* + * Print a plugin description + */ +void Observer::PluginDescription(ola::ola_plugin_id plugin_id, + const string &description, + const string &error) { + if (!error.empty()) + cout << error << endl; + else + cout << description << endl; + m_ss->Terminate(); + return; +} + + +/* + * @param devices a vector of OlaDevices + */ +void Observer::Devices(const vector &devices, const string &error) { + vector::const_iterator iter; + + if (!error.empty()) { + cout << error << endl; + m_ss->Terminate(); + return; + } + + for (iter = devices.begin(); iter != devices.end(); ++iter) { + cout << "Device " << iter->Alias() << ": " << iter->Name() << endl; + vector input_ports = iter->InputPorts(); + ListPorts(input_ports, true); + vector output_ports = iter->OutputPorts(); + ListPorts(output_ports, false); + } + m_ss->Terminate(); +} + + +/* + * Called when the patch command completes. + */ +void Observer::PatchComplete(unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + const string &error) { + if (!error.empty()) + cout << error << endl; + m_ss->Terminate(); +} + +/* + * Called when the name command completes. + */ +void Observer::UniverseNameComplete(unsigned int universe, + const string &error) { + if (!error.empty()) + cout << error << endl; + m_ss->Terminate(); +} + + +void Observer::UniverseMergeModeComplete(unsigned int universe, + const string &error) { + if (!error.empty()) + cout << error << endl; + m_ss->Terminate(); +} + + +void Observer::SendDmxComplete(unsigned int universe, + const string &error) { + if (!error.empty()) + cout << error << endl; + m_ss->Terminate(); +} + +void Observer::SetPortPriorityComplete(unsigned int device_alias, + unsigned int port, + ola::PortDirection port_direction, + const string &error) { + if (!error.empty()) + cout << error << endl; + m_ss->Terminate(); +} + + +template +void Observer::ListPorts(const vector &ports, bool input) { + typename vector::const_iterator port_iter; + for (port_iter = ports.begin(); port_iter != ports.end(); ++port_iter) { + cout << " port " << port_iter->Id() << ", "; + + if (input) + cout << "IN"; + else + cout << "OUT"; + + cout << " " << port_iter->Description(); + + switch (port_iter->PriorityCapability()) { + case ola::CAPABILITY_STATIC: + cout << ", priority " << static_cast(port_iter->Priority()); + break; + case ola::CAPABILITY_FULL: + cout << ", priority "; + if (port_iter->PriorityMode() == ola::PRIORITY_MODE_INHERIT) + cout << "inherited"; + else + cout << "overide " << static_cast(port_iter->Priority()); + break; + default: + break; + } + + if (port_iter->IsActive()) + cout << ", patched to universe " << port_iter->Universe(); + cout << endl; + } +} + + +/* + * Init options + */ +void InitOptions(options *opts) { + opts->m = DEVICE_INFO; + opts->uni = INVALID_VALUE; + opts->plugin_id = ola::OLA_PLUGIN_ALL; + opts->help = false; + opts->patch_action = ola::PATCH; + opts->port_id = INVALID_VALUE; + opts->port_direction = ola::OUTPUT_PORT; + opts->device_id = INVALID_VALUE; + opts->merge_mode = OlaUniverse::MERGE_HTP; + opts->priority_mode = ola::PRIORITY_MODE_INHERIT; + opts->priority_value = 0; +} + + +/* + * Decide what mode we're running in + */ +void SetMode(options *opts) { + string::size_type pos = opts->cmd.find_last_of("/"); + + if (pos != string::npos) + opts->cmd = opts->cmd.substr(pos + 1); + + if (opts->cmd == "ola_plugin_info") + opts->m = PLUGIN_INFO; + else if (opts->cmd == "ola_patch") + opts->m = DEVICE_PATCH; + else if (opts->cmd == "ola_uni_info") + opts->m = UNIVERSE_INFO; + else if (opts->cmd == "ola_uni_name") + opts->m = UNIVERSE_NAME; + else if (opts->cmd == "ola_uni_merge") + opts->m = UNI_MERGE; + else if (opts->cmd == "ola_set_dmx") + opts->m = SET_DMX; + else if (opts->cmd == "ola_set_priority") + opts->m = SET_PORT_PRIORITY; +} + + +/* + * parse our cmd line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"dmx", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"ltp", no_argument, 0, 'l'}, + {"name", required_argument, 0, 'n'}, + {"plugin_id", required_argument, 0, 'p'}, + {"universe", required_argument, 0, 'u'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "ld:n:u:p:hv", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->dmx = optarg; + break; + case 'h': + opts->help = true; + break; + case 'l': + opts->merge_mode = OlaUniverse::MERGE_LTP; + break; + case 'n': + opts->uni_name = optarg; + break; + case 'p': + opts->plugin_id = atoi(optarg); + break; + case 'u': + opts->uni = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } +} + + +/* + * parse our cmd line options for the patch command + */ +int ParsePatchOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"device", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"input", no_argument, 0, 'i'}, + {"patch", no_argument, 0, 'a'}, + {"port", required_argument, 0, 'p'}, + {"universe", required_argument, 0, 'u'}, + {"unpatch", no_argument, 0, 'r'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "ard:p:u:hi", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'a': + opts->patch_action = ola::PATCH; + break; + case 'd': + opts->device_id = atoi(optarg); + break; + case 'p': + opts->port_id = atoi(optarg); + break; + case 'r': + opts->patch_action = ola::UNPATCH; + break; + case 'u': + opts->uni = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'i': + opts->port_direction = ola::INPUT_PORT; + break; + case '?': + break; + default: + break; + } + } + return 0; +} + + +/* + * parse our cmd line options for the set priority command + */ +int ParseSetPriorityOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"device", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"input", no_argument, 0, 'i'}, + {"port", required_argument, 0, 'p'}, + {"override", required_argument, 0, 'o'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "d:p:o:hi", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->device_id = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'i': + opts->port_direction = ola::INPUT_PORT; + break; + case 'o': + opts->priority_mode = ola::PRIORITY_MODE_OVERRIDE; + opts->priority_value = atoi(optarg); + break; + case 'p': + opts->port_id = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } + return 0; +} + + +/* + * help message for device info + */ +void DisplayDeviceInfoHelp(const options &opts) { + cout << "Usage: " << opts.cmd << " [--plugin_id ]\n" + "\n" + "Show information on the devices loaded by olad.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -p, --plugin_id Show only devices owned by this plugin.\n" + << endl; +} + + +/* + * Display the Patch help + */ +void DisplayPatchHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " [--patch | --unpatch] --device --port [--universe ]\n" + "\n" + "Control ola port <-> universe mappings.\n" + "\n" + " -a, --patch Patch this port (default).\n" + " -d, --device Id of device to patch.\n" + " -h, --help Display this help message and exit.\n" + " -p, --port Id of the port to patch.\n" + " -r, --unpatch Unpatch this port.\n" + " -i, --input Patch the input port (default is output).\n" + " -u, --universe Id of the universe to patch to (default 0).\n" + << endl; +} + + +/* + * help message for plugin info + */ +void DisplayPluginInfoHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " [--plugin_id ]\n" + "\n" + "Get info on the plugins loaded by olad. Called without arguments this will\n" + "display the plugins loaded by olad. When used with --plugin_id this will \n" + "display the specified plugin's description.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -p, --plugin_id Id of the plugin to fetch the description of\n" + << endl; +} + + +/* + * help message for uni info + */ +void DisplayUniverseInfoHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + "\n" + "Shows info on the active universes in use.\n" + "\n" + " -h, --help Display this help message and exit.\n" + << endl; +} + + +/* + * Help message for set uni name + */ +void DisplayUniverseNameHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " --name --universe \n" + "\n" + "Set a name for the specified universe\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -n, --name Name for the universe.\n" + " -u, --universe Id of the universe to name.\n" + << endl; +} + + +/* + * Help message for set uni merge mode + */ +void DisplayUniverseMergeHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " --universe [ --ltp]\n" + "\n" + "Change the merge mode for the specified universe. Without --ltp it will\n" + "revert to HTP mode.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -l, --ltp Change to ltp mode.\n" + " -u, --universe Id of the universe to change.\n" + << endl; +} + + + +/* + * Help message for set dmx + */ +void DisplaySetDmxHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " --universe --dmx 0,255,0,255\n" + "\n" + "Sets the DMX values for a universe.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -u, --universe Universe number.\n" + " -d, --dmx Comma separated DMX values.\n" + << endl; +} + +/* + * Display the Patch help + */ +void DisplaySetPriorityHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " --device --port [--override ]\n" + "\n" + "Set a port's priority, without the --override flag this will set the port\n" + "to inherit mode.\n" + "\n" + " -d, --device Id of device to patch.\n" + " -h, --help Display this help message and exit.\n" + " -i, --input Set an input port\n" + " -o, --override Set the port priority to a static value.\n" + " -p, --port Id of the port to patch.\n" + << endl; +} + + + +/* + * Display the help message + */ +void DisplayHelpAndExit(const options &opts) { + switch (opts.m) { + case DEVICE_INFO: + DisplayDeviceInfoHelp(opts); + break; + case DEVICE_PATCH: + DisplayPatchHelp(opts); + break; + case PLUGIN_INFO: + DisplayPluginInfoHelp(opts); + break; + case UNIVERSE_INFO: + DisplayUniverseInfoHelp(opts); + break; + case UNIVERSE_NAME: + DisplayUniverseNameHelp(opts); + break; + case UNI_MERGE: + DisplayUniverseMergeHelp(opts); + break; + case SET_DMX: + DisplaySetDmxHelp(opts); + break; + case SET_PORT_PRIORITY: + DisplaySetPriorityHelp(opts); + } + exit(0); +} + + +/* + * Send a fetch device info request + * @param client the ola client + * @param opts the const options + */ +int FetchDeviceInfo(OlaClient *client, const options &opts) { + client->FetchDeviceInfo((ola::ola_plugin_id) opts.plugin_id); + return 0; +} + + +void Patch(OlaClient *client, const options &opts) { + if (opts.device_id == INVALID_VALUE || opts.port_id == INVALID_VALUE) { + DisplayPatchHelp(opts); + exit(1); + } + + if (opts.patch_action == ola::PATCH && opts.uni == INVALID_VALUE) { + DisplayPatchHelp(opts); + exit(1); + } + client->Patch(opts.device_id, + opts.port_id, + opts.port_direction, + opts.patch_action, opts.uni); +} + + +/* + * Fetch information on plugins. + */ +int FetchPluginInfo(OlaClient *client, const options &opts) { + if (opts.plugin_id > 0) + client->FetchPluginDescription((ola::ola_plugin_id) opts.plugin_id); + else + client->FetchPluginList(); + return 0; +} + + + +/* + * send a set name request + * @param client the ola client + * @param opts the const options + */ +int SetUniverseName(OlaClient *client, const options &opts) { + if (opts.uni == INVALID_VALUE) { + DisplayUniverseNameHelp(opts); + exit(1); + } + client->SetUniverseName(opts.uni, opts.uni_name); + return 0; +} + + +/* + * send a set name request + * @param client the ola client + * @param opts the const options + */ +int SetUniverseMergeMode(OlaClient *client, const options &opts) { + if (opts.uni == INVALID_VALUE) { + DisplayUniverseMergeHelp(opts); + exit(1); + } + client->SetUniverseMergeMode(opts.uni, opts.merge_mode); + return 0; +} + + +/* + * Send a dmx message + * @param client the ola client + * @param opts the options + */ +int SendDmx(OlaClient *client, const options &opts) { + ola::DmxBuffer buffer; + bool status = buffer.SetFromString(opts.dmx); + + if (opts.uni < 0 || !status || buffer.Size() == 0) { + DisplaySetDmxHelp(opts); + exit(1); + } + + if (!client->SendDmx(opts.uni, buffer)) { + cout << "Send DMX failed" << endl; + return 1; + } + return 0; +} + + +/* + * Set the priority of a port + */ +void SetPortPriority(OlaClient *client, const options &opts) { + if (opts.device_id == INVALID_VALUE || opts.port_id == INVALID_VALUE) { + DisplaySetPriorityHelp(opts); + exit(1); + } + + if (opts.priority_mode == ola::PRIORITY_MODE_INHERIT) { + client->SetPortPriorityInherit(opts.device_id, + opts.port_id, + opts.port_direction); + } else if (opts.priority_mode == ola::PRIORITY_MODE_OVERRIDE) { + client->SetPortPriorityOverride(opts.device_id, + opts.port_id, + opts.port_direction, + opts.priority_value); + } else { + DisplaySetPriorityHelp(opts); + } +} + + +/* + * Main + */ +int main(int argc, char *argv[]) { + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + SimpleClient ola_client; + options opts; + + InitOptions(&opts); + opts.cmd = argv[0]; + + // decide how we should behave + SetMode(&opts); + + if (opts.m == DEVICE_PATCH) + ParsePatchOptions(argc, argv, &opts); + else if (opts.m == SET_PORT_PRIORITY) + ParseSetPriorityOptions(argc, argv, &opts); + else + ParseOptions(argc, argv, &opts); + + if (opts.help) + DisplayHelpAndExit(opts); + + if (!ola_client.Setup()) { + OLA_FATAL << "Setup failed"; + exit(1); + } + + OlaClient *client = ola_client.GetClient(); + SelectServer *ss = ola_client.GetSelectServer(); + + Observer observer(&opts, ss); + client->SetObserver(&observer); + + switch (opts.m) { + case DEVICE_INFO: + FetchDeviceInfo(client, opts); + break; + case DEVICE_PATCH: + Patch(client, opts); + break; + case PLUGIN_INFO: + FetchPluginInfo(client, opts); + break; + case UNIVERSE_INFO: + client->FetchUniverseInfo(); + break; + case UNIVERSE_NAME: + SetUniverseName(client, opts); + break; + case UNI_MERGE: + SetUniverseMergeMode(client, opts); + break; + case SET_DMX: + SendDmx(client, opts); + break; + case SET_PORT_PRIORITY: + SetPortPriority(client, opts); + } + + ss->Run(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxconsole.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxconsole.cpp new file mode 100644 index 0000000..4705294 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxconsole.cpp @@ -0,0 +1,686 @@ +/* + * Copyright (C) 2001 Dirk Jagdmann + * + * 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. + * + * + * Modified by Simon Newton (nomis52gmail.com) to use ola + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#ifdef HAVE_MALLOC_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using ola::SimpleClient; +using ola::OlaClient; +using ola::network::SelectServer; +using std::string; + +/* color names used */ +enum { + CHANNEL = 1, + ZERO, + NORM, + FULL, + HEADLINE, + HEADEMPH, + HEADERROR, + MAXCOLOR +}; + +/* display modes */ +enum { + DISP_MODE_DMX = 0, + DISP_MODE_HEX, + DISP_MODE_DEC, + DISP_MODE_MAX, +}; + +int MAXCHANNELS=512; +unsigned int MAXFKEY=12; + +int universe = 0; + +typedef unsigned char dmx_t ; + +static dmx_t *dmx; +static dmx_t *dmxsave; +static dmx_t *dmxundo; + +static int display_mode = DISP_MODE_DMX; +static int current_channel = 0; /* channel cursor is positioned on */ +static int first_channel = 0; /* channel in upper left corner */ +static int channels_per_line=80/4; +static int channels_per_screen=80/4*24/2; +static int undo_possible=0; +static int current_cue=0; /* select with F keys */ +static float fadetime=1.0f; +static int fading=0; /* percentage counter of fade process */ +static int palette_number=0; +static int palette[MAXCOLOR]; +string error_str; +static int channels_offset=1; + +OlaClient *client; +SelectServer *ss; + + +void DMXsleep(int usec) { + struct timeval tv; + tv.tv_sec = usec/1000000; + tv.tv_usec = usec%1000000; + if(select(1, NULL, NULL, NULL, &tv) < 0) + perror("could not select"); +} + +// returns the time in milliseconds +unsigned long timeGetTime() { +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv ; + gettimeofday(&tv, NULL) ; + return (unsigned long)tv.tv_sec*1000UL+ (unsigned long)tv.tv_usec/1000; + +#else +# ifdef HAVE_FTIME + struct timeb t; + ftime(&t); + return (unsigned long)t.time*1000UL+(unsigned long)t.millitm; +# else + +# endif +#endif +} + + + +/* set all DMX channels */ +void setall() { + ola::DmxBuffer buffer(dmx, MAXCHANNELS); + client->SendDmx(universe, buffer); +} + +/* set current DMX channel */ +void set() { + setall() ; +} + + +/* display the channels numbers */ +void mask() { + int i=0,x,y,z=first_channel; + + erase(); + + /* clear headline */ + attrset(palette[HEADLINE]); + move(0,0); + for (x=0; x24) { + time_t t=time(NULL); + struct tm *tt=localtime(&t); + char *s=asctime(tt); + s[strlen(s)-1]=0; /* strip newline at end of string */ + + attrset(palette[HEADLINE]); + mvprintw(0,1,"%s", s); + } + if(COLS>31) { + attrset(palette[HEADLINE]); + printw(" cue:"); + attrset(palette[HEADEMPH]); + printw("%02i", current_cue+1); + } + if(COLS>44) { + attrset(palette[HEADLINE]); + printw(" fadetime:"); + + attrset(palette[HEADEMPH]); + printw("%1.1f", fadetime); + } + if(COLS>55) { + if(fading) { + attrset(palette[HEADLINE]); + printw(" fading:"); + + attrset(palette[HEADEMPH]); + printw("%02i%%", (fading<100)?fading:99); + } else { + attrset(palette[HEADLINE]); + printw(" "); + } + } + + if(COLS>80) + if(!error_str.empty()) { + attrset(palette[HEADERROR]); + printw("ERROR:%s", error_str.data()); + } + + /* values */ + for(y=2; yMAXFKEY || new_cue<0) + return; + + undo_possible=0; + + /* don't crossfade for small fadetimes */ + if(fadetime<0.1f) { + savecue(); + current_cue=new_cue; + loadcue(); + setall(); + return; + } + + savecue(); + dmxold=&dmxsave[current_cue*MAXCHANNELS]; + dmxnew=&dmxsave[new_cue*MAXCHANNELS]; + + /* try to find the last channel value > 0, so we don't have to + crossfade large blocks of 0s */ + for(i=MAXCHANNELS-1; i>=0; max=i, i--) + if(dmxold[i]||dmxnew[i]) + break; + + { + const unsigned long tstart=timeGetTime(); + const unsigned long tend=tstart+(int)(fadetime*1000.0); + unsigned long t=tstart; + while(t<=tend) + { + /* calculate new cue */ + t=timeGetTime(); + { + const float p=(float)(t-tstart)/1000.0f/fadetime; + const float q=1.0f-p; + for(i=0; i 0x10) + dmx[current_channel]-=0x10; + else + dmx[current_channel] = 0; + set(); + break; + + case '-': + if(dmx[current_channel] > 0) { + undoprep(); + dmx[current_channel]--; + } + set(); + break; + + case ' ': + undoprep(); + if(dmx[current_channel]<128) + dmx[current_channel]=255; + else + dmx[current_channel]=0; + set(); + break; + + case '0' ... '9': + fadetime=c-'0'; + break; + + case KEY_HOME: + current_channel=0; + first_channel=0; + mask(); + break; + + case KEY_RIGHT: + if(current_channel < MAXCHANNELS-1) { + current_channel++; + if(current_channel >= first_channel+channels_per_screen) { + first_channel+=channels_per_line; + mask(); + } + } + break; + + case KEY_LEFT: + if(current_channel > 0) { + current_channel--; + if(current_channel < first_channel) { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + } + break; + + case KEY_DOWN: + current_channel+=channels_per_line; + if(current_channel>=MAXCHANNELS) + current_channel=MAXCHANNELS-1; + if(current_channel >= first_channel+channels_per_screen) { + first_channel+=channels_per_line; + mask(); + } + break; + + case KEY_UP: + current_channel-=channels_per_line; + if(current_channel<0) + current_channel=0; + if(current_channel < first_channel) { + first_channel-=channels_per_line; + if(first_channel<0) + first_channel=0; + mask(); + } + break; + + case KEY_IC: + undoprep(); + for (n = MAXCHANNELS-1; n>current_channel && n>0; n--) + dmx[n]=dmx[n-1]; + setall(); + break; + case KEY_DC: + undoprep(); + for(n=current_channel; n=DISP_MODE_MAX) + display_mode=0; + mask(); + break; + case 'N': + case 'n': + if(++channels_offset>1) + channels_offset=0; + mask(); + break; + case 'P': + case 'p': + changepalette(++palette_number); + break; + case 'U': + case 'u': + undo(); + break; + case 'Q': + case 'q': + ss->Terminate(); + default: + if (c >= (int) KEY_F(1) && c <= (int) KEY_F(MAXFKEY)) + crossfade(c - KEY_F(1)); + break; + } + values(); + refresh(); +} + +int main (int argc, char *argv[]) { + int optc; + + signal(SIGWINCH, terminalresize); + atexit(cleanup); + + /* alloc */ + dmx = (dmx_t*) calloc(MAXCHANNELS+10, sizeof(dmx_t)); /* 10 bytes security, for file IO routines, will be optimized and checked later */ + CHECK(dmx); + + dmxsave=(dmx_t*) calloc(MAXCHANNELS*MAXFKEY, sizeof(dmx_t)); + CHECK(dmxsave); + + dmxundo=(dmx_t*) calloc(MAXCHANNELS, sizeof(dmx_t)); + CHECK(dmxundo); + + // parse options + while ((optc = getopt (argc, argv, "u:")) != EOF) { + switch (optc) { + case 'u': + universe = atoi(optarg) ; + break ; + default: + break; + } + } + + /* set up ola connection */ + SimpleClient ola_client; + ola::network::UnmanagedSocket stdin_socket(0); + stdin_socket.SetOnData(ola::NewClosure(&stdin_ready)); + + if (!ola_client.Setup()) { + printf("error: %s", strerror(errno)); + exit(1); + } + + client = ola_client.GetClient(); + ss = ola_client.GetSelectServer(); + ss->AddSocket(&stdin_socket); + + /* init curses */ + w = initscr(); + if (!w) { + printf ("unable to open main-screen\n"); + return 1; + } + + savetty(); + start_color(); + noecho(); + raw(); + keypad(w, TRUE); + + calcscreengeometry(); + changepalette(palette_number); + + values(); + refresh(); + ss->Run(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxmonitor.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxmonitor.cpp new file mode 100644 index 0000000..edd9817 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-dmxmonitor.cpp @@ -0,0 +1,577 @@ +/* + * Copyright (C) 2001 Dirk Jagdmann + * + * 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. + * + * Modified by Simon Newton (nomis52gmail.com) to use ola + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include +#include +#include +#include +#ifdef HAVE_MALLOC_H +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +using ola::DmxBuffer; +using ola::OlaCallbackClient; +using ola::OlaCallbackClientWrapper; +using ola::network::SelectServer; +using std::string; + +/* color names used */ +enum { + CHANNEL = 1, + ZERO, + NORM, + FULL, + HEADLINE, + HEADEMPH, + HEADERROR, + MAXCOLOR +}; + +/* display modes */ +enum { + DISP_MODE_DMX = 0, + DISP_MODE_HEX, + DISP_MODE_DEC, + DISP_MODE_MAX, +}; + +class DmxMonitor *dmx_monitor; + +static int display_mode = DISP_MODE_DMX; +static int current_channel = 0; /* channel cursor is positioned on */ +static int first_channel = 0; /* channel in upper left corner */ +static int channels_per_line = 80/4; +static int channels_per_screen = 80/4*24/2; +static int palette[MAXCOLOR]; + +/* + * The observer class which repsonds to events + */ +class DmxMonitor { + public: + explicit DmxMonitor(unsigned int universe): + m_universe(universe), + m_counter(0), + m_palette_number(0), + m_stdin_socket(STDIN_FILENO), + m_window(NULL), + m_data_loss_window(NULL), + m_channels_offset(false) { + }; + + ~DmxMonitor() { + if (m_window) { + resetty(); + endwin(); + } + } + + bool Init(); + void Run() { m_client.GetSelectServer()->Run(); } + void NewDmx(unsigned int universe, + const DmxBuffer &buffer, + const string &error); + void RegisterComplete(const string &error); + void StdinReady(); + bool CheckDataLoss(); + void TerminalResized(); + + private: + unsigned int m_universe; + unsigned int m_counter; + int m_palette_number; + ola::network::UnmanagedSocket m_stdin_socket; + struct timeval m_last_data; + WINDOW *m_window; + WINDOW *m_data_loss_window; + bool m_channels_offset; // start from channel 1 rather than 0; + OlaCallbackClientWrapper m_client; + + void Mask(); + void Values(const DmxBuffer &buffer); + void ChangePalette(int p); + void CalcScreenGeometry(); +}; + + +/* + * Setup the monitoring console + */ +bool DmxMonitor::Init() { + /* set up ola connection */ + if (!m_client.Setup()) { + printf("error: %s", strerror(errno)); + return false; + } + + OlaCallbackClient *client = m_client.GetClient(); + client->SetDmxCallback(ola::NewCallback(this, &DmxMonitor::NewDmx)); + client->RegisterUniverse( + m_universe, + ola::REGISTER, + ola::NewSingleCallback(this, &DmxMonitor::RegisterComplete)); + + /* init curses */ + m_window = initscr(); + if (!m_window) { + printf("unable to open main-screen\n"); + return false; + } + + savetty(); + start_color(); + noecho(); + raw(); + keypad(m_window, TRUE); + + m_client.GetSelectServer()->AddSocket(&m_stdin_socket); + m_stdin_socket.SetOnData(ola::NewClosure(this, &DmxMonitor::StdinReady)); + m_client.GetSelectServer()->RegisterRepeatingTimeout( + 500, + ola::NewClosure(this, &DmxMonitor::CheckDataLoss)); + CalcScreenGeometry(); + ChangePalette(m_palette_number); + + DmxBuffer empty_buffer; + empty_buffer.Blackout(); + NewDmx(m_universe, empty_buffer, ""); + + timerclear(&m_last_data); + return true; +} + + +/* + * Called when there is new DMX data + */ +void DmxMonitor::NewDmx(unsigned int universe, + const DmxBuffer &buffer, + const string &error) { + if (m_data_loss_window) { + // delete the window + wborder(m_data_loss_window, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '); + wrefresh(m_data_loss_window); + delwin(m_data_loss_window); + m_data_loss_window = NULL; + Mask(); + } + move(0, COLS - 1); + switch (m_counter % 4) { + case 0: + printw("/"); + break; + case 1: + printw("-"); + break; + case 2: + printw("\\"); + break; + default: + printw("|"); + break; + } + m_counter++; + gettimeofday(&m_last_data, NULL); + Values(buffer); + refresh(); +} + + +void DmxMonitor::RegisterComplete(const string &error) { + if (!error.empty()) { + std::cerr << "Register command failed with " << errno << + std::endl; + m_client.GetSelectServer()->Terminate(); + } +} + +/* + * Called when there is input from the keyboard + */ +void DmxMonitor::StdinReady() { + int c = wgetch(m_window); + + switch (c) { + case KEY_HOME: + current_channel = 0; + first_channel = 0; + Mask(); + break; + + case KEY_RIGHT: + if (current_channel < DMX_UNIVERSE_SIZE-1) { + current_channel++; + if (current_channel >= first_channel + channels_per_screen) { + first_channel += channels_per_line; + Mask(); + } + } + break; + + case KEY_LEFT: + if (current_channel > 0) { + current_channel--; + if (current_channel < first_channel) { + first_channel -= channels_per_line; + if (first_channel < 0) + first_channel = 0; + Mask(); + } + } + break; + + case KEY_DOWN: + current_channel += channels_per_line; + if (current_channel >= DMX_UNIVERSE_SIZE) + current_channel = DMX_UNIVERSE_SIZE - 1; + if (current_channel >= first_channel+channels_per_screen) { + first_channel += channels_per_line; + Mask(); + } + break; + + case KEY_UP: + current_channel -= channels_per_line; + if (current_channel < 0) + current_channel = 0; + if (current_channel < first_channel) { + first_channel -= channels_per_line; + if (first_channel < 0) + first_channel = 0; + Mask(); + } + break; + + case 'M': + case 'm': + if (++display_mode >= DISP_MODE_MAX) + display_mode = 0; + Mask(); + break; + + case 'N': + case 'n': + m_channels_offset = !m_channels_offset; + Mask(); + break; + + case 'P': + case 'p': + ChangePalette(++m_palette_number); + break; + + case 'Q': + case 'q': + m_client.GetSelectServer()->Terminate(); + break; + default: + break; + } +} + + +/* + * Check for data loss. + * TODO(simon): move to the ola server + */ +bool DmxMonitor::CheckDataLoss() { + struct timeval now, diff; + + if (timerisset(&m_last_data)) { + gettimeofday(&now, NULL); + timersub(&now, &m_last_data, &diff); + if (!m_data_loss_window && + (diff.tv_sec > 2 || (diff.tv_sec == 2 && diff.tv_usec > 500000))) { + // loss of data + m_data_loss_window = newwin(3, 14, (LINES - 14) / 2, (COLS - 3) / 2); + mvwprintw(m_data_loss_window, 1, 2, "Data Loss!"); + wborder(m_data_loss_window, '|', '|', '-', '-', '+', '+', '+', '+'); + wrefresh(m_data_loss_window); + } + } + return true; +} + + +/* + * Called when the terminal is resized + */ +void DmxMonitor::TerminalResized() { + struct winsize size; + if (ioctl(0, TIOCGWINSZ, &size) < 0) + return; + + resizeterm(size.ws_row, size.ws_col); + CalcScreenGeometry(); + Mask(); +} + + +/* display the channels numbers */ +void DmxMonitor::Mask() { + int i = 0, x, y; + int channel = first_channel; + + erase(); + + /* clear headline */ + attrset(palette[HEADLINE]); + move(0, 0); + for (x = 0; x < COLS; x++) + addch(' '); + + /* write channel numbers */ + attrset(palette[CHANNEL]); + for (y = 1; y < LINES && channel < DMX_UNIVERSE_SIZE && + i < channels_per_screen; y+=2) { + move(y, 0); + for (x = 0; x < channels_per_line && channel < DMX_UNIVERSE_SIZE && + i < channels_per_screen; x++, i++, channel++) { + switch (display_mode) { + case DISP_MODE_HEX: + printw("%03X ", channel + (m_channels_offset ? 1 : 0)); + break; + case DISP_MODE_DMX: + case DISP_MODE_DEC: + default: + printw("%03d ", channel + (m_channels_offset ? 1 : 0)); + break; + } + } + } +} + + +/* + * Update the screen with new values + */ +void DmxMonitor::Values(const DmxBuffer &buffer) { + int i = 0, x, y, z = first_channel; + + /* headline */ + if (COLS>24) { + time_t t = time(NULL); + struct tm *tt = localtime(&t); + char *s = asctime(tt); + s[strlen(s) - 1] = 0; /* strip newline at end of string */ + + attrset(palette[HEADLINE]); + mvprintw(0, 1, "%s", s); + } + if (COLS > 31) { + attrset(palette[HEADLINE]); + printw(" Universe:"); + attrset(palette[HEADEMPH]); + printw("%02i", m_universe); + } + + /* values */ + for (y = 2; y < LINES && z < DMX_UNIVERSE_SIZE && i < channels_per_screen; + y+=2) { + move(y, 0); + for (x = 0; x < channels_per_line && z < DMX_UNIVERSE_SIZE && + i < channels_per_screen; x++, z++, i++) { + const int d = buffer.Get(z); + switch (d) { + case 0: attrset(palette[ZERO]); break; + case 255: attrset(palette[FULL]); break; + default: attrset(palette[NORM]); + } + if (z == current_channel) + attron(A_REVERSE); + switch (display_mode) { + case DISP_MODE_HEX: + if (d == 0) + addstr(" "); + else + printw(" %02x ", d); + break; + case DISP_MODE_DEC: + if (d == 0) + addstr(" "); + else if (d < 100) + printw(" %02d ", d); + else + printw("%03d ", d); + break; + case DISP_MODE_DMX: + default: + switch (d) { + case 0: addstr(" "); break; + case 255: addstr(" FL "); break; + default: printw(" %02d ", (d * 100) / 255); + } + } + } + } +} + + +/* change palette to "p". If p is invalid new palette is number "0". */ +void DmxMonitor::ChangePalette(int p) { + /* COLOR_BLACK + COLOR_RED + COLOR_GREEN + COLOR_YELLOW + COLOR_BLUE + COLOR_MAGENTA + COLOR_CYAN + COLOR_WHITE + + A_NORMAL + A_ATTRIBUTES + A_CHARTEXT + A_COLOR + A_STANDOUT + A_UNDERLINE + A_REVERSE + A_BLINK + A_DIM + A_BOLD + A_ALTCHARSET + A_INVIS + */ + switch (p) { + default: + m_palette_number = 0; + case 0: + init_pair(CHANNEL, COLOR_BLACK, COLOR_CYAN); + init_pair(ZERO, COLOR_BLACK, COLOR_WHITE); + init_pair(NORM, COLOR_BLUE, COLOR_WHITE); + init_pair(FULL, COLOR_RED, COLOR_WHITE); + init_pair(HEADLINE, COLOR_WHITE, COLOR_BLUE); + init_pair(HEADEMPH, COLOR_YELLOW, COLOR_BLUE); + init_pair(HEADERROR, COLOR_RED, COLOR_BLUE); + goto color; + + case 2: + init_pair(CHANNEL, COLOR_BLACK, COLOR_WHITE); + init_pair(ZERO, COLOR_BLUE, COLOR_BLACK); + init_pair(NORM, COLOR_GREEN, COLOR_BLACK); + init_pair(FULL, COLOR_RED, COLOR_BLACK); + init_pair(HEADLINE, COLOR_WHITE, COLOR_BLACK); + init_pair(HEADEMPH, COLOR_CYAN, COLOR_BLACK); + init_pair(HEADERROR, COLOR_RED, COLOR_BLACK); + goto color; + + color: + palette[CHANNEL]=COLOR_PAIR(CHANNEL); + palette[ZERO]=COLOR_PAIR(ZERO); + palette[NORM]=COLOR_PAIR(NORM); + palette[FULL]=COLOR_PAIR(FULL); + palette[HEADLINE]=COLOR_PAIR(HEADLINE); + palette[HEADEMPH]=COLOR_PAIR(HEADEMPH); + palette[HEADERROR]=COLOR_PAIR(HEADERROR); + break; + + case 1: + palette[CHANNEL]=A_REVERSE; + palette[ZERO]=A_NORMAL; + palette[NORM]=A_NORMAL; + palette[FULL]=A_BOLD; + palette[HEADLINE]=A_NORMAL; + palette[HEADEMPH]=A_NORMAL; + palette[HEADERROR]=A_BOLD; + break; + } + + Mask(); +} + + +/* calculate channels_per_line and channels_per_screen from LINES and COLS */ +void DmxMonitor::CalcScreenGeometry() { + int c = LINES; + if (c < 3) { + std::cerr << "Terminal must be more than 3 lines" << std::endl; + exit(1); + } + c--; // one line for headline + if (c % 2 == 1) + c--; + channels_per_line = COLS / 4; + channels_per_screen = channels_per_line * c / 2; +} + + +/* signal handler for SIGWINCH */ +void terminalresize(int sig) { + dmx_monitor->TerminalResized(); +} + + +/* cleanup handler for program exit. */ +void cleanup() { + if (dmx_monitor) + delete dmx_monitor; +} + + +int main(int argc, char *argv[]) { + int optc; + int universe = 0; + atexit(cleanup); + + // parse options + while ((optc = getopt(argc, argv, "u:")) != EOF) { + switch (optc) { + case 'u': + universe = atoi(optarg); + break; + default: + break; + } + } + + dmx_monitor = new DmxMonitor(universe); + if (!dmx_monitor->Init()) + return 1; + + dmx_monitor->Run(); + delete dmx_monitor; + dmx_monitor = NULL; + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-e131.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-e131.cpp new file mode 100644 index 0000000..8344600 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-e131.cpp @@ -0,0 +1,221 @@ +/* + * 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 Library 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. + * + * ola-e131.cpp + * Configure an E1.31 device + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include "src/OlaConfigurator.h" + +using std::cout; +using std::endl; +using std::string; + +typedef enum { + PORT_INFO, + PORT_PREVIEW_MODE, +} config_mode; + +typedef struct { + string command; // argv[0] + int device_id; // device id + bool help; // help + config_mode mode; + unsigned int port_id; // port_id + bool preview_mode; // set preview mode + bool input_port; // use the input port rather than output one +} options; + + +/* + * A class that configures E131 devices + */ +class E131Configurator: public OlaConfigurator { + public: + explicit E131Configurator(const options &opts): + OlaConfigurator(opts.device_id, ola::OLA_PLUGIN_E131), + m_options(opts) {} + void HandleConfigResponse(const string &reply, const string &error); + void SendConfigRequest(); + private: + void DisplayOptions(const ola::plugin::e131::PortInfoReply &reply); + options m_options; +}; + + +/* + * Handle the device config reply + */ +void E131Configurator::HandleConfigResponse(const string &reply, + const string &error) { + Terminate(); + if (!error.empty()) { + cout << error << endl; + return; + } + ola::plugin::e131::Reply reply_pb; + if (!reply_pb.ParseFromString(reply)) { + cout << "Protobuf parsing failed" << endl; + return; + } + if (reply_pb.type() == ola::plugin::e131::Reply::E131_PORT_INFO && + reply_pb.has_port_info()) { + DisplayOptions(reply_pb.port_info()); + return; + } + cout << "Invalid response type or missing port_info field" << endl; +} + + +/* + * Send a get parameters request + * @param device_id the device to send the request to + * @param client the OLAClient + */ +void E131Configurator::SendConfigRequest() { + ola::plugin::e131::Request request; + + if (m_options.mode == PORT_PREVIEW_MODE) { + request.set_type(ola::plugin::e131::Request::E131_PREVIEW_MODE); + ola::plugin::e131::PreviewModeRequest *preview_request = + request.mutable_preview_mode(); + preview_request->set_port_id(m_options.port_id); + preview_request->set_preview_mode(m_options.preview_mode); + preview_request->set_input_port(m_options.input_port); + } else { + request.set_type(ola::plugin::e131::Request::E131_PORT_INFO); + } + SendMessage(request); +} + + +/* + * Display the widget parameters + */ +void E131Configurator::DisplayOptions( + const ola::plugin::e131::PortInfoReply &reply) { + + for (int i = 0; i < reply.input_port_size(); i++) { + cout << "Input Port " << reply.input_port(i).port_id() << + ", ignore preview mode " << + (reply.input_port(i).preview_mode() ? "on" : "off") << endl; + } + + for (int i = 0; i < reply.output_port_size(); i++) { + cout << "Output Port " << reply.output_port(i).port_id() << + ", preview mode " << (reply.output_port(i).preview_mode() ? "on" : "off") + << endl; + } +} + + +/* + * Parse our cmd line options + */ +int ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"dev", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"port_id", required_argument, 0, 'p'}, + {"preview_mode", required_argument, 0, 'm'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "d:him:p:", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->device_id = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'i': + opts->input_port = true; + break; + case 'p': + opts->port_id = atoi(optarg); + break; + case 'm': + opts->preview_mode = (string(optarg) == "on" ? true : false); + opts->mode = PORT_PREVIEW_MODE; + break; + case '?': + break; + } + } + return 0; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(const options &opts) { + cout << "Usage: " << opts.command << + " -d -p [--input] --preview_mode \n\n" + "Configure E1.31 Devices managed by OLA.\n\n" + " -d, --dev Id of the device to control.\n" + " -h, --help Display this help message and exit.\n" + " -i Input port\n" + " -p, --port_id Id of the port to control\n" + " --preview_mode Set the preview mode bit\n" << + endl; + exit(0); +} + + +/* + * The main function + */ +int main(int argc, char*argv[]) { + options opts; + opts.command = argv[0]; + opts.device_id = -1; + opts.help = false; + opts.mode = PORT_INFO; + opts.port_id = -1; + opts.preview_mode = false; + opts.input_port = false; + + ParseOptions(argc, argv, &opts); + + if (opts.help || opts.device_id < 0) + DisplayHelpAndExit(opts); + + E131Configurator configurator(opts); + if (!configurator.Setup()) { + cout << "error: " << strerror(errno) << endl; + exit(1); + } + + configurator.Run(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm-discover.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm-discover.cpp new file mode 100644 index 0000000..b1d0b02 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm-discover.cpp @@ -0,0 +1,192 @@ +/* + * 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 Library 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. + * + * ola-discover.cpp + * Print the list of UIDs and force RDM discovery + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include + +using std::cout; +using std::endl; +using std::setw; +using std::string; +using std::vector; +using ola::OlaCallbackClient; +using ola::OlaCallbackClientWrapper; +using ola::network::SelectServer; +using ola::rdm::UIDSet; + +static const int INVALID_VALUE = -1; + +typedef struct { + int uni; // universe id + bool help; // show the help + bool force_discovery; // force RDM discovery + string cmd; // argv[0] +} options; + + +SelectServer *ss; + +/* + * This is called when we recieve uids for a universe + * @param universes a vector of OlaUniverses + */ +void UIDList(const ola::rdm::UIDSet &uids, + const string &error) { + if (error.empty()) { + UIDSet::Iterator iter = uids.Begin(); + for (; iter != uids.End(); ++iter) { + cout << *iter << endl; + } + } else { + cout << error << endl; + } + ss->Terminate(); +} + + +/* + * Called once we get an ack for the discovery request + */ +void ForceRDMDiscoveryComplete(const string &error) { + if (!error.empty()) + cout << error << endl; + ss->Terminate(); +} + + +/* + * parse our cmd line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + opts->uni = INVALID_VALUE; + opts->help = false; + opts->force_discovery = false; + + static struct option long_options[] = { + {"help", no_argument, 0, 'h'}, + {"force_discovery", no_argument, 0, 'f'}, + {"universe", required_argument, 0, 'u'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "u:hf", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'f': + opts->force_discovery = true; + break; + case 'h': + opts->help = true; + break; + case 'u': + opts->uni = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } +} + + +/* + * Help message for set dmx + */ +void DisplayGetUIDsHelp(const options &opts) { + cout << "Usage: " << opts.cmd << + " --universe [--force_discovery]\n" + "\n" + "Fetch the UID list for a universe.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -f, --force_discovery Force RDM Discovery for this universe\n" + " -u, --universe Universe number.\n" + << endl; +} + + +/* + * Send a fetch uid list request + * @param client the ola client + * @param opts the const options + */ +bool FetchUIDs(OlaCallbackClient *client, const options &opts) { + if (opts.uni == INVALID_VALUE) { + DisplayGetUIDsHelp(opts); + return false; + } + + if (opts.force_discovery) + return client->ForceDiscovery( + opts.uni, + ola::NewSingleCallback(&ForceRDMDiscoveryComplete)); + else + return client->FetchUIDList( + opts.uni, + ola::NewSingleCallback(&UIDList)); +} + + +/* + * Main + */ +int main(int argc, char *argv[]) { + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + OlaCallbackClientWrapper ola_client; + options opts; + opts.cmd = argv[0]; + + ParseOptions(argc, argv, &opts); + + if (opts.help) + DisplayGetUIDsHelp(opts); + + if (!ola_client.Setup()) { + OLA_FATAL << "Setup failed"; + exit(1); + } + + OlaCallbackClient *client = ola_client.GetClient(); + ss = ola_client.GetSelectServer(); + + if (FetchUIDs(client, opts)) + ss->Run(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm.cpp new file mode 100644 index 0000000..181ba32 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-rdm.cpp @@ -0,0 +1,335 @@ +/* + * 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 Library 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. + * + * ola-rdm.cpp + * The command line tool for controlling RDM devices + * Copyright (C) 2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "src/RDMController.h" +#include "src/RDMHandler.h" + +using std::cout; +using std::endl; +using std::string; +using std::vector; +using ola::rdm::UID; +using ola::OlaCallbackClient; +using ola::OlaCallbackClientWrapper; +using ola::network::SelectServer; +using ola::rdm::RDMAPI; + +typedef struct { + bool set_mode; + bool help; // show the help + bool list_pids; // show the pid list + int uni; // universe id + UID *uid; // uid + uint16_t sub_device; // the sub device + string pid; // pid to get/set + vector args; // extra args + string cmd; // argv[0] +} options; + + + +/* + * parse our cmd line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + opts->cmd = argv[0]; + opts->set_mode = false; + opts->list_pids = false; + opts->help = false; + opts->uni = 1; + opts->uid = NULL; + opts->sub_device = 0; + + std::vector tokens; + ola::StringSplit(argv[0], tokens, "/"); + + if (string(tokens[tokens.size() - 1]) == "ola_rdm_set") + opts->set_mode = true; + + int uid_set = 0; + static struct option long_options[] = { + {"sub_device", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"list_pids", no_argument, 0, 'l'}, + {"universe", required_argument, 0, 'u'}, + {"uid", required_argument, &uid_set, 1}, + {0, 0, 0, 0} + }; + + int option_index = 0; + + while (1) { + int c = getopt_long(argc, argv, "d:lu:hf", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + if (uid_set) + opts->uid = UID::FromString(optarg); + break; + case 'd': + opts->sub_device = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'l': + opts->list_pids = true; + break; + case 'u': + opts->uni = atoi(optarg); + break; + default: + break; + } + } + + int index = optind; + for (; index < argc; index++) + opts->args.push_back(argv[index]); +} + + +/* + * Display the help for get_pid + */ +void DisplayGetPidHelp(const options &opts) { + cout << "usage: " << opts.cmd << + " --universe --uid \n" + "\n" + "Get the value of a pid for a device.\n" + "Use '" << opts.cmd << " --list_pids' to get a list of pids.\n" + "\n" + " -d, --sub_device target a particular sub device (default is 0)\n" + " -h, --help display this help message and exit.\n" + " -l, --list_pids display a list of pids\n" + " -u, --universe universe number.\n" + " --uid the UID of the device to control.\n" + << endl; +} + + +/* + * Display the help for set_pid + */ +void DisplaySetPidHelp(const options &opts) { + cout << "usage: " << opts.cmd << + " --universe --uid \n" + "\n" + "Set the value of a pid for a device.\n" + "Use '" << opts.cmd << " --list_pids' to get a list of pids.\n" + "\n" + " -d, --sub_device target a particular sub device (default is 0)\n" + " -h, --help display this help message and exit.\n" + " -l, --list_pids display a list of pids\n" + " -u, --universe universe number.\n" + " --uid the UID of the device to control.\n" + << endl; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(const options &opts) { + if (opts.set_mode) { + DisplaySetPidHelp(opts); + } else { + DisplayGetPidHelp(opts); + } + exit(EX_USAGE); +} + + +void PopulatePidMap(map *pid_map) { + // populate the name -> pid map + (*pid_map)["proxied_devices"] = ola::rdm::PID_PROXIED_DEVICES; + (*pid_map)["proxied_device_count"] = ola::rdm::PID_PROXIED_DEVICE_COUNT; + (*pid_map)["comms_status"] = ola::rdm::PID_COMMS_STATUS; + (*pid_map)["queued_message"] = ola::rdm::PID_QUEUED_MESSAGE; + (*pid_map)["status_messages"] = ola::rdm::PID_STATUS_MESSAGES; + (*pid_map)["status_id_description"] = + ola::rdm::PID_STATUS_ID_DESCRIPTION; + (*pid_map)["clear_status_id"] = ola::rdm::PID_CLEAR_STATUS_ID; + (*pid_map)["sub_device_status_report_threshold"] = + ola::rdm::PID_SUB_DEVICE_STATUS_REPORT_THRESHOLD; + (*pid_map)["supported_parameters"] = ola::rdm::PID_SUPPORTED_PARAMETERS; + (*pid_map)["param_description"] = ola::rdm::PID_PARAMETER_DESCRIPTION; + (*pid_map)["device_info"] = ola::rdm::PID_DEVICE_INFO; + (*pid_map)["product_detail_id_list"] = + ola::rdm::PID_PRODUCT_DETAIL_ID_LIST; + (*pid_map)["device_model_description"] = + ola::rdm::PID_DEVICE_MODEL_DESCRIPTION; + (*pid_map)["manufacturer_label"] = ola::rdm::PID_MANUFACTURER_LABEL; + (*pid_map)["device_label"] = ola::rdm::PID_DEVICE_LABEL; + (*pid_map)["factory_defaults"] = ola::rdm::PID_FACTORY_DEFAULTS; + (*pid_map)["language_capabilities"] = + ola::rdm::PID_LANGUAGE_CAPABILITIES; + (*pid_map)["language"] = ola::rdm::PID_LANGUAGE; + (*pid_map)["software_version_label"] = + ola::rdm::PID_SOFTWARE_VERSION_LABEL; + (*pid_map)["boot_software_version_id"] = + ola::rdm::PID_BOOT_SOFTWARE_VERSION_ID; + (*pid_map)["boot_software_version_label"] = + ola::rdm::PID_BOOT_SOFTWARE_VERSION_LABEL; + (*pid_map)["dmx_personality"] = ola::rdm::PID_DMX_PERSONALITY; + (*pid_map)["dmx_personality_description"] = + ola::rdm::PID_DMX_PERSONALITY_DESCRIPTION; + (*pid_map)["dmx_start_address"] = ola::rdm::PID_DMX_START_ADDRESS; + (*pid_map)["slot_info"] = ola::rdm::PID_SLOT_INFO; + (*pid_map)["slot_description"] = ola::rdm::PID_SLOT_DESCRIPTION; + (*pid_map)["default_slot_value"] = ola::rdm::PID_DEFAULT_SLOT_VALUE; + (*pid_map)["sensor_definition"] = ola::rdm::PID_SENSOR_DEFINITION; + (*pid_map)["sensor_value"] = ola::rdm::PID_SENSOR_VALUE; + (*pid_map)["record_sensors"] = ola::rdm::PID_RECORD_SENSORS; + (*pid_map)["device_hours"] = ola::rdm::PID_DEVICE_HOURS; + (*pid_map)["lamp_hours"] = ola::rdm::PID_LAMP_HOURS; + (*pid_map)["lamp_strikes"] = ola::rdm::PID_LAMP_STRIKES; + (*pid_map)["lamp_state"] = ola::rdm::PID_LAMP_STATE; + (*pid_map)["lamp_on_mode"] = ola::rdm::PID_LAMP_ON_MODE; + (*pid_map)["device_power_cycles"] = ola::rdm::PID_DEVICE_POWER_CYCLES; + (*pid_map)["display_invert"] = ola::rdm::PID_DISPLAY_INVERT; + (*pid_map)["display_level"] = ola::rdm::PID_DISPLAY_LEVEL; + (*pid_map)["pan_invert"] = ola::rdm::PID_PAN_INVERT; + (*pid_map)["tilt_invert"] = ola::rdm::PID_TILT_INVERT; + (*pid_map)["pan_tilt_swap"] = ola::rdm::PID_PAN_TILT_SWAP; + (*pid_map)["real_time_clock"] = ola::rdm::PID_REAL_TIME_CLOCK; + (*pid_map)["identify_device"] = ola::rdm::PID_IDENTIFY_DEVICE; + (*pid_map)["reset_device"] = ola::rdm::PID_RESET_DEVICE; + (*pid_map)["power_state"] = ola::rdm::PID_POWER_STATE; + (*pid_map)["perform_self_test"] = ola::rdm::PID_PERFORM_SELFTEST; + (*pid_map)["self_test_description"] = + ola::rdm::PID_SELF_TEST_DESCRIPTION; + (*pid_map)["capture_preset"] = ola::rdm::PID_CAPTURE_PRESET; + (*pid_map)["preset_playback"] = ola::rdm::PID_PRESET_PLAYBACK; +} + + +/* + * Dump the list of known pids + */ +void DisplayPIDsAndExit(const map &pid_map) { + vector pids; + map::const_iterator map_iter = pid_map.begin(); + for (; map_iter != pid_map.end(); ++map_iter) + pids.push_back(map_iter->first); + + sort(pids.begin(), pids.end()); + vector::const_iterator iter = pids.begin(); + for (; iter != pids.end(); ++iter) { + std::cout << *iter << std::endl; + } + exit(EX_OK); +} + + +/* + * Build a pid -> name map so we can nicely display pids for the user + */ +void ReversePidMap(const map &pid_map, + map *reverse_map) { + map::const_iterator map_iter = pid_map.begin(); + for (; map_iter != pid_map.end(); ++map_iter) + (*reverse_map)[map_iter->second] = map_iter->first; +} + + +/* + * Main + */ +int main(int argc, char *argv[]) { + // map pid names to numbers + map pid_name_map; + map reverse_pid_name_map; + PopulatePidMap(&pid_name_map); + ReversePidMap(pid_name_map, &reverse_pid_name_map); + + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + OlaCallbackClientWrapper ola_client; + options opts; + ParseOptions(argc, argv, &opts); + + if (opts.list_pids) + DisplayPIDsAndExit(pid_name_map); + + if (opts.help || opts.args.size() == 0) + DisplayHelpAndExit(opts); + + if (!opts.uid) { + OLA_FATAL << "Invalid UID"; + exit(EX_USAGE); + } + + if (!ola_client.Setup()) { + OLA_FATAL << "Setup failed"; + exit(EX_UNAVAILABLE); + } + + map::const_iterator name_iter = + pid_name_map.find(opts.args[0]); + + if (name_iter == pid_name_map.end()) { + cout << "Invalid pid name: " << opts.args[0] << endl; + exit(EX_USAGE); + } + + SelectServer *ss = ola_client.GetSelectServer(); + RDMAPI rdm_api(ola_client.GetClient()); + + ResponseHandler handler(&rdm_api, ss, reverse_pid_name_map); + RDMController controller(opts.uni, &rdm_api, &handler); + + string error; + vector params(opts.args.size()-1); + copy(opts.args.begin() + 1, opts.args.end(), params.begin()); + if (controller.RequestPID(*opts.uid, + opts.sub_device, + opts.set_mode, + name_iter->second, + params, + &error)) + ss->Run(); + else + std::cerr << error << endl; + + if (opts.uid) + delete opts.uid; + return handler.ExitCode(); +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-streaming-client.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-streaming-client.cpp new file mode 100644 index 0000000..701ab95 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-streaming-client.cpp @@ -0,0 +1,156 @@ +/* + * 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 Library 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. + * + * ola-client.cpp + * The multi purpose ola client. + * Copyright (C) 2005-2008 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using std::cout; +using std::endl; +using std::string; +using ola::StreamingClient; + + +typedef struct { + string dmx_data; + unsigned int universe; + bool help; +} options; + +bool terminate = false; + + +/* + * parse our cmd line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"dmx", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"universe", required_argument, 0, 'u'}, + {0, 0, 0, 0} + }; + + opts->dmx_data = ""; + opts->universe = 1; + opts->help = false; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "d:hu:", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'd': + opts->dmx_data = optarg; + break; + case 'h': + opts->help = true; + break; + case 'u': + opts->universe = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(char arg[], const options &opts) { + cout << "Usage: " << arg << + " --dmx --universe \n" + "\n" + "Send DMX512 data to OLA. If dmx data isn't provided we read from stdin.\n" + "\n" + " -d, --dmx DMX512 data, e.g. '1,240,0,255'\n" + " -h, --help Display this help message and exit.\n" + " -u, --universe Id of universe to send data for.\n" + << endl; + exit(1); +} + + +bool SendDataFromString(StreamingClient &client, + unsigned int universe, + const string &data) { + ola::DmxBuffer buffer; + bool status = buffer.SetFromString(data); + + if (!status || buffer.Size() == 0) + return false; + + if (!client.SendDmx(universe, buffer)) { + cout << "Send DMX failed" << endl; + terminate = true; + return false; + } + return true; +} + + +/* + * Main + */ +int main(int argc, char *argv[]) { + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + StreamingClient ola_client; + options opts; + + ParseOptions(argc, argv, &opts); + + if (opts.help || opts.universe < 0) + DisplayHelpAndExit(argv[0], opts); + + if (!ola_client.Setup()) { + OLA_FATAL << "Setup failed"; + exit(1); + } + + if (opts.dmx_data.empty()) { + string input; + while (!terminate && std::cin >> input) { + ola::StringTrim(&input); + SendDataFromString(ola_client, opts.universe, input); + } + } else { + SendDataFromString(ola_client, opts.universe, opts.dmx_data); + } + ola_client.Stop(); + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-throughput.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-throughput.cpp new file mode 100644 index 0000000..6f2047c --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-throughput.cpp @@ -0,0 +1,153 @@ +/* + * 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 Library 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. + * + * ola-throughput.cpp + * Send a bunch of frames quickly to load test the server. + * Copyright (C) 2005-2010 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using std::cout; +using std::endl; +using std::string; +using ola::StreamingClient; + + +typedef struct { + unsigned int universe; + unsigned int sleep_time; + bool help; +} options; + + +/* + * parse our cmd line options + */ +void ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"help", no_argument, 0, 'h'}, + {"sleep", required_argument, 0, 's'}, + {"universe", required_argument, 0, 'u'}, + {0, 0, 0, 0} + }; + + opts->sleep_time = 40000; + opts->universe = 1; + opts->help = false; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "hs:u:", long_options, &option_index); + + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'h': + opts->help = true; + break; + case 's': + opts->sleep_time = atoi(optarg); + break; + case 'u': + opts->universe = atoi(optarg); + break; + case '?': + break; + default: + break; + } + } +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(char arg[], const options &opts) { + cout << "Usage: " << arg << + " --dmx --universe \n" + "\n" + "Send DMX512 data to OLA. If dmx data isn't provided we read from stdin.\n" + "\n" + " -h, --help Display this help message and exit.\n" + " -s, --sleep Time to sleep between frames.\n" + " -u, --universe Id of universe to send data for.\n" + << endl; + exit(1); +} + + +bool SendDataFromString(StreamingClient &client, + unsigned int universe, + const string &data) { + ola::DmxBuffer buffer; + bool status = buffer.SetFromString(data); + + if (!status || buffer.Size() == 0) + return false; + + if (!client.SendDmx(universe, buffer)) { + cout << "Send DMX failed" << endl; + return false; + } + return true; +} + + +/* + * Main + */ +int main(int argc, char *argv[]) { + ola::InitLogging(ola::OLA_LOG_WARN, ola::OLA_LOG_STDERR); + StreamingClient ola_client; + options opts; + + ParseOptions(argc, argv, &opts); + + if (opts.help || opts.universe < 0) + DisplayHelpAndExit(argv[0], opts); + + if (!ola_client.Setup()) { + OLA_FATAL << "Setup failed"; + exit(1); + } + + while (1) { + usleep(opts.sleep_time); + ola::DmxBuffer buffer; + buffer.Blackout(); + + if (!ola_client.SendDmx(opts.universe, buffer)) { + cout << "Send DMX failed" << endl; + return false; + } + } + return 0; +} diff --git a/open-lighting-architecture/ola-examples-0.8.4/src/ola-usbpro.cpp b/open-lighting-architecture/ola-examples-0.8.4/src/ola-usbpro.cpp new file mode 100644 index 0000000..3d34cf1 --- /dev/null +++ b/open-lighting-architecture/ola-examples-0.8.4/src/ola-usbpro.cpp @@ -0,0 +1,296 @@ +/* + * 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 Library 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. + * + * ola-dev-info.cpp + * Displays the available devices and ports + * Copyright (C) 2005-2009 Simon Newton + */ + +#include +#include +#include +#include +#include +#include +#include +#include "src/OlaConfigurator.h" + + +using std::cout; +using std::endl; +using std::string; + +static const int K_INVALID_VALUE = -1; + +/* + * the config_mode is determined by the name in which we were called + */ +typedef enum { + NONE, + MODE_PARAM, + MODE_SERIAL, +} config_mode; + + +typedef struct { + config_mode mode; // config_mode + string command; // argv[0] + int device_id; // device id + bool help; // help + int brk; // brk + int mab; // mab + int rate; // rate +} options; + + +/* + * A class which configures UsbPro devices. + */ +class UsbProConfigurator: public OlaConfigurator { + public: + explicit UsbProConfigurator(const options &opts): + OlaConfigurator(opts.device_id, ola::OLA_PLUGIN_USBPRO), + m_opts(opts) {} + void HandleConfigResponse(const string &reply, const string &error); + void SendConfigRequest(); + bool SendParametersRequest(); + bool SendSerialRequest(); + private: + void DisplayParameters(const ola::plugin::usbpro::ParameterReply &reply); + void DisplaySerial(const ola::plugin::usbpro::SerialNumberReply &reply); + options m_opts; +}; + + +/* + * Handle the device config reply + */ +void UsbProConfigurator::HandleConfigResponse(const string &reply, + const string &error) { + Terminate(); + if (!error.empty()) { + cout << error << endl; + return; + } + + ola::plugin::usbpro::Reply reply_pb; + if (!reply_pb.ParseFromString(reply)) { + cout << "Protobuf parsing failed" << endl; + return; + } + if (reply_pb.type() == ola::plugin::usbpro::Reply::USBPRO_PARAMETER_REPLY && + reply_pb.has_parameters()) { + DisplayParameters(reply_pb.parameters()); + return; + } else if (reply_pb.type() == ola::plugin::usbpro::Reply::USBPRO_SERIAL_REPLY + && reply_pb.has_serial_number()) { + DisplaySerial(reply_pb.serial_number()); + return; + } + cout << "Invalid response type or missing options field" << endl; +} + + +/* + * Send the appropriate ConfigRequest + */ +void UsbProConfigurator::SendConfigRequest() { + switch (m_opts.mode) { + case MODE_PARAM: + SendParametersRequest(); + break; + case MODE_SERIAL: + SendSerialRequest(); + break; + default: + cout << "Unknown mode" << endl; + Terminate(); + } +} + + +/* + * Send a get parameters request + */ +bool UsbProConfigurator::SendParametersRequest() { + ola::plugin::usbpro::Request request; + request.set_type(ola::plugin::usbpro::Request::USBPRO_PARAMETER_REQUEST); + + ola::plugin::usbpro::ParameterRequest *parameter_request = + request.mutable_parameters(); + if (m_opts.brk != K_INVALID_VALUE) + parameter_request->set_break_time(m_opts.brk); + if (m_opts.mab != K_INVALID_VALUE) + parameter_request->set_mab_time(m_opts.mab); + if (m_opts.rate != K_INVALID_VALUE) + parameter_request->set_rate(m_opts.rate); + return SendMessage(request); +} + + +/* + * Send a get serial request + */ +bool UsbProConfigurator::SendSerialRequest() { + ola::plugin::usbpro::Request request; + request.set_type(ola::plugin::usbpro::Request::USBPRO_SERIAL_REQUEST); + return SendMessage(request); +} + + +/* + * Display the widget parameters + */ +void UsbProConfigurator::DisplayParameters( + const ola::plugin::usbpro::ParameterReply &reply) { + + cout << "Device: " << m_alias << endl; + cout << "Firmware: " << reply.firmware_high() << "." << reply.firmware() << + endl; + cout << "Break Time: " << reply.break_time() * 10.67 << "us" << endl; + cout << "MAB Time: " << reply.mab_time() * 10.67 << "us" << endl; + cout << "Packet Rate: " << reply.rate() << " packets/sec" << endl; +} + + +/* + * Display the serial number + */ +void UsbProConfigurator::DisplaySerial( + const ola::plugin::usbpro::SerialNumberReply &reply) { + + string serial_number = reply.serial(); + cout << "Device: " << m_alias << endl; + cout << "Serial: " << reply.serial() << endl; +} + + +/* + * Init options + */ +void InitOptions(options *opts) { + opts->mode = MODE_PARAM; + opts->device_id = K_INVALID_VALUE; + opts->help = false; + opts->brk = K_INVALID_VALUE; + opts->mab = K_INVALID_VALUE; + opts->rate = K_INVALID_VALUE; +} + + +/* + * Parse our cmd line options + */ +int ParseOptions(int argc, char *argv[], options *opts) { + static struct option long_options[] = { + {"brk", required_argument, 0, 'k'}, + {"dev", required_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"mab", required_argument, 0, 'm'}, + {"rate", required_argument, 0, 'r'}, + {"serial", required_argument, 0, 's'}, + {0, 0, 0, 0} + }; + + int c; + int option_index = 0; + + while (1) { + c = getopt_long(argc, argv, "b:d:hm:r:s", long_options, &option_index); + if (c == -1) + break; + + switch (c) { + case 0: + break; + case 'b': + opts->brk = atoi(optarg); + break; + case 'd': + opts->device_id = atoi(optarg); + break; + case 'h': + opts->help = true; + break; + case 'm': + opts->mab = atoi(optarg); + break; + case 'r': + opts->rate = atoi(optarg); + break; + case 's': + opts->mode = MODE_SERIAL; + break; + case '?': + break; + } + } + return 0; +} + + +/* + * Display the help message + */ +void DisplayHelpAndExit(const options &opts) { + cout << "Usage: " << opts.command << + " -d [--serial | -b -m -r ]\n\n" + "Configure Enttec Usb Pro Devices managed by OLA.\n\n" + " -b, --brk Set the break time (9 - 127)\n" + " -d, --dev The device to configure\n" + " -h, --help Display this help message and exit.\n" + " -m, --mab Set the make after-break-time (1 - 127)\n" + " -r, --rate Set the transmission rate (1 - 40).\n" + " -s, --serial Get the serial number.\n" << + endl; + exit(0); +} + + +void CheckOptions(options *opts) { + // check for valid parameters + if (opts->brk != K_INVALID_VALUE && (opts->brk < 9 || opts->brk > 127)) + opts->mode = NONE; + + if (opts->mab != K_INVALID_VALUE && (opts->mab < 1 || opts->mab > 127)) + opts->mode = NONE; + + if (opts->rate != K_INVALID_VALUE && (opts->rate < 1 || opts->rate > 40)) + opts->mode = NONE; +} + + +/* + * The main function + */ +int main(int argc, char *argv[]) { + options opts; + opts.command = argv[0]; + InitOptions(&opts); + ParseOptions(argc, argv, &opts); + CheckOptions(&opts); + + if (opts.help || opts.device_id < 0 || opts.mode == NONE) + DisplayHelpAndExit(opts); + + UsbProConfigurator configurator(opts); + if (!configurator.Setup()) { + cout << "error: " << strerror(errno) << endl; + exit(1); + } + + configurator.Run(); + return 0; +}