From: Ole Streicher Date: Thu, 25 Jul 2013 08:21:05 +0000 (+0100) Subject: Import xpa_2.1.15.orig.tar.gz X-Git-Tag: archive/raspbian/2.1.18-4+rpi1~1^2^2^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fd56025a5953a6223b577f74c6b9e66d901fe376;p=xpa.git Import xpa_2.1.15.orig.tar.gz [dgit import orig xpa_2.1.15.orig.tar.gz] --- fd56025a5953a6223b577f74c6b9e66d901fe376 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/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/INSTALL b/INSTALL new file mode 100644 index 0000000..5c50ba5 --- /dev/null +++ b/INSTALL @@ -0,0 +1,323 @@ +Quick Summary +============= + +To build and install the XPA package, simply execute: + + ./configure # site-specific configuration + make # build the software + make install # install it + make clean # clean up unneeded temp files + +We strongly recommend that you install in a directory other than the +default of /usr/local, so as not to require root access. To do this, +configure for a different install directory: + + ./configure --prefix= +e.g., + ./configure --prefix=/soft/saord + +Programs will be installed in /soft/saord/bin, libraries in /soft/saord/lib, +include files in /soft/saord/include, and man pages in /soft/saord/man. +Indeed, we do this at SAO and recommend it as a general rule, in order +to keep SAORD software in one place that does not conflict with other +installations. Note that you will need to add the bin directory to +your path and the man directory to MANPATH. + +The build ("make") takes only a minute or so on modern machines. To +monitor its progress and/or check for errors, redirect output to a file +and use the 'tail' command: + + make >& foo.log &; tail -f foo.log # csh +or + make 1>foo.log 2>&1 &; tail -f foo.log # sh, bash + + +Details of Installation +======================= + + NB: These are generic installation instructions, modified for XPA. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 1. `cd' to the directory containing the package's source code and type + "./configure". This runs a configuration script created by GNU + autoconf, which configures XPA for your system and creates a + Makefile. The configure script allows you to customize the XPA + configuration for your site; for details on how you can do this, + type "./configure -help" or refer to the autoconf documentation (not + included here). The XPA "configure" script supports the following special + switch(es) in addition to the standard ones: + + --enable-shared=yes|link + + Build shared libraries in addition to the + default static library. There are two options: + + If the value is "yes", shared libraries are + built but not used to link xpa programs. + + If the value is "link", shared libraries are + used to link xpa programs. If therefore becomes + your responsibility to put the shared library + where it can be found (or use LD_LIBRARY_PATH). + + --enable-threaded-xpans + Build xpans to support separate threads for + handling name server requests and xpa proxy + callbacks. This is recommended if you are going + to enable proxy handling in xpans (-P), since + XPA long callbacks via proxy can interfere + with the name server functions. (You still have + to start xpans with -P 2 to use 2 threads.) + + --with-tcl= + Force build Tcl support using parameters found + in /tclConfig.sh. Configure will look for + the Tcl config script in standard places and + will enable Tcl support if found. It will abort + if tclConfig.sh points to a non-existent tcl.h + file (some versions of Linux have shown this + behavior). Use this switch to override the + standard locations or to force a build even + if tcl.h is not found (e.g. if you are going to + install tcl as part of a larger build). With + Tcl support enabled you can execute: + + make tclxpa + + to generate the XPA package as a shared Tcl + object, loadable using Tcl "package require". + Contact us with problems -- its been a bear to + get this even half-way right. + + --with-threads + If you are going to link XPA into a threaded + program, you need to specify --with-threads. + This add -D_REENTRANT to the compiler flags, + which tells gcc to use thread-safe versions of + global system variables such as errno. No code + changes are made to XPA. Please note that all + XPA calls must be in a single thread: XPA is + not thread-safe in and of itself but does work + in threaded programs. + + --with-gtk= + Build with support for adding xpa to a gtk + loop. The specified include directory must + contain the gtk directory which itself contains + gtk.h, e.g.: + + --with-gtk=/usr/local/include/gtk-1.2 + + which contains gtk/gtk.h + + Standard options are listed below. the most important of which + are --exec-prefix and --prefix (to specify where to install), and + --x-includes=DIR and --x-libraries=DIR (for non-standard X installations). + We recommend --prefix be set to a directory that will hold saord software + (e.g., --prefix=/soft/saord) in order to make management of our software + easier. + + NB: be sure to use only absolute path names (those starting with "/") + in the --prefix and --exec_prefix options. (The configure options we + use at SAO for various machines are given as examples in the script + file called "saoconfig" in this directory.) + + 2. Type `make' to compile the package. + This will create a library archive called libxpa.a. It also will create + the programs xpaget, xpaset, xpainfo, xpaaccess, xpans, and xpamb. It + also will create the libxpa.so shared object if requested using the + --enable-shared switch + + 3. You can build the libxpa.so shared library manually by executing: + + make shlib + + at this point. This will not contain Xt or Tcl routines. If Tcl support + has been enabled (see --with-tcl above), you can build a shared library + called libtclxpa.so that supports the tclxpa package (i.e. Tcl routines + are contained in it) by executing: + + make tclxpa + + This shared library will be loaded automatically with the Tcl command: + + package require tclxpa 2.1 + + assuming, of course, that your shared library can be found by Tcl. + + 4. Type "make install" to install XPA's libraries and binaries in + standard places. You'll need write permission on the installation + directories to do this. The installation directories are + determined by the "configure" script and may be specified with + the --prefix and --exec_prefix options to "configure". See the + Makefile for information on what directories were chosen; you + can override these choices by modifying the "prefix" and + "exec_prefix" variables in the Makefile. + + 5. There are .html help files in the doc directory. You can copy + these files to a more convenient location, if you like. We + did not automate this step because we did not know where to + copy these files by default. (NB: The help.html file is the + top level index file.) + + 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. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + +You also can use this facility to specify a compiler other than the default +gcc (if it exists). + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/lib', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH': + +e.g., + ./configure --prefix=/soft/saord + +Programs will be installed in /soft/saord/bin, libraries in /soft/saord/lib, +and include files in /soft/saord/include. We recommend this as a general rule, +in order to keep SAORD software in one place that does not conflict with other +installations. Note that you will need to add the bin directory to your path. + + You can specify separate installation prefixes for architecture-specific +files and architecture-independent files. If you give `configure' the option +`--exec-prefix=PATH', the package will use PATH as the prefix for installing +programs and libraries. Documentation and other data files will still use the +regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + +If you have questions, please contact us at: saord@cfa.harvard.edu. + + Eric Mandel diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..0c90f4d --- /dev/null +++ b/Makefile.in @@ -0,0 +1,548 @@ +# +# This file is a Makefile for XPA. If it has the name "Makefile.in" +# then it is a template for a Makefile; to generate the actual Makefile, +# run "./configure", which is a configuration script generated by the +# "autoconf" program (constructs like "@foo@" will get replaced in the +# actual Makefile. +# + +PACKAGE = @PACKAGE_NAME@ +VERSION = @PACKAGE_VERSION@ + +DISTNAME = xpa-${VERSION} +DISTDIR = ../export/${DISTNAME} +FTPDIR = ../ftp + +#---------------------------------------------------------------- +# Things you can change to personalize the Makefile for your own +# site (you can make these changes in either Makefile.in or +# Makefile, but changes to Makefile will get lost if you re-run +# the configuration script). +#---------------------------------------------------------------- + +# Default top-level directories in which to install architecture- +# specific files (exec_prefix) and machine-independent files such +# as scripts (prefix). The values specified here may be overridden +# at configure-time with the --exec-prefix and --prefix options +# to the "configure" script. + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +# The following definition can be set to non-null for special systems +# like AFS with replication. It allows the pathnames used for installation +# to be different than those used for actually reference files at +# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix +# when installing files. +INSTALL_ROOT = + +# Directory in which to install the .a or .so binary for the XPA library: +LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib + +# Directory in which to install the program wish: +BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin + +# Directory in which to install the include file xpa.h: +INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include + +# Top-level directory for manual entries: +MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man + +# Top-level directory for share entries: +MAN_SHARE_DIR = $(INSTALL_ROOT)$(prefix)/share/xpa + +# Platform-specific X compiler flags (include file specifications) +X_CFLAGS = @X_CFLAGS@ +# Platform-specific link directive for X libraries (-L specification) +X_LIBS = @X_LIBS@ +# Platform-specific libraries that must go before -lXt +X_PRE_LIBS = @X_PRE_LIBS@ +# Platform-specific libraries that must go after -lXt +X_EXTRA_LIBS = @X_EXTRA_LIBS@ + +# Platform-specific include files for Tcl +TCL_CFLAGS = @TCL_CFLAGS@ +# Platform-specific libraries for Tcl +TCL_LIBS = @TCL_LIBS@ + +# Platform-specific include files for Gtk +GTK_CFLAGS = @GTK_CFLAGS@ +# Platform-specific libraries for Gtk +GTK_LIBS = @GTK_LIBS@ + +# combine package cflags +PKG_CFLAGS = $(X_CFLAGS) $(TCL_CFLAGS) $(GTK_CFLAGS) + +# extra Libs required to link (e.g. socket libraries) +LIBS = @EXTRA_LIBS@ + +# pthread lib needed to xpans +TLIB = @TLIB@ + +# To change the compiler switches, for example to change from -O +# to -g, change the following line: +CFLAGS = @CFLAGS@ + +# To add ld switches, change the following line: +LDFLAGS = @LDFLAGS@ + +# Some versions of make, like SGI's, use the following variable to +# determine which shell to use for executing commands: +SHELL = /bin/sh + +# if enabled-shared was specified, this will exand to "shlib" and trigger +# building of the shared library +DOSHARED = @DOSHARED@ + +# There are just too many different versions of "install" around; +# better to use the install-sh script that comes with the distribution, +# which is slower but guaranteed to work. + +INSTALL = @srcdir@/install-sh -c +INSTALL_PROGRAM = ${INSTALL} +INSTALL_DATA = ${INSTALL} -m 644 + +#---------------------------------------------------------------- +# The information below is modified by the configure script when +# Makefile is generated from Makefile.in. You shouldn't normally +# modify any of this stuff by hand. +#---------------------------------------------------------------- + +AC_FLAGS = @DEFS@ +RANLIB = @RANLIB@ +EXE = @EXEEXT@ + +#---------------------------------------------------------------- +# The information below should be usable as is. The configure +# script won't modify it and you shouldn't need to modify it +# either. +#---------------------------------------------------------------- +RM = rm -f + +CC = @CC@ + +CC_SWITCHES = -I. ${CFLAGS} ${AC_FLAGS} + +DEPEND_SWITCHES = -I. ${CFLAGS} ${PKG_CFLAGS} ${AC_FLAGS} + +SRCS = xpa.c xpaio.c command.c acl.c remote.c clipboard.c port.c \ + tcp.c client.c word.c xalloc.c find.c xlaunch.c timedconn.c \ + tclloop.c tcl.c xtloop.c gtkloop.c \ + xpaset.c xpaget.c xpainfo.c xpaaccess.c xpans.c xpamb.c + +BASE_OBJS = xpa.o xpaio.o command.o acl.o remote.o clipboard.o port.o \ + tcp.o client.o word.o xalloc.o find.o xlaunch.o timedconn.o + +TCL_OBJS = tclloop.o tcl.o + +XT_OBJS = xtloop.o + +GTK_OBJS = gtkloop.o + +INCL = xpa.h xpap.h + +# these are all the modules going into the "normal" xpa library +LIBOBJS = ${BASE_OBJS} ${TCL_OBJS} ${XT_OBJS} ${GTK_OBJS} +LIB = libxpa.a + +# used in link line +# LLIB= $(LIB) +LLIB= @LLIB@ + +PROGS = xpaset xpaget xpainfo xpaaccess xpans xpamb + +TESTPROGS = ctest stest rtest + +all: xpa.h lib $(PROGS) + +testall: $(TESTPROGS) + +All: all testall + +install:: install-binaries + +install:: $(DOSHARED)_install + +install:: install-man + +install:: install-share + +lib: $(LIB) $(DOSHARED) + +$(LIB): $(LIBOBJS) + $(RM) $(LIB) + ar crv $(LIB) $(LIBOBJS) + $(RANLIB) $(LIB) + +shlib: $(LIB) + @(rm -rf lib$(PACKAGE).tmp; mkdir lib$(PACKAGE).tmp; \ + (cd lib$(PACKAGE).tmp && ar x ../lib$(PACKAGE).a); \ + rm -f lib$(PACKAGE).tmp/xt*.o; \ + rm -f lib$(PACKAGE).tmp/tcl*.o; \ + CC='$(CC)' CXX=$(CXX) \ + ./mklib -o $(PACKAGE) lib$(PACKAGE).tmp/*.o; \ + rm -rf lib$(PACKAGE).tmp) + +mingw-dll: $(LIBOBJS) + $(CC) -I. -DHAVE_CONFIG_H -shared port.c tcp.c acl.c find.c \ + remote.c timedconn.c client.c word.c xpaio.c clipboard.c \ + xlaunch.c xalloc.c command.c xpa.c \ + -Wl,--output-def,libxpa.def,--out-implib,libxpa_dll.a,-no-undefined,--enable-runtime-pseudo-reloc -o libxpa.dll \ + -lwsock32 + +tclxpa: $(LIB) + @(rm -rf libtclxpa.tmp; mkdir libtclxpa.tmp; \ + (cd libtclxpa.tmp && ar x ../lib$(PACKAGE).a); \ + rm -f libtclxpa.tmp/xt*.o; \ + CC='$(CC)' CXX=$(CXX) \ + ./mklib -o tclxpa libtclxpa.tmp/*.o $(TCL_LIBS); \ + test -r libtclxpa.dylib && cp -p libtclxpa.dylib libtclxpa.so && echo "copying libtclxpa.dylib to libtclxpa.so"; \ + rm -rf libtclxpa.tmp) + +diff: + -(for f in `ls *.c`; \ + do \ + echo $$f; \ + diff /soft/saord/xpa-2.1.[0-9]*/$$f .; \ + done); + +index: $(LIB) + @(test -r pkgIndex.tcl && mv pkgIndex.tcl pkgIndex.tcl-old; \ + echo "pkg_mkIndex -direct -verbose . libtclxpa.so; exit"| tclsh) + +xpaset: $(LIB) xpaset.o + $(CC) $(LDFLAGS) xpaset.o -o xpaset $(LLIB) $(LIBS) + +xpaget: $(LIB) xpaget.o + $(CC) $(LDFLAGS) xpaget.o -o xpaget $(LLIB) $(LIBS) + +xpainfo: $(LIB) xpainfo.o + $(CC) $(LDFLAGS) xpainfo.o -o xpainfo $(LLIB) $(LIBS) + +xpaaccess: $(LIB) xpaaccess.o + $(CC) $(LDFLAGS) xpaaccess.o -o xpaaccess $(LLIB) $(LIBS) + +xpans: $(LIB) xpans.o + $(CC) $(LDFLAGS) xpans.o -o xpans $(LLIB) $(LIBS) $(TLIB) + +xpamb: $(LIB) xpamb.o + $(CC) $(LDFLAGS) xpamb.o -o xpamb $(LLIB) $(LIBS) + +ctest: $(LIB) ctest.o + $(CC) $(LDFLAGS) ctest.o -o ctest $(LLIB) $(LIBS) + +stest: $(LIB) stest.o + $(CC) $(LDFLAGS) stest.o -o stest $(LIB) $(LIBS) + +rtest: $(LIB) rtest.o + $(CC) $(LDFLAGS) rtest.o -o rtest $(LIB) $(LIBS) + +stestx: $(LIB) stest.o + $(CC) $(LDFLAGS) stest.o -o stest $(LIB) \ + $(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(LIBS) + +# Smoke test: allows end-users to quickly discern basic usability +smoke: ctest stest + ./stest smoke & + sleep 3 + ./ctest -e -b -l 1000 smoke + ./xpaset -p smoke exit + +# Note: before running ranlib below, must cd to target directory because +# some ranlibs write to current directory, and this might not always be +# possible (e.g. if installing as root). + +# this nop-op gets executed if we are not building shared libraries +_install: + +shlib_install: + @-(for i in `ls *.so* *.dylib *.sl 2>/dev/null` ; \ + do \ + if [ -h $$i ] ; then \ + echo "Installing link $$i" ; \ + tar cf - $$i | (cd $(LIB_INSTALL_DIR); tar xf -) ; \ + else \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(LIB_INSTALL_DIR)/$$i ; \ + chmod 555 $(LIB_INSTALL_DIR)/$$i; \ + fi; \ + done;) + +install-binaries: $(LIB) $(PROGS) + @for i in $(LIB_INSTALL_DIR) $(INCLUDE_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \ + do \ + if [ ! -d $$i ] ; then \ + echo "Making directory $$i"; \ + mkdir $$i; \ + chmod 755 $$i; \ + else true; \ + fi; \ + done; + @echo "Installing $(LIB)"; + @$(INSTALL_DATA) $(LIB) $(LIB_INSTALL_DIR)/$(LIB); + @(cd $(LIB_INSTALL_DIR); $(RANLIB) $(LIB)); + @chmod 555 $(LIB_INSTALL_DIR)/$(LIB); + @echo "Installing xpa.h" + @$(INSTALL_DATA) xpa.h $(INCLUDE_INSTALL_DIR)/xpa.h + @echo "Installing prsetup.h" + @$(INSTALL_DATA) prsetup.h $(INCLUDE_INSTALL_DIR)/prsetup.h + @for i in $(PROGS) ; \ + do \ + echo "Installing $$i$(EXE)" ; \ + $(INSTALL_PROGRAM) $$i$(EXE) $(BIN_INSTALL_DIR)/$$i$(EXE) ; \ + done; + +install-man: + @if [ ! -d $(MAN_INSTALL_DIR) ] ; then \ + echo "Making directory $(MAN_INSTALL_DIR)"; \ + mkdir $(MAN_INSTALL_DIR); \ + chmod 755 $(MAN_INSTALL_DIR); \ + else true; \ + fi; + @-(for i in `ls ./man/man?/*.?` ; \ + do \ + B=`basename $$i`; \ + E=`echo $$i | awk -F. '{print $$NF}'`; \ + M="$(MAN_INSTALL_DIR)/man$$E"; \ + if [ ! -d $$M ] ; then \ + echo "Making directory $$M"; \ + mkdir $$M; \ + chmod 755 $$M; \ + else true; \ + fi; \ + echo "Installing $$B" ; \ + $(INSTALL_DATA) $$i $$M/$$B; \ + done;) + +install-share: + @if [ ! -d $(MAN_SHARE_DIR) ] ; then \ + echo "Making directory $(MAN_SHARE_DIR)"; \ + mkdir -p $(MAN_SHARE_DIR); \ + chmod 755 $(MAN_SHARE_DIR); \ + else true; \ + fi; + @-(for i in `ls ./doc/sman/xpa?.*` ; \ + do \ + B=`basename $$i`; \ + echo "Installing $$B" ; \ + $(INSTALL_DATA) $$i $(MAN_SHARE_DIR)/$$B; \ + done;) + +Makefile: Makefile.in + $(SHELL) config.status + +clean: + $(RM) *.a *.so *.so.* *.dylib *.o *.exe core \ + errs *pure* .nfs* \ + foo* *~ *.log \#* TAGS *.E a.out errors \ + $(PROGS) $(TESTPROGS) \ + gmon.out *.pg *.bak \ + config.info config.log \ + doc/*~ doc/*.bak man/*~ + $(RM) -r autom4te.cache a.out.dSYM + +distclean: clean + $(RM) Makefile config.status config.cache config.log + +maintainer-clean:: clean + $(RM) config.status config.cache config.log + +depend: + makedepend -- $(DEPEND_SWITCHES) -- $(SRCS) + +acl.o: acl.c $(INCL) + $(CC) -c $(CC_SWITCHES) acl.c + +remote.o: remote.c $(INCL) + $(CC) -c $(CC_SWITCHES) remote.c + +clipboard.o: clipboard.c $(INCL) + $(CC) -c $(CC_SWITCHES) clipboard.c + +client.o: client.c $(INCL) + $(CC) -c $(CC_SWITCHES) client.c + +command.o: command.c $(INCL) + $(CC) -c $(CC_SWITCHES) command.c + +find.o: find.c + $(CC) -c $(CC_SWITCHES) find.c + +xlaunch.o: xlaunch.c + $(CC) -c $(CC_SWITCHES) xlaunch.c + +timedconn.o: timedconn.c + $(CC) -c $(CC_SWITCHES) timedconn.c + +port.o: port.c $(INCL) + $(CC) -c $(CC_SWITCHES) port.c + +tcl.o: tcl.c $(INCL) + $(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tcl.c + +tclloop.o: tclloop.c $(INCL) + $(CC) -c $(CC_SWITCHES) $(TCL_CFLAGS) tclloop.c + +gtkloop.o: gtkloop.c $(INCL) + $(CC) -c $(CC_SWITCHES) $(GTK_CFLAGS) gtkloop.c + +tcp.o: tcp.c + $(CC) -c $(CC_SWITCHES) tcp.c + +word.o: word.c + $(CC) -c $(CC_SWITCHES) word.c + +xalloc.o: xalloc.c + $(CC) -c $(CC_SWITCHES) xalloc.c + +xpa.o: xpa.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpa.c + +xpaio.o: xpaio.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpaio.c + +xtloop.o: xtloop.c $(INCL) + $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) xtloop.c + +xpaaccess.o: xpaaccess.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpaaccess.c + +xpaget.o: xpaget.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpaget.c + +xpainfo.o: xpainfo.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpainfo.c + +xpans.o: xpans.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpans.c + +xpamb.o: xpamb.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpamb.c + +xpaset.o: xpaset.c $(INCL) + $(CC) -c $(CC_SWITCHES) xpaset.c + +ctest.o: ctest.c + $(CC) -c $(CC_SWITCHES) ctest.c + +stest.o: stest.c + $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) stest.c + +rtest.o: rtest.c + $(CC) -c $(CC_SWITCHES) $(X_CFLAGS) rtest.c + +stestx.o: stest.c + $(CC) -o stest.o -c $(CC_SWITCHES) $(X_CFLAGS) \ + -DBUILD_WITH_XT stest.c + +strstr.o: ./compat/strstr.c + $(CC) -c $(CC_SWITCHES) -o strstr.o ./compat/strstr.c + +xpa.h: configure.ac + @($(RM) -r oxpa.h; \ + MAJOR=`echo "${VERSION}" | awk -F. '{print $$1}'`; \ + MINOR=`echo "${VERSION}" | awk -F. '{print $$2}'`; \ + PATCH=`echo "${VERSION}" | awk -F. '{print $$3}'`; \ + sed "s/^#define XPA_VERSION.*/#define XPA_VERSION \"$(VERSION)\"/;s/^#define XPA_MAJOR_VERSION.*/#define XPA_MAJOR_VERSION $${MAJOR}/;s/^#define XPA_MINOR_VERSION.*/#define XPA_MINOR_VERSION $${MINOR}/;s/^#define XPA_PATCH_LEVEL.*/#define XPA_PATCH_LEVEL $${PATCH}/;" < xpa.h > nxpa.h; \ + mv xpa.h oxpa.h; \ + mv nxpa.h xpa.h) + +configure: configure.ac + autoconf + +dist: configure + ($(RM) -r $(DISTDIR); \ + mkdir $(DISTDIR); \ + cp -p *.[ch] *.tcl $(DISTDIR)/.; \ + cp -p pkgIndex.tcl $(DISTDIR)/.; \ + cp -p Makefile.in $(DISTDIR)/.; \ + chmod 664 $(DISTDIR)/Makefile.in; \ + cp -p conf.h.in $(DISTDIR)/.; \ + chmod 664 $(DISTDIR)/conf.h.in; \ + cp -p configure.ac $(DISTDIR)/.; \ + chmod 644 $(DISTDIR)/configure.ac; \ + cp -p *.m4 $(DISTDIR)/.; \ + chmod 644 $(DISTDIR)/*.m4; \ + cp -p configure $(DISTDIR)/.; \ + chmod 755 $(DISTDIR)/configure; \ + cp -p config.sub config.guess $(DISTDIR)/.; \ + chmod 755 $(DISTDIR)/config.sub $(DISTDIR)/config.guess; \ + cp -p saoconfig $(DISTDIR)/.; \ + chmod 755 $(DISTDIR)/saoconfig; \ + cp -p mklib $(DISTDIR)/.; \ + chmod 755 $(DISTDIR)/mklib; \ + cp -p install-sh $(DISTDIR)/install-sh; \ + chmod 755 $(DISTDIR)/install-sh; \ + cp -p README INSTALL COPYING $(DISTDIR)/.; \ + mkdir $(DISTDIR)/doc; \ + cp -p ./doc/*.html $(DISTDIR)/doc/.; \ + cp -p ./doc/*.ps ./doc/*.pdf $(DISTDIR)/doc/.; \ + cp -p ./doc/Makefile $(DISTDIR)/doc/.; \ + mkdir $(DISTDIR)/doc/sman; \ + cp -p ./doc/sman/* $(DISTDIR)/doc/sman/.; \ + mkdir $(DISTDIR)/man; \ + cp -p -R ./man/* $(DISTDIR)/man/.) + +release: dist + (cd $(DISTDIR); cd ..; \ + tar cf - $(DISTNAME) | \ + gzip -9 -c > $(FTPDIR)/$(DISTNAME).tar.gz) + +tar: + ($(RM) config.cache; \ + cd ..; \ + tar cf - $(DISTNAME) | gzip -9 -c > $(DISTNAME).tar.gz) + +errcheck: + @-egrep 'error|warning' foo + +itar: + (cd doc/sman; \ + tar cf - . | gzip -9 -c > ../../../$(DISTNAME)-iman.tar.gz) + +sman: + @(cd doc && $(MAKE) index) + +docs: + @(cd doc; $(MAKE)) + +pure: xpaset.pure xpaget.pure xpainfo.pure xpaaccess.pure \ + xpans.pure xpamb.pure ctest.pure stest.pure rtest.pure + +xpaset.pure: $(LIB) xpaset.o + purify $(CC) $(LDFLAGS) xpaset.o -o xpaset.pure \ + $(LLIB) $(LIBS) + +xpaget.pure: $(LIB) xpaget.o + purify $(CC) $(LDFLAGS) xpaget.o -o xpaget.pure \ + $(LLIB) $(LIBS) + +xpainfo.pure: $(LIB) xpainfo.o + purify $(CC) $(LDFLAGS) xpainfo.o -o xpainfo.pure \ + $(LLIB) $(LIBS) + +xpaaccess.pure: $(LIB) xpaaccess.o + purify $(CC) $(LDFLAGS) xpaaccess.o -o xpaaccess.pure \ + $(LLIB) $(LIBS) + +xpans.pure: $(LIB) xpans.o + purify $(CC) $(LDFLAGS) xpans.o -o xpans.pure \ + $(LLIB) $(LIBS) $(TLIB) + +xpamb.pure: $(LIB) xpamb.o + purify $(CC) $(LDFLAGS) xpamb.o -o xpamb.pure \ + $(LLIB) $(LIBS) + +ctest.pure: $(LIB) ctest.o + purify $(CC) $(LDFLAGS) ctest.o -o ctest.pure \ + $(LLIB) $(LIBS) + +stest.pure: $(LIB) stest.o + purify $(CC) $(LDFLAGS) stest.o -o stest.pure $(LIB) \ + $(X_LIBS) -lXt $(X_PRE_LIBS) -lXext -lX11 $(LIBS) + +rtest.pure: $(LIB) rtest.o + purify $(CC) $(LDFLAGS) rtest.o -o rtest.pure \ + $(LLIB) $(LIBS) + +# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/README b/README new file mode 100644 index 0000000..52cb4cb --- /dev/null +++ b/README @@ -0,0 +1,41 @@ +This is the directory for XPA 2.0. + +The XPA messaging system provides seamless communication between many +kinds of Unix programs, including X programs and Tcl/Tk programs. It +also provides an easy way for users to communicate with XPA-enabled +programs by executing XPA client commands in the shell or by utilizing +such commands in scripts. Because XPA works both at the programming +level and the shell level, it is a powerful tool for unifying any +analysis environment: users and programmers have great flexibility in +choosing the best level or levels at which to access XPA services, and +client access can be extended or modified easily at any time. + +A program becomes an XPA-enabled server by defining named points of +public access through which data and commands can be exchanged with +other client programs (and users). Using standard TCP sockets as a +transport mechanism, XPA supports both single-point and broadcast +messaging to and from these servers. It supports direct communication +between clients and servers, or indirect communication via an +intermediate message bus emulation program. Host-based access control +is implemented, as is as the ability to communicate with XPA servers +across a network. + +XPA implements a layered interface that is designed to be useful both +to software developers and to users. The interface consists of a +library of XPA client and server routines for use in C/C++ programs and +a suite of high-level user programs built on top of these libraries. +Using the XPA library, access points can be added to Tcl/Tk programs, +Xt programs, or to Unix programs that use the XPA event loop or any +event loop based on select(). Client access subroutines can be added +to any Tcl/Tk, Xt, or Unix program. Client access also is supported at +the command line via a suite of high-level programs. + +To build XPA, see the INSTALL instructions (which are based on +standard instructions for building software using GNU configure). + +Documentation for XPA is contained in the doc subdirectory (where the +help.html file is the top-level index). + +If you have questions, please contact us at: saord@cfa.harvard.edu. + + Eric Mandel diff --git a/acl.c b/acl.c new file mode 100644 index 0000000..24b4489 --- /dev/null +++ b/acl.c @@ -0,0 +1,568 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* + * + * acl.c -- xpa access control list management + * + */ + +#include + +/* + *---------------------------------------------------------------------------- + * + * + * Private Routines + * + * + *---------------------------------------------------------------------------- + */ + +/* this is the head of the global list -- too lazy to do anything more */ +static XACL aclhead=NULL; + +#ifdef ANSI_FUNC +static XACL +XPAAclLookup (char *xclass, char *name, unsigned int ip, int exact) +#else +static XACL XPAAclLookup(xclass, name, ip, exact) + char *xclass; + char *name; + unsigned int ip; + int exact; +#endif +{ + XACL cur; + /* look for exact match */ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + if( !strcmp(xclass, cur->xclass) && + !strcmp(name, cur->name) && + ((cur->ip == 0) || (cur->ip == ip)) ){ + return(cur); + } + } + /* otherwise look for a template match (unless exact was specified) */ + if( !exact ){ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + if( tmatch(xclass, cur->xclass) && + tmatch(name, cur->name) && + ((cur->ip == 0) || (cur->ip == ip)) ){ + return(cur); + } + } + } + return(NULL); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclParse + * + * Purpose: parse acl list into components + * + * Returns: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAAclParse (char *lbuf, char *xclass, char *name, unsigned int *ip, + char *acl, int len) +#else +static int XPAAclParse(lbuf, xclass, name, ip, acl, len) + char *lbuf; + char *xclass; + char *name; + unsigned int *ip; + char *acl; + int len; +#endif +{ + char tbuf[SZ_LINE]; + int lp=0; + + /* class:name is required */ + if( word(lbuf, tbuf, &lp) ){ + XPAParseName(tbuf, xclass, name, len); + } + else + return(-1); + + /* host is required but can be "*" for "all hosts" */ + if( word(lbuf, tbuf, &lp) ){ + if( !strcmp(tbuf, "*") ) + *ip = 0; + else + *ip = gethostip(tbuf); + } + else + return(-1); + + /* acl is required */ + if( word(lbuf, tbuf, &lp) ){ + if( !strcmp(tbuf, "+") ) + strcpy(acl, XPA_ACLS); + else if( !strcmp(tbuf, "-") ) + *acl = '\0'; + else + strcpy(acl, tbuf); + return(0); + } + else + return(-1); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Semi-Public Routines (used by command.c) + * + * + *---------------------------------------------------------------------------- + */ + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveAcl + * + * Purpose: add or modify the acl for this access point + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAReceiveAcl (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +int XPAReceiveAcl(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + XPAComm comm; + int i; + int got; + char *s=NULL; + char lbuf[SZ_LINE]; + char tbuf[SZ_LINE]; + + if( paramlist && *paramlist ){ + s = paramlist; + while( isspace((int)*s) ) + s++; + snprintf(tbuf, SZ_LINE, "%s:%s %s\n", xpa->xclass, xpa->name, s); + if( XPAAclEdit(tbuf) < 0 ){ + snprintf(lbuf, SZ_LINE, "invalid acl: %s\n", tbuf); + XPAError(xpa, lbuf); + return(-1); + } + } + else{ + while((XPAGets(xpa, xpa_datafd(xpa), lbuf, SZ_LINE, XPAShortTimeout())>0)&& + *lbuf ){ + snprintf(tbuf, SZ_LINE, "%s:%s %s\n", xpa->xclass, xpa->name, lbuf); + got = XPAAclEdit(tbuf); + if( got < 0 ){ + snprintf(lbuf, SZ_LINE, "invalid acl: %s\n", tbuf); + XPAError(xpa, lbuf); + return(-1); + } + } + } + + /* reset all acl flags for this xpa so acl is recalculated */ + for(comm=xpa->commhead; comm!=NULL; comm=comm->next){ + for(i=0; i<4; i++){ + comm->acl[i] = -1; + } + } + + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendAcl + * + * Purpose: return the acl for this access point + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPASendAcl (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +int XPASendAcl(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + XACL cur; + int got = 0; + char tbuf[SZ_LINE]; + + /* zero all flags */ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + cur->flag = 0; + } + /* look for exact matches */ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + if(!strcmp(xpa->xclass, cur->xclass) && !strcmp(xpa->name, cur->name)){ + snprintf(tbuf, SZ_LINE, "%s:%s %s %s\n", + cur->xclass, cur->name, getiphost(cur->ip), cur->acl); + send(xpa_datafd(xpa), tbuf, strlen(tbuf), 0); + cur->flag = 1; + got++; + } + } + /* look for template matches that we have not printed yet */ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + if( cur->flag == 0 ){ + if(tmatch(xpa->xclass, cur->xclass) && tmatch(xpa->name, cur->name)){ + snprintf(tbuf, SZ_LINE, "%s:%s %s %s\n", + cur->xclass, cur->name, getiphost(cur->ip), cur->acl); + send(xpa_datafd(xpa), tbuf, strlen(tbuf), 0); + got++; + } + } + } + /* zero all flags */ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + cur->flag = 0; + } + if( got == 0 ){ + send(xpa_datafd(xpa), "\n", 1, 0); + } + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Public Routines + * + * + *---------------------------------------------------------------------------- + */ + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclEdit + * + * Purpose: add or modify acl entry in the xpa acl list + * + * Returns: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAclEdit (char *lbuf) +#else +int XPAAclEdit(lbuf) + char *lbuf; +#endif +{ + XACL cur; + char xclass[SZ_LINE]; + char name[SZ_LINE]; + char acl[SZ_LINE]; + unsigned int ip; + + if( XPAAclParse(lbuf, xclass, name, &ip, acl, SZ_LINE) < 0 ) + return(-1); + if( ip == 0 ) + return(-1); + cur = XPAAclLookup(xclass, name, ip, 1); + if( cur == NULL ) + return(XPAAclAdd(lbuf)); + else{ + if( *acl == '\0' ){ + XPAAclDel(cur); + } + else{ + if( cur->acl ) + xfree(cur->acl); + cur->acl = xstrdup(acl); + } + return(0); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclAdd + * + * Purpose: add one acl entry to the xpa acl list + * + * Returns: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAclAdd (char *lbuf) +#else +int XPAAclAdd(lbuf) + char *lbuf; +#endif +{ + XACL xnew; + XACL cur; + char xclass[SZ_LINE]; + char name[SZ_LINE]; + char acl[SZ_LINE]; + unsigned int ip; + + /* allocate acl struct */ + if( (xnew = (XACL)xcalloc(1, sizeof(XACLRec))) == NULL ) + goto error; + + /* parse info from line buffer */ + if( XPAAclParse(lbuf, xclass, name, &ip, acl, SZ_LINE) < 0 ) + goto error; + + /* fill in the blanks */ + xnew->xclass = xstrdup(xclass); + xnew->name = xstrdup(name); + xnew->ip = ip; + xnew->acl = xstrdup(acl); + + /* add this acl to end of list of acl's */ + if( aclhead == NULL ){ + aclhead = xnew; + } + else{ + for(cur=aclhead; cur->next!=NULL; cur=cur->next) + ; + cur->next = xnew; + } + return(0); + +error: + if( xnew ) + xfree(xnew); + return(-1); +} + +/* + *--------------------------------------------------------------------------- + * + * Routine: XPAAclDel + * + * Purpose: free up memory in the acl record structure + * + * Results: 0 on success, -1 for failure + * + *--------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAclDel (XACL acl) +#else +int XPAAclDel(acl) + XACL acl; +#endif +{ + XACL cur; + + if( acl == NULL ) + return(-1); + + /* remove from list of acl's */ + if( aclhead ){ + if( aclhead == acl ){ + aclhead = aclhead->next; + } + else{ + for(cur=aclhead; cur!=NULL; cur=cur->next){ + if( cur->next == acl ){ + cur->next = (cur->next)->next; + break; + } + } + } + } + + /* free up string space */ + if( acl->xclass ) xfree(acl->xclass); + if( acl->name ) xfree(acl->name); + if( acl->acl ) xfree(acl->acl); + + /* free up record struct */ + xfree((char *)acl); + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclFree + * + * Purpose: + * + * Results: 1 on success, 0 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +void +XPAAclFree (void) +#else +void XPAAclFree() +#endif +{ + XACL cur, tacl; + + for(cur=aclhead; cur!=NULL; ){ + tacl = cur->next; + XPAAclDel(cur); + cur = tacl; + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclNew + * + * Purpose: read or re-read the acl list + * + * Results: number of lines in list (including default) + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAclNew (char *aname, int flag) +#else +int XPAAclNew(aname, flag) + char *aname; + int flag; +#endif +{ + int got=0; + char lbuf[SZ_LINE]; + char hostname[SZ_LINE]; + char *s; + char *obuf; + char *aclname=NULL; + char *aclpath=NULL; + char *defacl=NULL; + char *defcopy=NULL; + char *keywords[10]; + char *values[10]; + int nkeys; + FILE *fp=NULL; + + /* if there is an old list, free it */ + if( flag == 0 ) + XPAAclFree(); + + /* get acl file name */ + if( aname && *aname ) + aclname = aname; + else if( (aclname=(char *)getenv("XPA_ACLFILE")) == NULL ) + aclname = XPA_ACLFILE; + + /* get the default acl */ + if( (defacl=(char *)getenv("XPA_DEFACL")) == NULL ) + defacl = XPA_DEFACL; + + /* macro-expand it to deal with the host name */ + gethost(hostname, SZ_LINE); + nkeys = 0; + keywords[0] = "host"; values[0] = hostname; nkeys++; + + /* open the acl file */ + if( (aclpath=(char *)Access(aclname, "r")) != NULL ){ + if( (fp=fopen(aclpath, "r")) != NULL ){ + while( fgets(lbuf, SZ_LINE, fp) ){ + if( *lbuf == '#' ){ + continue; + } + if( (obuf=macro(lbuf, keywords, values, nkeys, NULL, NULL)) != NULL ){ + if( XPAAclAdd(obuf) == 0 ) + got++; + xfree(obuf); + } + } + fclose(fp); + } + xfree(aclpath); + } + + /* add default acl (it very likely was overridden in the file) */ + defcopy=(char *)xstrdup(defacl); + for(s=(char *)strtok(defcopy,";"); s!=NULL; s=(char *)strtok(NULL,";")){ + if( (obuf = macro(s, keywords, values, nkeys, NULL, NULL)) != NULL ){ + if( XPAAclAdd(obuf) == 0 ) + got++; + xfree(obuf); + } + } + if( defcopy) xfree(defcopy); + + /* return the news */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAclCheck + * + * Purpose: validate an acl for a given class, name, and host + * + * Results: 1 on success, 0 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAclCheck (XPA xpa, unsigned int ip, char *acl) +#else +int XPAAclCheck(xpa, ip, acl) + XPA xpa; + unsigned int ip; + char *acl; +#endif +{ + char *s; + XACL cur; + + if( !(cur = XPAAclLookup(xpa->xclass, xpa->name, ip, 0)) ) + return(0); + else if( cur->acl == NULL ) + return(0); + else{ + for(s=acl; *s; s++){ + if( !strchr(cur->acl, *s) ) + return(0); + } + return(1); + } +} diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..bc7540d --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1 @@ +builtin(include,tcl.m4) diff --git a/client.c b/client.c new file mode 100644 index 0000000..f70ff40 --- /dev/null +++ b/client.c @@ -0,0 +1,3057 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +#include + +/* + *---------------------------------------------------------------------------- + * + * + * Private Routines and Data + * + * + *---------------------------------------------------------------------------- + */ + +/* this is the head of the global list of client xpas */ +static XPA xpaclienthead=NULL; + +static char errbuf[SZ_LINE]; /* holds current error message */ +static int id=0; /* id of current command */ + +#define DATA_CONNECT 1 +#define DATA_ACCEPT 2 +#define DATA_DATA 4 + +/* use of a double fork() call is used to prevent zombies which happen + if fork is a child of xpans started by an XPA server (i.e., for some + reason, the SIGCHLD signal does not get sent to xpans parent) + See Stevens, Advanced Programming in te Unix Environment, p. 202 */ +#define USE_DOUBLE_FORK 1 +#ifndef USE_DOUBLE_FORK +#ifdef ANSI_FUNC +void sig_chld(int signo) +#else +#endif +{ + int stat; + + while(waitpid(-1, &stat, WNOHANG) > 0){ + ; + } + return; +} +#endif + +/* + *---------------------------------------------------------------------------- + * + * Routine: rdl + * + * Purpose: read characters up a new-line + * + * Returns: number of characters read + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +rdl (int fd, char *buf, size_t len) +#else +static int rdl(fd, buf, len) + int fd; + char *buf; + int len; +#endif +{ + int i=0; + int got; + + /* start out clean */ + *buf = '\0'; + + /* make sure we have a valid channel */ + if( fd < 0 ) + return(-1); + + /* grab characters up to a new-line or max len */ + while( i < (len-1) ){ + got = read(fd, &(buf[i]), 1); + if( got < 1 ) + break; + else if( buf[i++] == '\n' ) + break; + } + buf[i] = '\0'; + return(i); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAProxyAccept + * + * Purpose: accept a connection from an XPA proxy server + * + * Return: fd of accepted connection or -1 + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static +int XPAProxyAccept(XPA xpa, char *method, char *xclass, char *name, int ifd, + unsigned int *rip, unsigned short *rport, char *rname) +#else +static +int XPAProxyAccept(xpa, method, xclass, name, ifd, rip, rport, rname) + XPA xpa; + char *method; + char *xclass; + char *name; + int ifd; + unsigned int *rip; + unsigned short *rport; + char *rname; +#endif +{ + int sock; + int got; + int oum; + int ofd; + int niter; + int swidth=FD_SETSIZE; + int keep_alive=1; + int reuse_addr=1; + unsigned int ip; + unsigned short port; + char tbuf[SZ_LINE]; + char amethod[SZ_LINE]; + char *tptr; + socklen_t slen; + struct sockaddr_in sock_in; +#if HAVE_SYS_UN_H + struct sockaddr_un sock_un; +#endif + struct timeval tv; + struct timeval *tvp; + fd_set readfds; + + /* initialize results */ + if( rip ) *rip = 0; + if( rport ) *rport = 0; + if( rname ) *rname = '\0'; + + switch(XPAMethod(method)){ + case XPA_INET: + if( !XPAParseIpPort(method, &ip, &port) ){ + goto error; + } + /* open a socket for data connections */ + if( (sock = xsocket(AF_INET, SOCK_STREAM, 0)) < 0 ){ + PERROR(("xpaaccept socket")); + goto error; + } + setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, + (char *)&reuse_addr, sizeof(reuse_addr)); + memset((char *)&sock_in, 0, sizeof(sock_in)); + sock_in.sin_family = AF_INET; + sock_in.sin_addr.s_addr = htonl(INADDR_ANY); + sock_in.sin_port = htons(port); + /* bind to the ip:port */ + if( xbind(sock, (struct sockaddr *)&sock_in, sizeof(sock_in)) < 0 ){ + PERROR(("xpaaccept bind")); + xclose(sock); + goto error; + } + snprintf(amethod, SZ_LINE, "%x:%d", ip, port); + break; +#if HAVE_SYS_UN_H + case XPA_UNIX: + ip = 0; + port = 0; + /* get filename part, composed of class and name and unique id */ + snprintf(tbuf, SZ_LINE, "%s_%s.%d", xclass, name, (int)time(NULL)); + /* change "/" to "_" for filename */ + for(tptr = tbuf; *tptr != '\0'; tptr++){ + if( *tptr == '/' ) *tptr = '_'; + } + /* create full pathname */ + snprintf(amethod, SZ_LINE, "%s/%s", XPATmpdir(), tbuf); + /* delete old copy */ + unlink (amethod); + /* open a socket and fill in socket information */ + if( (sock = xsocket(AF_UNIX, SOCK_STREAM, 0)) < 0 ){ + goto error; + } + setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + memset((char *)&sock_un, 0, sizeof(sock_un)); + sock_un.sun_family = AF_UNIX; + strcpy(sock_un.sun_path, amethod); + /* unset umask so that everyone can read and write */ + oum = umask(0); + /* bind to the file */ + got = xbind(sock, (struct sockaddr *)&sock_un, sizeof(sock_un)); + /* reset umask to previous */ + umask(oum); + /* now check for bind error */ + if( got < 0 ){ + xclose(sock); + goto error; + } + break; +#endif + default: + goto error; + } + + /* send port to client so they can connect */ + /* first listen for the connection */ + if( listen(sock, XPA_MAXLISTEN) < 0 ){ + PERROR(("xpaaccept listen")); + xclose(sock); + goto error; + } + + /* and tell the client that we are listening */ + snprintf(tbuf, SZ_LINE, "xpaaccept %s (%s:%s %s)\n", + amethod, xclass, name, method); + FPRINTF((stderr, "%sXPAProxyAccept: sending command to %d:\n%s", + _sp, ifd, tbuf)); + if( XPAPuts(NULL, ifd, tbuf, XPAShortTimeout()) <= 0 ){ + PERROR(("client xpaaccept write")); + xclose(sock); + goto error; + } + + /* we will iterate on xselect */ + if( XPAShortTimeout() > 0 ) + niter = XPAShortTimeout()*100; + else + niter = XPA_SHORT_TIMEOUT*100; +again: + /* this has to be able to time out */ + tv.tv_sec = 0; + tv.tv_usec = 10000; + tvp = &tv; + /* wait for this socket and XPA sockets */ + FD_ZERO(&readfds); + FD_SET(sock, &readfds); + XPAAddSelect(NULL, &readfds); + /* wait for the connection */ + got = xselect(swidth, &readfds, NULL, NULL, tvp); + /* process results of select */ + if( got > 0 ){ + if( !FD_ISSET(sock, &readfds)){ + XPAProcessSelect(&readfds, 0); + goto again; + } + switch(XPAMethod(method)){ + case XPA_INET: + while( 1 ){ + slen = sizeof(struct sockaddr_in); + if((ofd=xaccept(sock, (struct sockaddr *)&sock_in, &slen)) >= 0){ + break; + } + else{ + if( xerrno == EINTR ) + continue; + else{ + PERROR(("xpaaccept acccept")); + xclose(sock); + goto error; + } + } + } + break; +#if HAVE_SYS_UN_H + case XPA_UNIX: + while( 1 ){ + slen = sizeof(struct sockaddr_un); + if((ofd=xaccept(sock, (struct sockaddr *)&sock_un, &slen)) >= 0){ + break; + } + else{ + if( xerrno == EINTR ) + continue; + else{ + PERROR(("xpaaccept acccept")); + xclose(sock); + goto error; + } + } + } + break; +#endif + default: + xclose(sock); + goto error; + } + } + /* timeout? */ + else if( got == 0 ){ + if( --niter > 0 ){ + goto again; + } + else{ + xclose(sock); + FPRINTF((stderr, "%sXPAProxyAccept: select timed out\n", _sp)); + goto error; + } + } + /* error */ + else{ + if( xerrno == EINTR ){ + PERROR(("xpaaccept select")); + goto again; + } + else{ + xclose(sock); + goto error; + } + } + /* done with listening */ + xclose(sock); + + /* fill in return information */ + if( rip ) *rip = ip; + if( rport ) *rport = port; + if( rname ){ + strncpy(rname, amethod, SZ_LINE-1); + rname[SZ_LINE-1] = '\0'; + } + return(ofd); + +error: + return(-1); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientNewInput + * + * Purpose: allocate a new input struct for reading data from stdin + * + * Return: input struct, or NULL on error + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static XPAInput +XPAClientNewInput(XPA xpa) +#else +static XPAInput XPAClientNewInput(xpa) + XPA xpa; +#endif +{ + XPAInput xnew, inp; + + /* allocate a new record */ + if( (xnew=(XPAInput)xcalloc(1, sizeof(XPAInputRec))) == NULL ){ + return(NULL); + } + /* allocate the data buffer */ + xnew->buf = (char *)xmalloc(XPA_BIOSIZE); + /* this buffer starts (and currently ends) at the current byte count */ + xnew->start = xpa->inpbytes; + xnew->end = xpa->inpbytes; + xnew->bytes = 0; + + /* add this input to end of list of input's */ + if( xpa->inphead == NULL ){ + xpa->inphead = xnew; + } + else{ + for(inp=xpa->inphead; inp->next!=NULL; inp=inp->next) + ; + inp->next = xnew; + } + + /* return the record struct */ + return(xnew); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientFreeInput + * + * Purpose: free a input buffer once its been sent to all targets + * + * Return: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static void +XPAClientFreeInput (XPA xpa, XPAInput inp) +#else +static void XPAClientFreeInput(xpa, inp) + XPA xpa; + XPAInput inp; +#endif +{ + XPAInput cur; + + if( !xpa || !inp ) + return; + + if( inp == xpa->inphead ){ + xpa->inphead = inp->next; + } + else{ + for(cur=xpa->inphead; cur!=NULL; cur=cur->next){ + if( cur->next == inp ){ + cur->next = inp->next; + break; + } + } + } + + /* free current record */ + if( inp != NULL ){ + if( inp->buf != NULL ) + xfree(inp->buf ); + xfree(inp); + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientFreeAllInputs + * + * Purpose: free remaining input buffers + * + * Return: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static void +XPAClientFreeAllInputs (XPA xpa) +#else +static void XPAClientFreeAllInputs(xpa) + XPA xpa; +#endif +{ + XPAInput cur, tmp; + + if( !xpa ) + return; + + for(cur=xpa->inphead; cur!=NULL; ){ + tmp = cur->next; + XPAClientFreeInput(xpa, cur); + cur = tmp; + } + xpa->inpbytes = 0; +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientProcessInput + * + * Purpose: read input from stdin and store in an input struct + * + * Return: bytes read + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientProcessInput(XPA xpa) +#else +static int XPAClientProcessInput(xpa) + XPA xpa; +#endif +{ + static XPAInput cur=NULL; + int get, got; + + /* set up next buffer, if necessary */ + for(cur=xpa->inphead; cur!=NULL; cur=cur->next){ + if( cur->bytes < XPA_BIOSIZE ) + break; + } + if( cur == NULL ){ + cur = XPAClientNewInput(xpa); + } + + /* read data from stdin */ + get = MIN(XPA_IOSIZE, XPA_BIOSIZE - cur->bytes); + if( isatty(xpa->ifd) ){ + got = rdl(xpa->ifd, &(cur->buf[cur->bytes]), get); + } + else{ + got = read(xpa->ifd, &(cur->buf[cur->bytes]), get); + } + switch(got){ + case -1: + if( XPAVerbosity() ){ + PERROR(("XPA client read")); + } + return(0); + case 0: + xpa->ifd = -1; + FPRINTF((stderr, "%sXPAClientProcessInput: signalling EOF\n", _sp)); + break; + default: + break; + } + cur->bytes += got; + cur->end += got; + xpa->inpbytes += got; +#ifdef FIXEDBYCYGWIN +#if HAVE_CYGWIN + /* on non-NT Windows machines, Cygwin select() does not work once a pipe + gets EOF. It should show the fd ready for reading (and read 0 bytes), + but does not, so we have to hack a manual check */ + /* GetVersion is a Windows call */ + if( GetVersion() >= 0x80000000L ){ + if( got < get ){ + xpa->ifd = -1; + } + } +#endif +#endif + + /* verify to stdout, if necessary */ + if( xpa->client_mode & XPA_CLIENT_VERIFY ){ + fwrite(&(cur->buf[cur->bytes-got]), sizeof(char), got, stdout); + } + + /* return the number of bytes just read */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientFree + * + * Purpose: free a client record and remove from list + * + * Returns: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static void +XPAClientFree (XPA xpa, XPAClient client) +#else +static void XPAClientFree(xpa, client) + XPA xpa; + XPAClient client; +#endif +{ + XPAClient cur; + + /* remove from list of xpa's */ + if( xpa->clienthead ){ + if( xpa->clienthead == client ){ + xpa->clienthead = client->next; + } + else{ + for(cur=xpa->clienthead; cur!=NULL; cur=cur->next){ + if( cur->next == client ){ + cur->next = client->next; + break; + } + } + } + } + + if( client->cmdfd >= 0 ){ +#if HAVE_CYGWIN + shutdown(client->cmdfd, SHUT_RDWR); +#endif + xclose(client->cmdfd); + } + if( client->datafd >= 0 ){ +#if HAVE_CYGWIN + shutdown(client->datafd, SHUT_RDWR); +#endif + xclose(client->datafd); + } + if( client->dataname ){ + unlink(client->dataname); + xfree(client->dataname); + } + if( client->method ) + xfree(client->method); + if( client->info ) + xfree(client->info); + if( client->xtemplate ) + xfree(client->xtemplate); + if( client->xclass ) + xfree(client->xclass); + if( client->name ) + xfree(client->name); + if( client->id ) + xfree(client->id); + /* xpaget's fd mode has an alloc'ed bufptr and lenptr */ + if( (client->type == 'g') && (client->mode & XPA_CLIENT_FD) ){ + if( client->bufptr && *(client->bufptr) ) + xfree(*(client->bufptr)); + if( client->bufptr ) + xfree(client->bufptr); + if( client->lenptr ) + xfree(client->lenptr); + } + xfree(client); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientDataSent + * + * Purpose: data is sent, so close data channel and change status to + * signal that we are waiting for the server + * + * Returns: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static void +XPAClientDataSent (XPA xpa, XPAClient client) +#else +static void XPAClientDataSent(xpa, client) + XPA xpa; + XPAClient client; +#endif +{ + FPRINTF((stderr, "%sXPAClientDataSent: for cmd %d data %d\n", _sp, + client->cmdfd, client->datafd)); + /* close the data channel, which should trigger a result from the server */ + if( client->datafd >= 0 ){ +#if HAVE_CYGWIN + shutdown(client->datafd, SHUT_RDWR); +#endif + xclose(client->datafd); + client->datafd = -1; + } + /* we are now waiting for the server to complete the calllback */ + client->status = XPA_CLIENT_WAITING; +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientEnd + * + * Purpose: finish up with this client + * + * Returns: error message or null + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static char * +XPAClientEnd (XPA xpa, XPAClient client) +#else +static char *XPAClientEnd(xpa, client) + XPA xpa; + XPAClient client; +#endif +{ + char *error=NULL; + char *eptr; + + FPRINTF((stderr, "%sXPAClientEnd: for cmd %d data %d\n", _sp, + client->cmdfd, client->datafd)); + /* always read the status line -- if we are not ack'ing, we'll get an + OK from the server before the calllback and we can exit quickly */ + /* don't do this if client is xpainfo and we're not ack'ing */ + if( !((client->type == 'i') && !(client->mode & XPA_CLIENT_ACK)) ){ +retry: + if( XPAGets(NULL, client->cmdfd, errbuf, SZ_LINE, XPALongTimeout()) >0 ){ + FPRINTF((stderr, "%sXPAClientEnd: read %s\n", _sp, errbuf)); + eptr = errbuf; + /* this should never happen */ + if( *eptr == '?' ){ + snprintf(errbuf, SZ_LINE, + "XPA$WARNING: protocol mismatch - missing id\n%s", eptr); + error = NULL; + } + else{ + /* make sure we are dealing with a proper message */ + if( strncmp(eptr, client->id, strlen(client->id)) ){ + if( XPAVerbosity() > 1 ){ + fprintf(stderr, + "XPA$WARNING: ignoring out of sync server message:\n"); + fprintf(stderr, "%s", errbuf); + } + goto retry; + } + /* go past id */ + eptr += strlen(client->id); + while( isspace((int)*eptr) ) eptr++; + if( !strncmp(eptr, "XPA$OK", 6) ){ + error = NULL; + } + else{ + error = eptr; + } + } + } + else{ + if( XPAVerbosity() > 1 ){ + fprintf(stderr, + "XPA$WARNING: no reply from server callback (assuming OK)\n"); + } + error = NULL; + } + } + else + error = NULL; + + /* store the error return */ + if( client->errptr ) + *(client->errptr) = xstrdup(error); + + /* remove this client if we are not meant to persist */ + if( !xpa->persist ){ + XPAClientFree(xpa, client); + } + /* otherwise mark as inactive */ + else{ + client->status = XPA_CLIENT_IDLE; + client->bytes = 0; + } + + /* return error status */ + return(error); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientNew + * + * Purpose: allocate a new xpa client + * + * Returns: xpa client struct + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static XPAClient +XPAClientNew (XPA xpa, char *mode, char *xtemplate, int type, + char *xclass, char *name, char *method, char *info) +#else +static XPAClient XPAClientNew(xpa, mode, xtemplate, type, + xclass, name, method, info) + XPA xpa; + char *mode; + char *xtemplate; + int type; + char *xclass; + char *name; + char *method; + char *info; +#endif +{ + XPAClient xnew, client; + struct sockaddr_in sock_in; +#if HAVE_SYS_UN_H + struct sockaddr_un sock_un; +#endif + char xmode[SZ_LINE]; + char tbuf[SZ_LINE]; + char amethod[SZ_LINE]; + char *s=NULL; + unsigned short port; + unsigned int ip=0; + int fd; + int pfd; + int tries=0; + int nsproxy=0; + int keep_alive=1; + + FPRINTF((stderr, "%sXPAClientNew: entering with %s %s %s %s\n", _sp, + xclass, name, method, info)); + + /* no errors as yet */ + *errbuf = '\0'; + + /* look for reuse of xpans fd (used in conjunction with the xpans proxy) */ + *xmode = '\0'; + if( mode ){ + strncpy(xmode, mode, SZ_LINE-1); + xmode[SZ_LINE-1] = '\0'; + } + if( keyword(xmode, "nsproxy", tbuf, SZ_LINE) ){ + nsproxy = 1; + pfd = strtol(tbuf, &s, 0); + fd = XPAProxyAccept(xpa, XPANSMethod(NULL,2), + xclass, name, pfd, &ip, &port, amethod); + /* make sure we got a valid int fd */ + if( fd < 0 ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server on proxyaccept (%s:%s%s)\n", + xclass, name, XPATimestamp()); + FPRINTF((stderr, "%sXPAClientNew: %s", _sp, errbuf)); + PERROR(("XPAClientNew")); + return(NULL); + } + } + /* normal usage: connect to server */ + else{ + switch(XPAMethod(method)){ + case XPA_INET: +again1: + if( !XPAParseIpPort(method, &ip, &port) ) + return(NULL); + /* use $localhost over $host (we do not trust host to be correct) */ + if( (ip == gethostip("$host")) && (tries == 0) ) + ip = gethostip("$localhost"); + /* connect to the server before we go further */ + if( (fd = xsocket(AF_INET, SOCK_STREAM, 0)) < 0 ){ + return(NULL); + } + setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + memset((char *)&sock_in, 0, sizeof(sock_in)); + sock_in.sin_family = AF_INET; + sock_in.sin_addr.s_addr = htonl(ip); + sock_in.sin_port = htons(port); + /* make the connection with the server */ + if( connect(fd, (struct sockaddr *)&sock_in, sizeof(sock_in)) <0 ){ + xclose(fd); + /* if localhost doesn't work, make one try with the host ip */ + /* we also try again just in case there was an odd error such + as "permission denied", which we have seen once or twice */ + if( tries < 2 ){ + tries++; + goto again1; + } + /* give up */ + else{ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server on connect (%s:%s%s)\n", + xclass, name, XPATimestamp()); + PERROR(("XPAClientNew")); + return(NULL); + } + } + /* make sure we close on exec */ + xfcntl(fd, F_SETFD, FD_CLOEXEC); + FPRINTF((stderr, "%sXPAClientNew: inet connect returns fd %d\n", + _sp, fd)); + break; +#if HAVE_SYS_UN_H + case XPA_UNIX: +again2: + /* open a socket and fill in socket information */ + if( (fd = xsocket(AF_UNIX, SOCK_STREAM, 0)) < 0 ){ + return(NULL); + } + setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + memset((char *)&sock_un, 0, sizeof(sock_un)); + sock_un.sun_family = AF_UNIX; + strcpy(sock_un.sun_path, method); + /* make the connection with the server */ + if( connect(fd, (struct sockaddr *)&sock_un, sizeof(sock_un)) <0 ){ + xclose(fd); + /* Unix sockets get ECONNREFUSED when the listen queue is full, + so we try a few times to give the server a chance to recover */ + if( (xerrno == ECONNREFUSED) && (tries < XPA_RETRIES) ){ + tries++; + XPASleep(10); + goto again2; + } + /* give up */ + else{ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server on connect (%s:%s%s)\n", + xclass, name, XPATimestamp()); + PERROR(("XPAClientNew")); + return(NULL); + } + } + /* make sure we close on exec */ + xfcntl(fd, F_SETFD, FD_CLOEXEC); + FPRINTF((stderr, "%sXPAClientNew: unix connect returns fd %d\n", + _sp, fd)); + break; +#endif + default: + return(NULL); + } + strncpy(amethod, method, SZ_LINE-1); + amethod[SZ_LINE-1] = '\0'; + } + + /* allocate new send record */ + if( (xnew=(XPAClient)xcalloc(1, sizeof(XPAClientRec))) == NULL ){ + xclose(fd); + return(NULL); + } + + /* fill in the blanks */ + xnew->xtemplate = xstrdup(xtemplate); + xnew->type = type; + xnew->cmdfd = fd; + xnew->datafd = -1; + xnew->xclass = xstrdup(xclass); + xnew->name = xstrdup(name); + xnew->method = xstrdup(amethod); + xnew->info = xstrdup(info); + xnew->ip = ip; + xnew->nsproxy = nsproxy; + xnew->status = XPA_CLIENT_ACTIVE; + + /* now that we have a valid client, add to list */ + if( xpa->clienthead == NULL ){ + xpa->clienthead = xnew; + } + else{ + for(client=xpa->clienthead; client->next!=NULL; client=client->next) + ; + client->next = xnew; + } + FPRINTF((stderr, "%sXPAClientNew: new fd %d\n", _sp, xnew->cmdfd)); + /* return the good news */ + return(xnew); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientAddSelect + * + * Purpose: add one or more xpa client sockets to the select flags + * + * Return: number of clients that were added to the select flags + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAClientAddSelect (XPA xpa, fd_set *readfdsptr, fd_set *writefdsptr) +#else +int XPAClientAddSelect(xpa, readfdsptr, writefdsptr) + XPA xpa; + fd_set *readfdsptr; + fd_set *writefdsptr; +#endif +{ + XPAClient client; + int got=0; + int loop=0; + + /* better have some place to set the flags */ + if( readfdsptr == NULL ) + return(0); + + /* if no xpa is specified, do them all */ + if( xpa == NULL ){ + if( xpaclienthead == NULL ) return(0); + xpa = xpaclienthead; + loop = 1; + } + +loop: + /* set select flags for all clients */ + for(client=xpa->clienthead; client!=NULL; client=client->next){ + /* if this client is processing */ + if( (client->status == XPA_CLIENT_PROCESSING) && (client->datafd >= 0) ){ + if( client->type == 'g' ){ + FPRINTF((stderr, "%sXPAClientAddSelect(get): adding fd %d\n", _sp, + client->datafd)); + FD_SET(client->datafd, readfdsptr); + got++; + } + else if( client->type == 's' ){ + FPRINTF((stderr, "%sXPAClientAddSelect(set): adding fd %d\n", _sp, + client->datafd)); + FD_SET(client->datafd, writefdsptr); + got++; + } + } + /* if this client is waiting */ + else if( (client->status == XPA_CLIENT_WAITING) && (client->cmdfd >= 0) ){ + FPRINTF((stderr, "%sXPAClientAddSelect(waiting): adding fd %d\n", _sp, + client->cmdfd)); + FD_SET(client->cmdfd, readfdsptr); + got++; + } + } + /* loop if necessary */ + if( loop && (xpa=xpa->next) ) goto loop; + /* return the news */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientGet + * + * Purpose: process an xpaget request for a given client + * + * Return: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientGet (XPA xpa, XPAClient client) +#else +static int XPAClientGet(xpa, client) + XPA xpa; + XPAClient client; +#endif +{ + int status; + char tbuf[SZ_LINE]; + + /* allocate the first buffer, if necessary */ + if( *(client->bufptr) == NULL ){ + client->bufsize = XPA_IOSIZE; + *(client->bufptr) = (char *)xmalloc(client->bufsize); + *(client->lenptr) = 0; + } + if( (*(client->lenptr) + XPA_IOSIZE) > client->bufsize ){ + client->bufsize += (XPA_IOSIZE*10); + *(client->bufptr) = (char *)xrealloc(*(client->bufptr), client->bufsize); + } + + /* now retrieve the data from the server */ + status = recv(client->datafd, *(client->bufptr) + *(client->lenptr), + XPA_IOSIZE, 0); + /* status < 0 means error */ + switch(status){ + /* error */ + case -1: + /* socket would block */ + if((xerrno == EINPROGRESS) || (xerrno == EWOULDBLOCK)){ + return(0); + } + /* clean up after error */ + if( *(client->bufptr) ){ + xfree(*(client->bufptr)); + *(client->bufptr) = NULL; + client->bufsize = 0; + } + *(client->lenptr) = 0; + XPAClientDataSent(xpa, client); +#ifdef OLD + (void)XPAClientEnd(xpa, client); + /* we need to flag some sort of error, if nothing came across */ + if( *(client->errptr) == NULL ){ + *(client->errptr) = xstrdup( + "XPA$ERROR: incomplete transmission from server\n"); + } +#endif + break; + /* eof */ + case 0: + /* if we have multiple clients, we now need to write this one */ + if( client->mode & XPA_CLIENT_FD ){ + if( xpa->nclient > 1 ){ + snprintf(tbuf, SZ_LINE, "XPA$BEGIN %s:%s %s\n", + client->xclass, client->name, client->method); + write(client->fd, tbuf, strlen(tbuf)); + } + write(client->fd, *(client->bufptr), *(client->lenptr)); + if( xpa->nclient > 1 ){ + snprintf(tbuf, SZ_LINE, "XPA$END %s:%s %s\n", + client->xclass, client->name, client->method); + write(client->fd, tbuf, strlen(tbuf)); + } + /* we can free buf, since its not being passed back */ + if( *(client->bufptr) ){ + xfree(*(client->bufptr)); + *(client->bufptr) = NULL; + client->bufsize = 0; + } + } + else{ + /* set final buffer size and put a convenience null at the end */ + if( *(client->bufptr) ){ + client->bufsize = *(client->lenptr)+1; + *(client->bufptr) = (char *)xrealloc(*(client->bufptr),client->bufsize); + *(*(client->bufptr)+*(client->lenptr)) = '\0'; + } + } + /* for all clients, we need to clean up */ + XPAClientDataSent(xpa, client); +#ifdef OLD + (void)XPAClientEnd(xpa, client); +#endif + break; + /* status > 0: bytes read */ + default: + *(client->lenptr) += status; + /* for single client fd mode, we write immediately -- this deals with + the important case of one client with a large amount of data */ + if( (client->mode & XPA_CLIENT_FD) && (xpa->nclient == 1) ){ + write(client->fd, *(client->bufptr), *(client->lenptr)); + /* reset buf for next read */ + if( *(client->bufptr) ) xfree(*(client->bufptr)); + *(client->bufptr) = NULL; + *(client->lenptr) = 0; + } + break; + } + return(status); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientSet + * + * Purpose: process an xpaset request for a given client + * + * Return: 0 on success, -1 on failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientSet (XPA xpa, XPAClient client) +#else +static int XPAClientSet(xpa, client) + XPA xpa; + XPAClient client; +#endif +{ + int status; + int left; + int got; + int len; + XPAInput inp; + + if( client->mode & XPA_CLIENT_BUF ){ + while( 1 ){ + len = MIN(XPA_IOSIZE, client->len - client->bytes); + /* see if we have written it all */ + if( len == 0 ){ + status = 1; + goto done; + } + /* write the next chunk */ + FPRINTF((stderr, + "%sXPAClientSet: fd %d sending %lu bytes (%lu - %lu)\n", _sp, + client->datafd, (unsigned long)len, + (unsigned long)client->len, (unsigned long)client->bytes)); + got=send(client->datafd, &(client->buf[client->bytes]), len, 0); + if( got >= 0 ){ + client->bytes += got; + if( XPALevelGet() >0 ) + return(got); + } + else{ + PERROR(("XPAClientSet")); + /* check for error */ + if( (xerrno != EWOULDBLOCK) && (xerrno != EAGAIN) ){ + status = -1; + goto done; + } + /* write would block, so we return and wait the server */ + else{ + return(0); + } + } + } + } + /* reading from stdin and writing to servers */ + else{ + /* find the input buf that contains the data we need */ + for(inp=xpa->inphead; inp!=NULL; inp=inp->next){ + if( (client->bytes >= inp->start) && (client->bytes < inp->end) ){ + break; + } + } + /* if we can't find a buffer ... */ + if( !inp ){ + /* ... and we have all the input, we are done */ + if( xpa->ifd < 0 ){ + FPRINTF((stderr, "%sXPAClientSet: all data read\n", _sp)); + status = 1; + goto done; + } + /* ... but there is more input to come, return */ + else{ + return(0); + } + } + /* optimization: don't write a buffer until its full (or until eof) */ + if( (xpa->ifd >=0) && (inp->bytes < XPA_BIOSIZE) ){ + return(0); + } + + /* write bytes until we would block or until end of this buffer, etc */ + while( 1 ){ + len = MIN(XPA_IOSIZE, inp->end - client->bytes); + FPRINTF((stderr, "%sXPAClientSet: has %lu=min(%d,(%lu-%lu)) [%d]\n", + _sp, (unsigned long)len, XPA_IOSIZE, + (unsigned long)inp->end, (unsigned long)client->bytes, + client->status)); + /* if we are done with this buffer, just return */ + if( (client->status == XPA_CLIENT_PROCESSING) && (len <=0) ){ + /* see if everyone else is done with this buffer as well, + in which case we can free it */ + left = 0; + for(client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type != 's') || !(client->mode & XPA_CLIENT_FD) ) + continue; + /* in order to be totally written out, the following must be true: + * 1. send->bytes must be past the end of this buffer + * and + * 2. this buffer must be filled or else we hit eof + */ + FPRINTF((stderr, + "%sXPAClientSet: %lu>=%lu && ((%lu>=%d) or %d<0)) .. ", + _sp, client->bytes, (unsigned long)inp->end, + (unsigned long)inp->bytes, XPA_BIOSIZE, + xpa->ifd)); + if( (client->bytes >= inp->end) && + ((inp->bytes >= XPA_BIOSIZE) || (xpa->ifd < 0)) ){ + /* buffer complete written */ + FPRINTF((stderr, "%sEOF (%lu)\n", + _sp, (unsigned long)xpa->inpbytes)); + ; + } + else{ + FPRINTF((stderr, "%s\n", _sp)); + /* buffer not complete written */ + left++; + break; + } + } + /* if nothing is left, we can free this input struct */ + if( !left ){ + XPAClientFreeInput(xpa, inp); + } + return(0); + } + /* write to the server */ + FPRINTF((stderr, + "%sXPAClientSet: fd %d sending %lu bytes (%lu):\n", _sp, + client->datafd, + (unsigned long)len, (unsigned long)client->bytes)); + got = send(client->datafd, &(inp->buf[client->bytes-inp->start]),len,0); + /* check for success */ + if( got >= 0 ){ + /* update the number of bytes we wrote */ + client->bytes += got; + FPRINTF((stderr, "%sXPAClientSet: sent %lu bytes (total is %lu)\n", + _sp, (unsigned long)got, (unsigned long)client->bytes)); + /* go back for more */ + if( XPALevelGet() >0 ) + return(got); + else + continue; + } + /* check for error */ + else{ + PERROR(("XPAClientSet")); + /* anything but a "would block" error is bad */ + if( (xerrno != EWOULDBLOCK) && (xerrno != EAGAIN) ){ + status = -1; + goto done; + } + /* write would block, so we return and wait the server */ + else{ + FPRINTF((stderr, "%sXPAClientSet: waiting for more data\n", _sp)); + return(0); + } + } + } + } + +done: + XPAClientDataSent(xpa, client); +#ifdef OLD + (void)XPAClientEnd(xpa, client); +#endif + return(status); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientProcessSelect + * + * Purpose: process xpas that have pending reads or writes + * + * Return: number of xpas processed + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAClientProcessSelect (XPA xpa, + fd_set *readfdsptr, fd_set *writefdsptr, int maxreq) +#else +int XPAClientProcessSelect(xpa, readfdsptr, writefdsptr, maxreq) + XPA xpa; + fd_set *readfdsptr; + fd_set *writefdsptr; + int maxreq; +#endif +{ + int got=0; + int loop=0; + XPAClient client; + + /* <= 0 means do all of them */ + if( maxreq < 0 ){ + maxreq = 0; + } + + /* if no xpa is specified, do them all */ + if( xpa == NULL ){ + if( xpaclienthead == NULL ) return(0); + xpa = xpaclienthead; + loop = 1; + } + +loop: + /* first process any new input before we write output */ + if( xfd_isset_stdin(xpa->ifd, readfdsptr) ){ + xfd_clr_stdin(xpa->ifd, readfdsptr); + XPAClientProcessInput(xpa); + } + /* look at all clients */ +again: + for(client=xpa->clienthead; client!=NULL; client=client->next){ + /* if we are processing */ + if( (client->status == XPA_CLIENT_PROCESSING) && (client->datafd>=0) ){ + /* then handle new requests */ + if((client->type == 'g') && FD_ISSET(client->datafd, readfdsptr)){ + FD_CLR(client->datafd, readfdsptr); + XPAClientGet(xpa, client); + got++; + if( maxreq && (got >= maxreq) ) return(got); + goto again; + } + else if((client->type == 's') && FD_ISSET(client->datafd, writefdsptr)){ + FD_CLR(client->datafd, writefdsptr); + /* if the return is > 0, we completed the send */ + if( XPAClientSet(xpa, client) > 0 ) + got++; + if( maxreq && (got >= maxreq) ) return(got); + goto again; + } + } + /* if this client is waiting */ + else if( (client->status == XPA_CLIENT_WAITING) && (client->cmdfd >= 0) ){ + if( FD_ISSET(client->cmdfd, readfdsptr)){ + FD_CLR(client->cmdfd, readfdsptr); + XPAClientEnd(xpa, client); + got++; + if( maxreq && (got >= maxreq) ) return(got); + goto again; + } + } + } + /* loop if necessary */ + if( loop && (xpa=xpa->next) ) goto loop; + /* return the news */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientLoop + * + * Purpose: non-X programs event loop for handling XPA client events + * + * Returns: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientLoop (XPA xpa, int mode) +#else +static int XPAClientLoop(xpa, mode) + XPA xpa; + int mode; +#endif +{ + int got=0; + int sgot; + int doxpa=1; + int ltimeout; + char *s=NULL; + fd_set readfds; + fd_set writefds; + static int width=0; + struct timeval tv; + struct timeval *tvp; + + /* set width once */ + if( width == 0 ){ + width = FD_SETSIZE; + } + /* allow environment to turn off xpa server processing in client loop */ + if( (s=getenv("XPA_CLIENT_DOXPA")) && isfalse(s) ){ + doxpa = 0; + } + ltimeout = XPALongTimeout(); + FD_ZERO(&readfds); + FD_ZERO(&writefds); + while( XPAClientAddSelect(xpa, &readfds, &writefds) ){ + /* add other XPA's and process them as we process the client */ + if( (mode & XPA_CLIENT_SEL_XPA) && doxpa ){ + FPRINTF((stderr, "%sXPAClientLoop: will handle server reqs ...\n", _sp)); + XPAAddSelect(NULL, &readfds); + } + /* hopefully, a server will respond in a finite amount of time */ + if( ltimeout > 0 ){ + tv.tv_sec = ltimeout; + tv.tv_usec = 0; + tvp = &tv; + } + /* wait forever, if necessary */ + else{ + tvp = NULL; + } + /* add stdin to select, if there is one */ + if( xpa->ifd >= 0 ){ + xfd_set_stdin(xpa->ifd, &readfds); +#if HAVE_MINGW32 + /* BUT: for windows, we can't add stdin to select and therefore we + must set a short timeout and look manually */ + tv.tv_sec = 0; + tv.tv_usec = 10000; + /* this is the number of window iterations we will perform */ + if( ltimeout > 0 ) + ltimeout *= 100; + tvp = &tv; +#endif + } + /* wait for a server to respond */ + FPRINTF((stderr, "%sXPAClientLoop: waiting on select() ...\n", _sp)); + sgot = xselect(width, &readfds, &writefds, NULL, tvp); + FPRINTF((stderr, "%sXPAClientLoop: select returns: %d\n", _sp, sgot)); + /* error -- what should we do? */ + if( sgot < 0 ){ + if( xerrno == EINTR ){ + FD_ZERO(&readfds); + FD_ZERO(&writefds); + continue; + } + if( XPAVerbosity() ){ + perror("XPAClientLoop() select"); + } + exit(1); + } + /* timed out -- no one responded */ + else if( sgot == 0 ){ +#if HAVE_MINGW32 + if( xpa->ifd >= 0 ){ + if( ltimeout > 0 ){ + if( --ltimeout <= 0 ) + break; + } + } + else{ + break; + } +#else + break; +#endif + } + else{ + got += XPAClientProcessSelect(xpa, &readfds, &writefds, 0); + if( (mode & XPA_CLIENT_SEL_XPA) && doxpa ){ + got += XPAProcessSelect(&readfds, 0); + } + } + FD_ZERO(&readfds); + FD_ZERO(&writefds); + } + return(got); +} + +#if HAVE_MINGW32==0 +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientLoopFork + * + * Purpose: non-X programs forked event loop for handling XPA client events + * + * Returns: number of clients "processed" + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientLoopFork (XPA xpa, int mode) +#else +static int XPAClientLoopFork(xpa, mode) + XPA xpa; + int mode; +#endif +{ + XPAClient client, tclient; + pid_t pid; + int got; + int fd[2]; + char active=1; +#ifndef USE_DOUBLE_FORK + struct sigaction act; + /* set up the signal handler to reap children (to avoid zombies) */ + act.sa_handler = sig_chld; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; +#ifdef SA_RESTART + act.sa_flags |= SA_RESTART; +#endif +#ifdef SA_NOCLDWAIT + act.sa_flags |= SA_NOCLDWAIT; +#endif + sigaction(SIGCHLD, &act, NULL); +#endif + + if( pipe(fd) < 0 ){ + got = 0; + } + else if( (pid = fork()) < 0 ){ + close(fd[0]); + close(fd[1]); + got=0; + } + else if( pid == 0 ){ /* child */ + /* child write to parent that he is active */ + close(fd[0]); + write(fd[1], &active, 1); + close(fd[1]); +#ifdef USE_DOUBLE_FORK + /* second fork prevents zombies: + when child/parent exits, second child is inherited + by init and thus is not a child of original parent */ + if( (pid = fork()) >= 0 ){ + /* child/parent exits */ + if( pid > 0 ) + exit(0); + /* new child goes on under init ... */ + } +#endif + /* enter the main loop and process */ + XPAIOCallsXPA(0); + XPAClientLoop(xpa, mode); + exit(0); + } else { /* parent */ + /* parent waits for child to wake up */ + close(fd[1]); + read(fd[0], &active, 1); + close(fd[0]); +#ifdef USE_DOUBLE_FORK + /* for double fork, also wait for intermediate process to exit */ + waitpid(pid, NULL, 0); +#endif + /* fake end of clients */ + for(got=0, client=xpa->clienthead; client!=NULL; ){ + got++; + tclient = client->next; + if( (client->status == XPA_CLIENT_PROCESSING) && (client->datafd >=0) ){ +#if HAVE_CYGWIN + /* In Cygwin, we call shutdown (as well as close) to avoid Windows + problems. The parent can't do this since the child is using the + sockets, so we just close the sockets explicitly here */ + xclose(client->datafd); + client->datafd = -1; + if( !xpa->persist ){ + xclose(client->cmdfd); + client->cmdfd = -1; + } +#endif + client->errptr = NULL; + /* remove this client if we are not meant to persist */ + if( !xpa->persist ){ + XPAClientFree(xpa, client); + } + /* otherwise mark as inactive */ + else{ + client->status = XPA_CLIENT_IDLE; + client->bytes = 0; + } + } + client = tclient; + } + } + return(got); +} +#endif + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientConnect + * + * Purpose: go to name service and get new names, merge with old, + * and connect to servers + * + * Returns: number of connections + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientConnect (XPA xpa, char *mode, char *xtemplate, int type) +#else +static int XPAClientConnect(xpa, mode, xtemplate, type) + XPA xpa; + char *mode; + char *xtemplate; + int type; +#endif +{ + int i; + int n; + int got; + int lp=0; + int total=0; + char **xclasses; + char **names; + char **methods; + char **infos; + char xtype[2]; + char xmode[SZ_LINE]; + char tbuf[SZ_LINE]; + char lbuf[SZ_LINE]; + XPAClient client; + + /* do some initialization */ + XPAInitEnv(); + + /* make sure we have a target */ + if( !xtemplate || !*xtemplate ) + return(0); + + /* make a string out of the type for the lookup */ + xtype[0] = type; + xtype[1] = '\0'; + + /* reset the number of clients we are processing */ + xpa->nclient = 0; + + /* look for specific proxy info */ + *xmode = '\0'; + if( mode ){ + strncpy(xmode, mode, SZ_LINE-1); + xmode[SZ_LINE-1] = '\0'; + } + if( keyword(xmode, "ns", lbuf, SZ_LINE) ){ + FPRINTF((stderr, "%sXPAClientConnect: using ns info: %s\n", _sp, lbuf)); + newdtable("(),"); + xclasses = (char **)xmalloc(sizeof(char *)); + names = (char **)xmalloc(sizeof(char *)); + methods = (char **)xmalloc(sizeof(char *)); + infos = (char **)xmalloc(sizeof(char *)); + if( word(lbuf, tbuf, &lp) ) + xclasses[0] = xstrdup(tbuf); + if( word(lbuf, tbuf, &lp) ) + names[0] = xstrdup(tbuf); + if( word(lbuf, tbuf, &lp) ) + methods[0] = xstrdup(tbuf); + infos[0] = xstrdup(XPA_DEF_CLIENT_INFO); + n = 1; + freedtable(); + } + /* else ask xpans for access points matching the template */ + else{ + n = XPANSLookup(xpa, + xtemplate, xtype, &xclasses, &names, &methods, &infos); + } + /* mark existing clients who do not match this template */ + for(got=0, client=xpa->clienthead; client !=NULL; client=client->next){ + for(i=0; itype == type) && + (!strcmp(client->xclass, xclasses[i])) && + (!strcmp(client->name, names[i])) && + (!strcmp(client->method, methods[i])) && + (!strcmp(client->info, infos[i])) ){ + got++; + } + } + /* don't unmark if its a different type -- someone else might be active */ + if( !got && (client->type == type) ){ + client->status = XPA_CLIENT_IDLE; + } + } + /* add new clients for this type */ + for(i=0; iclienthead; client !=NULL; client=client->next){ + if( (client->type == type) && + (!strcmp(client->xclass, xclasses[i])) && + (!strcmp(client->name, names[i])) && + (!strcmp(client->method, methods[i])) && + (!strcmp(client->info, infos[i])) ){ + /* might have to change the template */ + if( strcmp(client->xtemplate, xtemplate) ){ + xfree(client->xtemplate); + client->xtemplate = xstrdup(xtemplate); + } + client->status = XPA_CLIENT_ACTIVE; + got++; + total++; + FPRINTF((stderr, "%sXPAClientConnect: existing match: %s %s %s\n", + _sp, xclasses[i], names[i], methods[i])); + break; + } + } + if( !got ){ + FPRINTF((stderr, "%sXPAClientConnect: calls XPAClientNew for %s:%s %s\n", + _sp, xclasses[i], names[i], methods[i])); + if( XPAClientNew(xpa, mode, xtemplate, type, + xclasses[i], names[i], methods[i], infos[i]) ) + total++; + } + /* done with these strings */ + xfree(xclasses[i]); + xfree(names[i]); + xfree(methods[i]); + xfree(infos[i]); + } + /* free up arrays alloc'ed by names server */ + if( n > 0 ){ + xfree(xclasses); + xfree(names); + xfree(methods); + xfree(infos); + } + return(total); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClientStart + * + * Purpose: send init string to server and perform other authentication + * tasks + * + * Returns: 0 if success, -1 otherwise + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAClientStart (XPA xpa, XPAClient client, char *paramlist, char *mode) +#else +static int XPAClientStart(xpa, client, paramlist, mode) + XPA xpa; + XPAClient client; + char *paramlist; + char *mode; +#endif +{ + int fd=0; + int lp=0; + int flags; + int tries=0; + int dmode=0; + int keep_alive=1; + unsigned int ip=0; + unsigned short port; + char tbuf[SZ_LINE]; + char tbuf2[SZ_LINE]; + char lbuf[SZ_LINE]; + char *cmd=NULL; + char *method=NULL; + struct sockaddr_in sock_in; +#if HAVE_SYS_UN_H + struct sockaddr_un sock_un; +#endif + + switch(client->type){ + case 'a': + cmd = "xpaaccess"; + break; + case 'g': + cmd = "xpaget"; + break; + case 'i': + cmd = "xpainfo"; + break; + case 's': + cmd = "xpaset"; + break; + } + + /* get mode flags */ + XPAMode(mode, &(client->mode), "ack", XPA_CLIENT_ACK, 1); + if( client->type == 's' ) + XPAMode(mode, &(xpa->client_mode), "verify", XPA_CLIENT_VERIFY, 0); + /* package up and send the initialization message */ + strcpy(lbuf, cmd); + /* set and save the id value */ + snprintf(tbuf, SZ_LINE, "%c%d", client->type, id++); + if( client->id ) xfree(client->id); + client->id = xstrdup(tbuf); + /* if we are using the xpans proxy, we will want to call + accept() (server calls connect()) for the data channel */ + if( client->nsproxy ) + strcat(lbuf, " -a"); + /* set the value of the client big-endian-ness */ + snprintf(tbuf, SZ_LINE, " -e %s", XPAEndian() ? "big" : "little"); + strcat(lbuf, tbuf); + snprintf(tbuf, SZ_LINE, " -i %s", client->id); + strcat(lbuf, tbuf); + if( !(client->mode & XPA_CLIENT_ACK) ) + strcat(lbuf, " -n"); + if( strcmp(client->info, XPA_DEF_CLIENT_INFO) ){ + snprintf(tbuf, SZ_LINE, " -p %s", client->info); + strcat(lbuf, tbuf); + } + snprintf(tbuf, SZ_LINE, " %s:%s", client->xclass, client->name); + strcat(lbuf, tbuf); + if( paramlist && *paramlist ){ + strcat(lbuf, " "); + strncat(lbuf, paramlist, MAX(0,(int)(SZ_LINE-(int)strlen(lbuf)-2))); + } + strcat(lbuf, "\n"); + FPRINTF((stderr, "%sXPAClientStart: fd %d sends:\n%s", + _sp, client->cmdfd, lbuf)); + if( XPAPuts(NULL, client->cmdfd, lbuf, XPAShortTimeout()) <= 0 ){ + goto error; + } + + /* if xpainfo and no ack'ing, we are basically done */ + if( (client->type == 'i') && !(client->mode & XPA_CLIENT_ACK) ){ + goto done; + } + + /* authentication */ +retry: + lp = 0; + if( XPAGets(NULL, client->cmdfd, lbuf, SZ_LINE, XPAShortTimeout()) >0 ){ + FPRINTF((stderr, "%sXPAClientStart: fd %d received cmd:\n%s", _sp, + client->cmdfd, lbuf)); + /* this should never happen */ + if( !word(lbuf, tbuf, &lp) || (*tbuf == '?') ){ + snprintf(errbuf, SZ_LINE, + "XPA$WARNING: Protocol mismatch: id\n%s", lbuf); + goto error; + } + /* make sure we are dealing with a proper message */ + if( strcmp(tbuf, client->id) ){ + FPRINTF((stderr, "%sXPA$WARNING: ignoring out of sync message:\n", _sp)); + FPRINTF((stderr, "%s", lbuf)); + if( XPAVerbosity() > 1 ){ + fprintf(stderr, "XPA$WARNING: ignoring out of sync server message:\n"); + fprintf(stderr, "%s", lbuf); + } + goto retry; + } + + /* this should never happen */ + if( !word(lbuf, tbuf, &lp) ){ + snprintf(errbuf, SZ_LINE, "XPA$WARNING: missing BUF request\n%s", lbuf); + goto error; + } + if( !strcmp(tbuf, "XPA$NODATA") || !strcmp(tbuf, "XPA$NOBUF") ){ + xpa->nclient += 1; + goto started; + } + /* support 2.2 (DATA) and 2.0,2.1 (BUF) */ + else if( !strcmp(tbuf, "XPA$DATA") || !strcmp(tbuf, "XPA$BUF") ){ + if( !strcmp(tbuf, "XPA$DATA") ){ + dmode |= DATA_DATA; + if( !word(lbuf, tbuf, &lp) ){ + snprintf(errbuf, SZ_LINE, + "XPA$WARNING: missing DATA request type\n%s", lbuf); + goto error; + } + if( !strcmp(tbuf, "connect") ){ + method = client->method; + dmode |= DATA_CONNECT; + } + else if( !strcmp(tbuf, "accept") ){ + method = client->method; + dmode |= DATA_ACCEPT; + } + else{ + snprintf(errbuf, SZ_LINE, + "XPA$WARNING: invalid data connection request: %s (%s:%s)\n", + tbuf, client->xclass, client->name); + goto error; + } + } + else if( !strcmp(tbuf, "XPA$BUF") ){ + if( !word(lbuf, tbuf, &lp) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: missing data buffer method (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + goto error; + } + method = tbuf; + dmode |= DATA_CONNECT; + } + /* handle connect-type requests */ + if( dmode & DATA_CONNECT ){ + switch(XPAMethod(method)){ + case XPA_INET: + XPAParseIpPort(method, &ip, &port); + /* connect to the server before we go further */ + if( (fd = xsocket(AF_INET, SOCK_STREAM, 0)) < 0 ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: bad socket for data chan (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + if( XPAVerbosity() ){ + perror("XPA client socket"); + } + goto error; + } + setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + memset((char *)&sock_in, 0, sizeof(sock_in)); + sock_in.sin_family = AF_INET; + /* connect using the same ip we used for the command channel + (i.e., could be localhost) */ + sock_in.sin_addr.s_addr = htonl(client->ip); + sock_in.sin_port = htons(port); + FPRINTF((stderr, + "%sXPAClientStart: attempting dchan connect: %s\n", + _sp, method)); + if( connect(fd, (struct sockaddr *)&sock_in, sizeof(sock_in)) < 0 ){ + PERROR(("dchan connect")); + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: can't connect to data chan (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + if( XPAVerbosity() ){ + perror("XPA client connect"); + } + xclose(fd); + goto error; + } + break; +#if HAVE_SYS_UN_H + case XPA_UNIX: +again: + /* open a socket and fill in socket information */ + if( (fd = xsocket(AF_UNIX, SOCK_STREAM, 0)) < 0 ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: bad socket for data chan (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + if( XPAVerbosity() ){ + perror("XPA client socket"); + } + goto error; + } + setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, + (char *)&keep_alive, sizeof(keep_alive)); + memset((char *)&sock_un, 0, sizeof(sock_un)); + sock_un.sun_family = AF_UNIX; + strcpy(sock_un.sun_path, method); + FPRINTF((stderr, + "%sXPAClientStart: attempting dchan connect: %s\n", + _sp, method)); + if( connect(fd, (struct sockaddr *)&sock_un, sizeof(sock_un)) < 0 ){ + PERROR(("dchan connect")); + xclose(fd); + if( (xerrno == ECONNREFUSED) && (tries < XPA_RETRIES) ){ + tries++; + xclose(fd); + XPASleep(10); + goto again; + } + /* give up */ + else{ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: can't connect to data chan (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + if( XPAVerbosity() ){ + perror("XPA client connect"); + } + goto error; + } + } + break; +#endif + default: + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: unknown connection method (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + goto error; + } + } + /* handle "doaccept" requests */ + else if( dmode & DATA_ACCEPT ){ + fd = XPAProxyAccept(xpa, XPANSMethod(NULL,2), + client->xclass, client->name, client->cmdfd, + NULL, NULL, tbuf2); + if( fd < 0 ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: can't connect to proxy server (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + goto error; + } + else if( *tbuf2 ){ + client->dataname = xstrdup(tbuf2); + } + } + + /* common code for either type of data connect request */ + client->datafd = fd; + /* make sure we close on exec */ + xfcntl(client->datafd, F_SETFD, FD_CLOEXEC); + /* for senders, set to no block mode */ + if( client->type == 's' ){ + /* save state and set in non-blocking mode */ + xfcntl_nonblock(client->datafd, flags); + } + xpa->nclient += 1; + goto started; + } + /* handle error message */ + else if( !strcmp(tbuf, "XPA$ERROR") ){ + snprintf(errbuf, SZ_LINE, "%s", &lbuf[lp]); + goto error; + } + /* everything else is an error */ + else{ + snprintf(errbuf, SZ_LINE, "%s", &lbuf[lp]); + goto error; + } + } + else{ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server during handshake (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + goto error; + } + +error: + FPRINTF((stderr, "Error in XPAClientStart: %s", errbuf)); + XPAClientFree(xpa, client); + return(-1); + +started: + /* it is necessary to add this this extra hack/ack between the + authentication ack and the error return (both from the server) + to avoid getting Nagle buffered. if we already did an accept, + however, we already sent a message and need not repeat it */ + if( !(dmode & DATA_ACCEPT) ){ + FPRINTF((stderr, "%sXPAClientStart: %d sending nagle\n", + _sp, client->cmdfd)); + XPAPuts(NULL, client->cmdfd, "xpanagle\n", XPAShortTimeout()); + } + + /* write a "data request" to the server on the data channel, supplying + the arguments to allow the server to find the associated command */ + if( dmode & DATA_DATA ){ + if( !word(lbuf, tbuf, &lp) ) + strcpy(tbuf, "?"); + if( !word(lbuf, tbuf2, &lp) ) + strcpy(tbuf2, "?"); + snprintf(lbuf, SZ_LINE, "xpadata -f %s %s\n", tbuf, tbuf2); + FPRINTF((stderr, + "%sXPAClientStart: sending data channel %d request: %s", _sp, + client->datafd, lbuf)); + if( XPAPuts(NULL, client->datafd, lbuf, XPAShortTimeout()) <0 ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: unable to issue data request: %s (%s:%s%s)\n", + lbuf, client->xclass, client->name, XPATimestamp()); + FPRINTF((stderr, "%sXPAClientStart: error returned is %s", _sp, errbuf)); + goto error; + } + } + +done: + /* mark as active and started */ + client->status = XPA_CLIENT_PROCESSING; + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Public Routines + * + * + *---------------------------------------------------------------------------- + */ + +/* + *--------------------------------------------------------------------------- + * + * Routine: XPAClientValid + * + * Purpose: see if the xpa client struct is valid + * + * Results: 1 on success, 0 for failure + * + *--------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAClientValid (XPA xpa) +#else +int XPAClientValid(xpa) + XPA xpa; +#endif +{ + return(_XPAValid(xpaclienthead, xpa, "c")); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAOpen + * + * Purpose: open a persistent XPA client connection + * + * Returns: XPA struct on success + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPA +XPAOpen (char *mode) +#else +XPA XPAOpen(mode) + char *mode; +#endif +{ + XPA xpa; + + /* allocate xpa struct */ + if( (xpa = (XPA)xcalloc(1, sizeof(XPARec))) == NULL ) + return(NULL); + /* add version */ + xpa->version = xstrdup(XPA_VERSION); + /* mark this as a client struct */ + xpa->type = xstrdup("c"); + /* mark as persistent so we don't destroy at the end of the transfer */ + xpa->persist = 1; + + /* add this xpa to end of list of client xpas */ + XPAListAdd(&xpaclienthead, xpa); + + return(xpa); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAClose + * + * Purpose: close a persistent XPA client connection + * + * Returns: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +void +XPAClose (XPA xpa) +#else +void XPAClose(xpa) + XPA xpa; +#endif +{ + XPAClient client, tclient; + NS ns, tns; + + /* ignore struct if its not a client struct */ + if( !XPAClientValid(xpa) ) + return; + + /* remove from list of client xpas */ + XPAListDel(&xpaclienthead, xpa); + + /* free each remaining client */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + XPAClientFree(xpa, client); + client = tclient; + } + + /* close down the name server and all of the remotes for this xpa */ + for(ns=xpa->nshead; ns!=NULL; ){ + tns = ns->next; + XPANSClose(xpa, ns); + ns = tns; + } + + /* free string space */ + if( xpa->version ) + xfree(xpa->version); + if( xpa->type ) + xfree(xpa->type); + if( xpa ) + xfree(xpa); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAGet + * + * Purpose: get XPA values + * + * Returns: 0 for success, -1 for failure + * len bytes of data returned in buf + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAGet (XPA xpa, char *xtemplate, char *paramlist, char *mode, + char **bufs, size_t *lens, char **names, char **messages, int n) +#else +int XPAGet(xpa, xtemplate, paramlist, mode, bufs, lens, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + char *mode; + char **bufs; + size_t *lens; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int xmode=0; + int type='g'; + int idef=1; + int got=0; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + FPRINTF((stderr, "%sXPAGet: starting\n", _sp)); + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* these arrays are required */ + if( (bufs == NULL) || (lens == NULL) ){ + got = -1; + goto done; + } + + /* flag that we don't read from stdin */ + xpa->ifd = -1; + + /* zero out the return buffers */ + memset((char *)bufs, 0, ABS(n)*sizeof(char *)); + memset((char *)lens, 0, ABS(n)*sizeof(size_t)); + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) >0 ){ + /* retrieve data from n active clients */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >=0 ){ + /* we fill buffers */ + client->mode |= XPA_CLIENT_BUF; + client->bufptr = &(bufs[got]); + client->lenptr = &(lens[got]); + if( names != NULL ) + client->nameptr = &(names[got]); + if( messages != NULL ) + client->errptr = &(messages[got]); + } + else{ + if( messages != NULL ) + messages[got] = xstrdup(errbuf); + } + got++; + } + client = tclient; + } + /* if we have active clients */ + if( got ){ +#if HAVE_MINGW32==0 + /* check for loop modes */ + XPAMode(mode, &xmode, "dofork", XPA_CLIENT_SEL_FORK, 0); + /* dofork implies don't do xpa */ + if( xmode & XPA_CLIENT_SEL_FORK ) + idef = 0; + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + if( xmode & XPA_CLIENT_SEL_FORK ){ + XPAClientLoopFork(xpa, xmode); + } + else{ + /* enter the main loop and process */ + XPAClientLoop(xpa, xmode); + } +#else + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + XPAClientLoop(xpa, xmode); +#endif + } + } + +done: + /* look for clients who timed out */ + for(i=0, client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAGetFd + * + * Purpose: get XPA values + * + * Returns: 0 for success, -1 for failure + * len bytes of data returned in buf + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAGetFd (XPA xpa, char *xtemplate, char *paramlist, char *mode, + int *fds, char **names, char **messages, int n) +#else +int XPAGetFd(xpa, xtemplate, paramlist, mode, fds, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + int *fds; + char *mode; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int xmode=0; + int got=0; + int type='g'; + int idef=1; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + FPRINTF((stderr, "%sXPAGetFd: starting\n", _sp)); + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* flag that we don't read from stdin */ + xpa->ifd = -1; + + /* zero out the return buffers */ + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) > 0 ){ + /* retrieve data from n active clients */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >= 0 ){ + /* we write to an fd */ + client->mode |= XPA_CLIENT_FD; + /* negative value => one channel for all clients */ + if( n < 0 ) + client->fd = fds[0]; + else + client->fd = fds[got]; + client->bufptr = (char **)xcalloc(1, sizeof(char *)); + client->lenptr = (size_t *)xcalloc(1, sizeof(size_t)); + if( names != NULL ) + client->nameptr = &(names[got]); + if( messages != NULL ) + client->errptr = &(messages[got]); + } + else{ + if( messages != NULL ) + messages[got] = xstrdup(errbuf); + } + got++; + } + client = tclient; + } + /* if we have active clients */ + if( got ){ +#if HAVE_MINGW32==0 + /* check for loop modes */ + XPAMode(mode, &xmode, "dofork", XPA_CLIENT_SEL_FORK, 0); + /* dofork implies don't do xpa */ + if( xmode & XPA_CLIENT_SEL_FORK ) + idef = 0; + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + if( xmode & XPA_CLIENT_SEL_FORK ){ + XPAClientLoopFork(xpa, xmode); + } + else{ + /* enter the main loop and process */ + XPAClientLoop(xpa, xmode); + } +#else + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + XPAClientLoop(xpa, xmode); +#endif + } + } + /* look for clients who timed out */ + for(i=0, client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASet + * + * Purpose: set XPA values + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPASet (XPA xpa, char *xtemplate, char *paramlist, char *mode, + char *buf, size_t len, char **names, char **messages, int n) +#else +int XPASet(xpa, xtemplate, paramlist, mode, buf, len, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + char *mode; + char *buf; + size_t len; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int xmode=0; + int got=0; + int type='s'; + int idef=1; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + FPRINTF((stderr, "%sXPASet: starting\n", _sp)); + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* flag that we don't read from stdin */ + xpa->ifd = -1; + + /* zero out the return buffers */ + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) >0 ){ + /* retrieve data from n active clients */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >= 0 ){ + /* we fill buffers */ + client->mode |= XPA_CLIENT_BUF; + client->buf = buf; + client->len = len; + if( names != NULL ) + client->nameptr = &(names[got]); + if( messages != NULL ) + client->errptr = &(messages[got]); + } + else{ + if( messages != NULL ) + messages[got] = xstrdup(errbuf); + } + got++; + } + client = tclient; + } + /* if we have active clients */ + if( got ){ +#if HAVE_MINGW32==0 + /* check for loop modes */ + XPAMode(mode, &xmode, "dofork", XPA_CLIENT_SEL_FORK, 0); + /* dofork implies don't do xpa */ + if( xmode & XPA_CLIENT_SEL_FORK ) + idef = 0; + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + if( xmode & XPA_CLIENT_SEL_FORK ){ + XPAClientLoopFork(xpa, xmode); + } + else{ + /* enter the main loop and process */ + XPAClientLoop(xpa, xmode); + } +#else + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, idef); + XPAClientLoop(xpa, xmode); +#endif + } + } + /* look for clients who timed out */ + for(i=0, client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASetFd + * + * Purpose: set XPA values + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPASetFd (XPA xpa, char *xtemplate, char *paramlist, char *mode, + int fd, char **names, char **messages, int n) +#else +int XPASetFd(xpa, xtemplate, paramlist, mode, fd, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + char *mode; + int fd; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int xmode=0; + int got=0; + int got2=0; + int type='s'; + int idef=1; + int flags; + char *s; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + FPRINTF((stderr, "%sXPASetFd: starting\n", _sp)); + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* Set non-blocking mode for the input fd, if its not a tty */ + xpa->ifd = fd; + if( isatty(xpa->ifd) == 0 ){ + /* save state and set in non-blocking mode */ + xfcntl_nonblock(xpa->ifd, flags); + } + /* zero out the return buffers */ + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) >0 ){ + /* open clients all at once */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >= 0 ){ + /* we fill buffers */ + client->mode |= XPA_CLIENT_FD; + if( names != NULL ) + client->nameptr = &(names[got]); + if( messages != NULL ) + client->errptr = &(messages[got]); + } + else{ + if( messages != NULL ) + messages[got] = xstrdup(errbuf); + } + got++; + } + client = tclient; + } + /* if we have active clients */ + if( got ){ + /* if fd is null, user did not want to send data, just the paramlist */ + if( fd < 0 ){ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotclienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* reset flags, if necessary */ + if( xpa->ifd >=0 && (isatty(xpa->ifd) ==0) ){ + xfcntl(xpa->ifd, F_SETFL, flags); + } + /* free all input structs */ + XPAClientFreeAllInputs(xpa); + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAInfo + * + * Purpose: send XPA info + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAInfo (XPA xpa, char *xtemplate, char *paramlist, char *mode, + char **names, char **messages, int n) +#else +int XPAInfo(xpa, xtemplate, paramlist, mode, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + char *mode; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int got=0; + char type='i'; + char *s; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* flag that we don't read from stdin */ + xpa->ifd = -1; + + /* zero out the return buffers */ + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) >0 ){ + /* retrieve data from n active clients */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >= 0 ){ + XPAClientDataSent(xpa, client); + s = XPAClientEnd(xpa, client); + if( (messages != NULL) && (messages[got] == NULL) ) + messages[got] = xstrdup(s); + } + else{ + if( (messages != NULL) && (messages[got] == NULL) ) + messages[got] = xstrdup(errbuf); + } + got++; + } + client = tclient; + } + } + /* look for clients who timed out */ + for(i=0, client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAAccess + * + * Purpose: determine if XPA access point is available + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAAccess (XPA xpa, char *xtemplate, char *paramlist, char *mode, + char **names, char **messages, int n) +#else +int XPAAccess(xpa, xtemplate, paramlist, mode, names, messages, n) + XPA xpa; + char *xtemplate; + char *paramlist; + char *mode; + char **names; + char **messages; + int n; +#endif +{ + int i; + int oldmode=0; + int xmode=0; + int got=0; + int type='a'; + char *s; + char *ind1, *ind2; + char tbuf[SZ_LINE]; + XPAClient client, tclient; + + /* if not persistent, we need a temp xpa struct; + (also ignore passed struct if its not a client struct) */ + if( (xpa == NULL) || strcmp(xpa->type, "c") ){ + if( (xpa = XPAOpen(NULL)) == NULL ) + return(-1); + /* mark this as not persistent */ + xpa->persist = 0; + } + /* save xpa mode -- this call might override */ + else{ + /* make sure we have a valid client handle */ + if( !XPAClientValid(xpa) ){ + if( XPAVerbosity() ){ + fprintf(stderr, "XPA$ERROR: invalid xpa client handle\n"); + } + return(-1); + } + oldmode = xpa->client_mode; + } + + /* flag that we don't read from stdin */ + xpa->ifd = -1; + + /* zero out the return buffers */ + if( names != NULL ) + memset((char *)names, 0, ABS(n)*sizeof(char *)); + if( messages != NULL ) + memset((char *)messages, 0, ABS(n)*sizeof(char *)); + + /* connect to clients and grab data */ + if( XPAClientConnect(xpa, mode, xtemplate, type) >0 ){ + /* retrieve data from n active clients */ + for(client=xpa->clienthead; client!=NULL; ){ + tclient = client->next; + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (gotxclass, client->name, client->method); + names[got] = xstrdup(tbuf); + } + if( XPAClientStart(xpa, client, paramlist, mode) >=0 ){ + XPAClientDataSent(xpa, client); + s = XPAClientEnd(xpa, client); + if( (messages != NULL) && (messages[got] == NULL) ) + messages[got] = xstrdup(s); + } + else{ + if( (messages != NULL) && (messages[got] == NULL) ) + messages[got] = xstrdup(errbuf); + } + /* might have to fix the name if was an explicit mach:port */ + if( names && names[got] && *errbuf && + !strncmp(names[got], "?:?", 3) && + (ind1=strrchr(errbuf, '(')) && (ind2=strrchr(errbuf, ')')) ){ + ind1++; + strncpy(tbuf, ind1, ind2-ind1); + tbuf[ind2-ind1] = '\0'; + xfree(names[got]); + names[got] = xstrdup(tbuf); + } + got++; + } + client = tclient; + } + /* if we have active clients */ + if( got ){ + /* check for loop modes */ + XPAMode(mode, &xmode, "doxpa", XPA_CLIENT_SEL_XPA, 1); + /* enter the main loop and process */ + XPAClientLoop(xpa, xmode); + } + } + /* look for clients who timed out */ + for(i=0, client=xpa->clienthead; client!=NULL; client=client->next){ + if( (client->type == type) && (client->status != XPA_CLIENT_IDLE) && + (istatus == XPA_CLIENT_PROCESSING) && ( messages != NULL) ){ + snprintf(errbuf, SZ_LINE, + "XPA$ERROR: no response from server callback (%s:%s%s)\n", + client->xclass, client->name, XPATimestamp()); + messages[i] = xstrdup(errbuf); + } + } + } + /* remove this xpa if we are not meant to persist */ + if( xpa && !xpa->persist ) + XPAClose(xpa); + /* restore xpa mode -- this call might override */ + else + xpa->client_mode = oldmode; + + /* return number of clients processes (including errors) */ + return(got); +} + diff --git a/clipboard.c b/clipboard.c new file mode 100644 index 0000000..68df675 --- /dev/null +++ b/clipboard.c @@ -0,0 +1,324 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* + * + * remote.c -- xpa access control list management + * + */ + +#include + +/* + *---------------------------------------------------------------------------- + * + * + * Private Routines + * + * + *---------------------------------------------------------------------------- + */ + +#ifdef ANSI_FUNC +static XPAClip +ClipBoardNew(XPA xpa, char *name) +#else +static XPAClip ClipBoardNew(xpa, name) + XPA xpa; + char *name; +#endif +{ + XPAClip cur, xnew; + if( (xnew = (XPAClip)xcalloc(1, sizeof(XPAClipRec))) == NULL ) + return(NULL); + + /* fill in record structure */ + xnew->name = xstrdup(name); + xnew->ip = xpa->comm->cmdip; + + /* add to the end of list */ + if( xpa->cliphead == NULL ){ + xpa->cliphead = xnew; + } + else{ + for(cur=xpa->cliphead; cur->next!=NULL; cur=cur->next){ + ; + } + cur->next = xnew; + } + return xnew; +} + +#ifdef ANSI_FUNC +static XPAClip +ClipBoardLookup(XPA xpa, char *name) +#else +static XPAClip ClipBoardLookup(xpa, name) + XPA xpa; + char *name; +#endif +{ + XPAClip cur; + + /* look for reserved keywords that have callbacks */ + for(cur=xpa->cliphead; cur!=NULL; cur=cur->next){ + if( !strcmp(name, cur->name) && (xpa->comm->cmdip == cur->ip) ){ + return(cur); + } + } + return NULL; +} + +#ifdef ANSI_FUNC +static int +ClipBoardAdd(XPA xpa, char *name, char *paramlist, char *buf) +#else +static int +ClipBoardAdd(xpa, name, paramlist, buf) + XPA xpa; + char *name; + char *paramlist; + char *buf; +#endif +{ + XPAClip cur; + if( !(cur = ClipBoardLookup(xpa, name)) ) + cur = ClipBoardNew(xpa, name); + if( !cur ) + return -1; + if( cur->value ) + xfree(cur->value); + cur->value = xstrdup(buf); + return 0; +} + +#ifdef ANSI_FUNC +static int +ClipBoardAppend(XPA xpa, char *name, char *paramlist, char *buf) +#else +static int +ClipBoardAppend(xpa, name, paramlist, buf) + XPA xpa; + char *name; + char *paramlist; + char *buf; +#endif +{ + XPAClip cur; + if( !(cur = ClipBoardLookup(xpa, name)) ) + cur = ClipBoardNew(xpa, name); + if( !cur ) + return -1; + if( cur->value ){ + if( (cur->value = (char *)xrealloc(cur->value, + strlen(cur->value)+strlen(buf)+1)) ) + strcat(cur->value, buf); + else + return -1; + } + else{ + cur->value = xstrdup(buf); + } + return 0; +} + +#ifdef ANSI_FUNC +static int +ClipBoardDelete(XPA xpa, char *name, char *paramlist) +#else +static int +ClipBoardDelete(xpa, name, paramlist) + XPA xpa; + char *name; + char *paramlist; +#endif +{ + XPAClip cur; + if( (cur = ClipBoardLookup(xpa, name)) ){ + ClipBoardFree(xpa, cur); + return 0; + } + else + return -1; +} + +/* + *---------------------------------------------------------------------------- + * + * + * Semi-Public Routines (used by xpa.c and command.c) + * + * + *---------------------------------------------------------------------------- + */ + +#ifdef ANSI_FUNC +int +ClipBoardFree(XPA xpa, XPAClip clip) +#else +int ClipBoardFree(xpa, clip) + XPA xpa; + XPAClip clip; +#endif +{ + XPAClip cur; + + if( !clip ) + return 0; + /* remove from list */ + if( xpa->cliphead ){ + if( xpa->cliphead == clip ){ + xpa->cliphead = clip->next; + } + else{ + for(cur=xpa->cliphead; cur!=NULL; cur=cur->next){ + if( cur->next == clip ){ + cur->next = clip->next; + break; + } + } + } + } + if( clip->name ) xfree(clip->name); + if( clip->value ) xfree(clip->value); + xfree(clip); + return 1; +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveClipboard + * + * Purpose: add a new clipboard entry + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAReceiveClipboard (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +int XPAReceiveClipboard(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + char cmd[SZ_LINE]; + char name[SZ_LINE]; + char tbuf[SZ_LINE]; + int lp=0; + int status = -1; + + *cmd = '\0'; + *name = '\0'; + if( paramlist && *paramlist ){ + if( !word(paramlist, cmd, &lp) || !word(paramlist, name, &lp) ) + goto done; + /* lookup the command */ + if( !strcmp(cmd, "add") ){ + status = ClipBoardAdd(xpa, name, ¶mlist[lp], buf); + } + else if( !strncmp(cmd, "app", 3) ){ + status = ClipBoardAppend(xpa, name, ¶mlist[lp], buf); + } + else if( !strncmp(cmd, "del", 3) ){ + status = ClipBoardDelete(xpa, name, ¶mlist[lp]); + } +#ifdef LATER + else if( !strncmp(cmd, "loa", 3) ){ + status = ClipBoardLoad(xpa, name, ¶mlist[lp], buf); + } + else if( !strncmp(cmd, "sav", 3) ){ + status = ClipBoardSave(xpa, name, ¶mlist[lp]); + } +#endif + } + +done: + if( status < 0 ){ + if( !*cmd || !*name ){ + XPAError(xpa, "XPA clipboard requires: add|append|delete name\n"); + } + else{ + snprintf(tbuf, SZ_LINE, + "XPA clipboard invalid cmd or name: %s %s\n", cmd, name); + XPAError(xpa, tbuf); + } + } + return(status); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendClipboard + * + * Purpose: return clipboard information + * + * Returns: 0 for success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPASendClipboard (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +int XPASendClipboard(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + char name[SZ_LINE]; + char tbuf[SZ_LINE]; + int lp=0; + int status = -1; + XPAClip cur; + + *name = '\0'; + if( paramlist && *paramlist ){ + if( !word(paramlist, name, &lp) ) + goto done; + if( !(cur = ClipBoardLookup(xpa, name)) ) + goto done; + if( cur->value ){ + send(xpa_datafd(xpa), cur->value, strlen(cur->value), 0); + status = 0; + } + } + +done: + if( status < 0 ){ + if( !*name ){ + XPAError(xpa, "XPA clipboard requires: name\n"); + } + else{ + snprintf(tbuf, SZ_LINE, "XPA clipboard invalid name: %s\n", name); + XPAError(xpa, tbuf); + } + } + return(status); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Public Routines + * + * + *---------------------------------------------------------------------------- + */ + diff --git a/command.c b/command.c new file mode 100644 index 0000000..2ea182d --- /dev/null +++ b/command.c @@ -0,0 +1,1217 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +#include + +/* + *---------------------------------------------------------------------------- + * + * + * Private Routines and Data + * + * + *---------------------------------------------------------------------------- + */ + +/* this is the static xpa struct that holds the reserved commands */ +static XPA rxpa=NULL; + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdParseNames + * + * Purpose: massage a name string, changing multiple sequential spaces + * into a single space + * + * Returns: new name, with spaces massaged (also number of spacess) + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static char * +XPACmdParseNames(char *lbuf, int *ntokens) +#else +static char *XPACmdParseNames(lbuf, ntokens) + char *lbuf; + int *ntokens; +#endif +{ + char tbuf[SZ_LINE]; + int lp=0; + char *buf; + + /* can't be larger than the original string */ + buf = (char *)xmalloc(strlen(lbuf)+1); + *buf = '\0'; + *ntokens = 0; + + /* pick off each word, separating by a single space */ + while( word(lbuf, tbuf, &lp)){ + if( *buf != '\0' ) + strcat(buf, " "); + strcat(buf, tbuf); + *ntokens += 1; + } + + /* make the string the right size */ + buf = (char *)xrealloc(buf, strlen(buf)+1); + return(buf); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveNSConnect + * + * Purpose: reset and re-establish connection to name server + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAReceiveNSConnect (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +static int XPAReceiveNSConnect(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + XPA txpa; + char tbuf[SZ_LINE]; + int doall=0; + int lp=0; + + if( paramlist && *paramlist ){ + if( word(paramlist, tbuf, &lp) && !strcmp(tbuf, "-all") ){ + doall = 1; + } + } + if( doall ){ + for(txpa=XPAListHead(); txpa!=NULL; txpa=txpa->next){ + XPANSAdd(txpa, NULL, NULL); + } + } + else{ + XPANSAdd(xpa, NULL, NULL); + } + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveNSDisconnect + * + * Purpose: break connection to name server + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAReceiveNSDisconnect (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +static int XPAReceiveNSDisconnect(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + XPA txpa; + NS ns, tns; + char tbuf[SZ_LINE]; + int doall=0; + int lp=0; + + if( paramlist && *paramlist ){ + if( word(paramlist, tbuf, &lp) && !strcmp(tbuf, "-all") ){ + doall = 1; + } + } + if( doall ){ + for(txpa=XPAListHead(); txpa!=NULL; txpa=txpa->next){ + for(ns=txpa->nshead; ns!= NULL; ){ + tns = ns->next; + XPANSClose(txpa, ns); + ns = tns; + } + } + } + else{ + for(ns=xpa->nshead; ns!= NULL; ){ + tns = ns->next; + XPANSClose(xpa, ns); + ns = tns; + } + } + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveEnv + * + * Purpose: set an environment variable + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAReceiveEnv (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +static int XPAReceiveEnv(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + char name[SZ_LINE]; + char value[SZ_LINE]; + char *tbuf; + int lp=0; + + if( word(paramlist, name, &lp) ){ + if( word(paramlist, value, &lp) ){ + tbuf = (char *)xmalloc(strlen(name)+1+strlen(value)+1); + snprintf(tbuf, SZ_LINE, "%s=%s", name, value); + putenv(tbuf); + return(0); + } + else{ + if( strchr(name, '=') != NULL ){ + tbuf = xstrdup(name); + putenv(tbuf); + return(0); + } + else{ + XPAError(xpa, "XPA setenv requires name and value pair\n"); + return(-1); + } + } + } + else{ + XPAError(xpa, "XPA setenv requires name and value pair\n"); + return(-1); + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendEnv + * + * Purpose: return an environment variable to client + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPASendEnv (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +static int XPASendEnv(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + int tlen; + char *tbuf; + char *ebuf; + + if( (ebuf = (char *)getenv(paramlist)) != NULL ){ + tlen = strlen(ebuf)+2; + tbuf = (char *)xmalloc(tlen); + snprintf(tbuf, tlen, "%s\n", ebuf); + *buf = tbuf; + *len = strlen(tbuf); + } + else{ + *buf = xstrdup("\n"); + *len = 1; + } + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveReserved + * + * Purpose: execute reserved command + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPAReceiveReserved (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +static int XPAReceiveReserved(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + char *cmd = (char *)client_data; + XPA xpa = (XPA)call_data; + + if( !strcmp(cmd, "end") ){ + xpa->comm->status |= XPA_STATUS_ENDBUF; + return(0); + } + else if( !strcmp(cmd, "exec") ){ + xpa->comm->status |= XPA_STATUS_READBUF; + return(0); + } + else{ + return(-1); + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendHelp + * + * Purpose: send help strings + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPASendHelp (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +static int XPASendHelp(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + XPACmd cmd; + int lp=0; + int slen; + char tbuf[SZ_LINE]; + char lbuf[SZ_LINE]; + char *sbuf; + + if( !paramlist || !*paramlist ){ + if( xpa->version != NULL ){ + snprintf(lbuf, SZ_LINE, "XPA version: %s\n", xpa->version); + send(xpa_datafd(xpa), lbuf, strlen(lbuf), 0); + } + } + if( xpa->commands == NULL ){ + if( xpa->help != NULL ){ + slen = strlen(xpa->help)+SZ_LINE; + sbuf = (char *)xmalloc(slen); + snprintf(sbuf, slen, "%s\n", xpa->help); + send(xpa_datafd(xpa), sbuf, strlen(sbuf), 0); + xfree(sbuf); + } + else{ + strcpy(lbuf, "\n"); + send(xpa_datafd(xpa), lbuf, strlen(lbuf), 0); + } + } + else{ + if( paramlist && *paramlist ){ + while( word(paramlist, tbuf, &lp) ){ + for(cmd=xpa->commands; cmd!=NULL; cmd=cmd->next){ + if( !strcmp(tbuf, cmd->name) ){ + if( cmd->help != NULL ){ + slen = strlen(cmd->name)+strlen(cmd->help)+SZ_LINE; + sbuf = (char *)xmalloc(slen); + snprintf(sbuf, slen, "%s:\t%s\n", cmd->name, cmd->help); + send(xpa_datafd(xpa), sbuf, strlen(sbuf), 0); + xfree(sbuf); + } + else{ + snprintf(lbuf, SZ_LINE, "%s:\t(no help available)\n", cmd->name); + send(xpa_datafd(xpa), lbuf, strlen(lbuf), 0); + } + } + } + } + } + else{ + for(cmd=xpa->commands; cmd!=NULL; cmd=cmd->next){ + if( cmd->help != NULL ){ + slen = strlen(cmd->name)+strlen(cmd->help)+SZ_LINE; + sbuf = (char *)xmalloc(slen); + snprintf(sbuf, slen, "%s:\t%s\n", cmd->name, cmd->help); + send(xpa_datafd(xpa), sbuf, strlen(sbuf), 0); + xfree(sbuf); + } + else{ + snprintf(lbuf, SZ_LINE, "%s:\t(no help available)\n", cmd->name); + send(xpa_datafd(xpa), lbuf, strlen(lbuf), 0); + } + } + } + } + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendVersion + * + * Purpose: send XPA version string + * + * Returns: xpa callback error codes + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +static int +XPASendVersion (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +static int XPASendVersion(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + char lbuf[SZ_LINE]; + + if( xpa->version != NULL ) + snprintf(lbuf, SZ_LINE, "%s\n", xpa->version); + else + strcpy(lbuf, "\n"); + send(xpa_datafd(xpa), lbuf, strlen(lbuf), 0); + return(0); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Semi-Public Routines and Data + * + * These routines are used by XPAHandler and XPANew + * + * + *---------------------------------------------------------------------------- + */ + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAInitReserved + * + * Purpose: add the reserved commands to the reserved xpa struct + * + * Results: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +void +XPAInitReserved (void) +#else +void XPAInitReserved() +#endif +{ + if( !rxpa ){ + if( (rxpa = (XPA)xcalloc(1, sizeof(struct xparec))) == NULL ) + return; + /* XPACmdAdd requires that the callbacks be defined explicitly in rxpa */ + rxpa->send_callback = XPASendCommands; + rxpa->receive_callback = XPAReceiveCommands; + /* add reserved commands */ + XPACmdAdd(rxpa, "-acl", + "\tget (set) the access control list\n\t\t options: host type acl", + XPASendAcl, NULL, NULL, XPAReceiveAcl, NULL, "fillbuf=false"); + XPACmdAdd(rxpa, "-env", + "\tget (set) an environment variable\n\t\t options: name (value)", + XPASendEnv, NULL, NULL, XPAReceiveEnv, NULL, NULL); + XPACmdAdd(rxpa, "-exec", + "\texecute commands from buffer\n\t\t options: none", + NULL, NULL, NULL, XPAReceiveReserved, (void *)"exec", NULL); + XPACmdAdd(rxpa, "-help", + "\treturn help string for specified XPA\n\t\t options: cmd name (commands only)", + XPASendHelp, NULL, NULL, NULL, NULL, NULL); + XPACmdAdd(rxpa, "-ltimeout", + "\tget (set) long timeout\n\t\t options: seconds|reset", + XPASendLTimeout, NULL, NULL, XPAReceiveLTimeout, NULL, NULL); + XPACmdAdd(rxpa, "-nsconnect", + "\tre-establish name server connection to this XPA\n\t\t options: -all", + NULL, NULL, NULL, XPAReceiveNSConnect, NULL, NULL); + XPACmdAdd(rxpa, "-nsdisconnect", + "\tbreak name server connection to this XPA\n\t\t options: -all", + NULL, NULL, NULL, XPAReceiveNSDisconnect, NULL, NULL); + XPACmdAdd(rxpa, "-remote", + "\tconnect to remote name service with specified acl \n\t\t options: host:port +|-|acl -proxy", + XPASendRemote, NULL, NULL, XPAReceiveRemote, NULL, "fillbuf=false"); + XPACmdAdd(rxpa, "-clipboard", + "\tset/get clipboard information \n\t\t options: [cmd] name", + XPASendClipboard, NULL, NULL, XPAReceiveClipboard, NULL, NULL); + XPACmdAdd(rxpa, "-stimeout", + "\tget (set) short timeout\n\t\t options: seconds|reset", + XPASendSTimeout, NULL, NULL, XPAReceiveSTimeout, NULL, NULL); + XPACmdAdd(rxpa, "-version", + "\treturn XPA version string\n\t\t options: none", + XPASendVersion, NULL, NULL, NULL, NULL, NULL); + } +} + +#ifdef ANSI_FUNC +void +XPAFreeReserved (void) +#else +void XPAFreeReserved() +#endif +{ + XPACmd cmd, tcmd; + if( !rxpa ) return; + /* free reserved commands */ + for(cmd=rxpa->commands; cmd!=NULL; ){ + tcmd = cmd->next; + XPACmdDel(rxpa, cmd); + cmd = tcmd; + } + xfree(rxpa); + rxpa = NULL; +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdLookupReserved + * + * Purpose: lookup a reserved command name + * + * Results: cmd struct or null + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPACmd +XPACmdLookupReserved (XPA xpa, char *lbuf, int *lp) +#else +XPACmd XPACmdLookupReserved(xpa, lbuf, lp) + XPA xpa; + char *lbuf; + int *lp; +#endif +{ + XPACmd cmd; + int lp2=0; + char *lptr; + char name[SZ_LINE]; + + /* make sure we have something to work with */ + if( (rxpa==NULL) || (lbuf==NULL) || (lbuf[*lp]=='\0') ) + return(NULL); + + /* this is where we start parsing */ + lptr = &(lbuf[*lp]); + + /* to simplify life, we assume reserved words are 1 token */ + if( !word(lptr, name, &lp2) ) + return(NULL); + + /* look for reserved keywords that have callbacks */ + for(cmd=rxpa->commands; cmd!=NULL; cmd=cmd->next){ + if( !strcmp(name, cmd->name) ){ + *lp += lp2; + return(cmd); + } + } + + /* nothing, nowhere */ + return(NULL); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdLookup + * + * Purpose: lookup a user-defined command name + * + * Results: cmd struct or null + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPACmd +XPACmdLookup (XPA xpa, char *lbuf, int *lp) +#else +XPACmd XPACmdLookup(xpa, lbuf, lp) + XPA xpa; + char *lbuf; + int *lp; +#endif +{ + XPACmd cmd; + int i; + int lp2; + int len, tlen; + char *lptr; + char tbuf[SZ_LINE]; + char name[SZ_LINE]; + + /* make sure we have something to work with */ + if( (xpa==NULL) || (lbuf==NULL) || (lbuf[*lp]=='\0') ) + return(NULL); + + /* this is where we start parsing */ + lptr = &(lbuf[*lp]); + + /* look up commands for this name */ + for(cmd=xpa->commands; cmd!=NULL; cmd=cmd->next){ + /* make up a name with the required number of tokens for this command */ + *name = '\0'; + lp2 = 0; + tlen = 0; + for(i=0; intokens; i++){ + if( word(lptr, tbuf, &lp2)){ + len = strlen(tbuf)+1; + if( (tlen+len) <= (SZ_LINE-1) ){ + if( *name != '\0' ) + strcat(name, " "); + strcat(name, tbuf); + tlen += len; + } + /* not enough room */ + else{ + *name = '\0'; + break; + } + } + } + /* we now have the name, see if its what we want */ + if( *name && !strcmp(cmd->name, name) ){ + *lp += lp2; + return(cmd); + } + } + + /* did not find the command in this xpa -- now look through reserved */ + return(XPACmdLookupReserved(xpa, lbuf, lp)); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAReceiveCommands + * + * Purpose: process a list of commands from xpaset + * + * Results: number of commands processed + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPAReceiveCommands (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +int XPAReceiveCommands(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + XPACmd cmd; + int lp; + int savelp; + int plen; + int bgot; + int got=0; + int gotbuf=0; + int freebuf=1; + char lbuf[SZ_LINE]; + char tbuf[SZ_LINE]; + char tbuf1[SZ_LINE]; + + /* use ";" as a command separator (as well as \n) */ + newdtable(";"); + + /* if we already have buf, there will be no need to get it */ + if( buf ) + gotbuf++; + + /* if we have no paramlist, we read from the socket */ + if( (xpa_datafd(xpa) >=0) && (!paramlist || (*paramlist == '\0')) ){ + xpa->comm->status |= XPA_STATUS_READBUF; + XPAGets(xpa, xpa_datafd(xpa), lbuf, SZ_LINE, XPALongTimeout()); + FPRINTF((stderr, "%sXPAReceiveCommands: read %s\n", _sp, lbuf)); + } + else{ + xpa->comm->status &= ~XPA_STATUS_READBUF; + nowhite(paramlist, lbuf); + } + + /* we must have something to start with */ + if( *lbuf == '\0' ){ + XPAError(xpa, xpaMessbuf[XPA_RTN_NOCMD2]); + got = -1; + goto done; + } + + /* This look either executes the one set of commands in paramlist, + or reads one line at a time from the socket and executes commands. + In the latter case, each callback can read the socket as well */ + while( 1 ){ + FPRINTF((stderr, "%sXPAReceiveCommands: top of loop: %s\n", _sp, lbuf)); + lp = 0; + while( lbuf[lp] != '\0' ){ + if( (cmd = XPACmdLookup(xpa, lbuf, &lp)) == NULL ){ + XPAError(xpa, xpaMessbuf[XPA_RTN_UNCMD]); + got = -1; + goto done; + } + /* reserved commands can only be called from the same host as the server, + or from local (unix) sockets */ + if( (cmd->xpa == rxpa) && + strcmp(cmd->name, "-help") && strcmp(cmd->name, "-version") ){ + if( XPAMtype() == XPA_INET ){ + if( (!xpa->comm || !LOCALIP(xpa->comm->cmdip)) ){ + FPRINTF((stderr, "%sXPAReceiveCommands: rejecting reserved: %s\n", + _sp, cmd->name)); + XPAError(xpa, xpaMessbuf[XPA_RTN_NOAUTH]); + got = -1; + goto done; + } + } + } + FPRINTF((stderr, "%sXPAReceiveCommands: cmd->name: %s\n", + _sp, cmd->name)); + *tbuf = '\0'; + if( (lastdelim() != ';') && (lastdelim() != '\n') ){ + /* skip white space between command and params */ + while( isspace((int)lbuf[lp]) ) + lp++; + /* here is where the params start */ + savelp = lp; + /* look for command delimiter -- the end of the params */ + while( word(lbuf, tbuf1, &lp) ){ + if( (lastdelim() == ';') || (lastdelim() == '\n') ){ + break; + } + /* make sure a command-ending delim is not next */ + while( isspace((int)lbuf[lp]) ) + lp++; + if( (lbuf[lp] == ';') || (lbuf[lp] == '\n') ){ + break; + } + } + /* get length of parameter list */ + plen = lp - savelp; + /* but skip final delim */ + if( (plen>0) && ((lastdelim() == ';')||(lastdelim() == '\n')) ) + plen--; + /* copy the params up to the command delimiter */ + if( plen > 0 ){ + strncpy(tbuf, &(lbuf[savelp]), plen); + tbuf[plen] = '\0'; + } + } + /* execute the associated XPA callback */ + if( cmd->receive_callback != NULL ){ + /* get buf now, if its needed */ + if( !gotbuf && (xpa_datafd(xpa) >= 0) && + (cmd->receive_mode & XPA_MODE_FILLBUF) ){ + /* read buf -- this buf will stay around for all commands */ + FPRINTF((stderr, "%sXPAReceiveCommands: at XPAGetBuf\n", _sp)); + bgot = XPAGetBuf(xpa, xpa_datafd(xpa), &buf, &len, -1); + /* close the data channel */ + XPACloseData(xpa, xpa->comm); + if( bgot >= 0 ){ + /* got the buffer */ + gotbuf++; + } + /* error getting buf */ + else{ + XPAError(xpa, xpaMessbuf[XPA_RTN_NODATA]); + got = -1; + goto done; + } + } + got = (cmd->receive_callback)(cmd->receive_data, call_data, + tbuf, buf, len); + /* if we don't want to free the buffer, mark it for saving */ + if( (buf != NULL) && !(cmd->receive_mode & XPA_MODE_FREEBUF) ){ + freebuf=0; + } + if( got != 0 ){ + goto done; + } + } + else{ + XPAError(xpa, xpaMessbuf[XPA_RTN_NOREC]); + got = -1; + goto done; + } + } + /* conditions for exiting the command loop: */ + /* if we processed the END command, we are done */ + if( xpa->comm->status & XPA_STATUS_ENDBUF ) + break; + /* if we are not reading the data buffer, we are done */ + if( !(xpa->comm->status & XPA_STATUS_READBUF) ) + break; + /* if we got EOF or error reading the data buffer, we are done */ + if( XPAGets(xpa, xpa_datafd(xpa), lbuf, SZ_LINE, XPALongTimeout()) <=0 ) + break; + } + +done: + /* if no one wants buf, free it now */ + if( freebuf ) + xfree(buf); + /* restore last delimiter table */ + freedtable(); + /* return error code */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPASendCommands + * + * Purpose: process a list of commands from xpaget + * + * Results: number of commands processed (currently 0 or 1) + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPASendCommands (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +int XPASendCommands(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + XPACmd cmd; + char tbuf[SZ_LINE]; + int lp=0; + int got=0; + + /* return help as default */ + if( *paramlist == '\0' ){ + paramlist = "-help"; + } + + /* lookup the command and execute */ + if( (cmd = XPACmdLookup(xpa, paramlist, &lp)) != NULL ){ + /* reserved commands can only be called from the same host as the server, + or from local (unix) sockets */ + if( (cmd->xpa == rxpa) && + strcmp(cmd->name, "-help") && strcmp(cmd->name, "-version") ){ + if( XPAMtype() == XPA_INET ){ + if( (!xpa->comm || !LOCALIP(xpa->comm->cmdip)) ){ + FPRINTF((stderr, "%sXPAReceiveCommands: rejecting reserved: %s\n", + _sp, cmd->name)); + XPAError(xpa, xpaMessbuf[XPA_RTN_NOAUTH]); + got = -1; + goto done; + } + } + } + /* execute the associated XPA send callback, + using the remaining command string as an argument */ + strcpy(tbuf, ¶mlist[lp]); + nocr(tbuf); + if( !strcmp(tbuf, "-help") ){ + if( cmd->help != NULL ) + snprintf(tbuf, SZ_LINE, "%s\n", cmd->help); + else + snprintf(tbuf, SZ_LINE, "\n"); + send(xpa_datafd(xpa), tbuf, strlen(tbuf), 0); + got = 0; + } + else if( cmd->send_callback != NULL ){ + got = (cmd->send_callback)(cmd->send_data, call_data, + ¶mlist[lp], buf, len); + } + else{ + XPAError(xpa, xpaMessbuf[XPA_RTN_NOSEND]); + got = -1; + goto done; + } + } + else{ + XPAError(xpa, xpaMessbuf[XPA_RTN_UNCMD]); + got = -1; + goto done; + } + +done: + /* return error code */ + return(got); +} + +/* + *---------------------------------------------------------------------------- + * + * + * Public Routines and Data + * + * + *---------------------------------------------------------------------------- + */ + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdNew + * + * Purpose: define a named command access point + * + * Results: XPA struct or NULL + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPA +XPACmdNew (char *xclass, char *name) +#else +XPA XPACmdNew(xclass, name) + char *xclass; + char *name; +#endif +{ + XPA xpa; + char tbuf[SZ_LINE]; + + /* we need a name */ + if( (name == NULL) || (*name == '\0') ) + return(NULL); + + /* we need some valid class */ + if( (xclass == NULL) || (*xclass == '\0') ) + xclass = "*"; + + /* help string */ + snprintf(tbuf, SZ_LINE, "XPA commands for %s:%s\n\t\t options: see -help", + xclass, name); + + /* create a new XPA with command callbacks */ + xpa = XPANew(xclass, name, tbuf, + XPASendCommands, NULL, NULL, + XPAReceiveCommands, NULL, "fillbuf=false"); + + /* return the good news */ + return(xpa); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdAdd + * + * Purpose: add a command to a named command access point + * + * Results: 0 on success, -1 for failure + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPACmd +XPACmdAdd (XPA xpa, char *name, char *help, + SendCb send_callback, void *send_data, char *send_mode, + ReceiveCb rec_callback, void *rec_data, char *rec_mode) +#else +XPACmd XPACmdAdd(xpa, name, help, + send_callback, send_data, send_mode, + rec_callback, rec_data, rec_mode) + XPA xpa; + char *name; + char *help; + SendCb send_callback; + void *send_data; + char *send_mode; + ReceiveCb rec_callback; + void *rec_data; + char *rec_mode; +#endif +{ + XPACmd xnew; + XPACmd cur; + XPACmd prev; + + /* make sure we have a valid command record */ + if( !xpa || + (xpa->send_callback != XPASendCommands) || + (xpa->receive_callback != XPAReceiveCommands) ){ + return(NULL); + } + + /* we need either a send or a receive or both */ + if( (send_callback == NULL) && (rec_callback == NULL ) ){ + return(NULL); + } + + /* limit the size of the cmd name designation */ + if( strlen(name) > XPA_NAMELEN ){ + return(NULL); + } + + /* allocate space for a new record */ + xnew = (XPACmd)xcalloc(1, sizeof(struct xpacmdrec)); + + /* backlink to xpa */ + xnew->xpa = xpa; + + /* fill in the blanks */ + xnew->name = XPACmdParseNames(name, &(xnew->ntokens)); + xnew->help = xstrdup(help); + + /* receive callback */ + xnew->send_callback = send_callback; + xnew->send_data = send_data; + xnew->send_mode = XPA_DEF_MODE_SEND; + XPAMode(send_mode, &(xnew->send_mode), "freebuf", XPA_MODE_FREEBUF,1); + /* acl is a global mode */ + XPAMode(send_mode, &(xpa->send_mode), "acl", XPA_MODE_ACL, 1); + + /* receive callback */ + xnew->receive_callback = rec_callback; + xnew->receive_data = rec_data; + /* process the mode string */ + xnew->receive_mode = XPA_DEF_MODE_REC; + XPAMode(rec_mode, &(xnew->receive_mode), "usebuf", XPA_MODE_BUF,1); + XPAMode(rec_mode, &(xnew->receive_mode), "fillbuf", XPA_MODE_FILLBUF,1); + XPAMode(rec_mode, &(xnew->receive_mode), "freebuf", XPA_MODE_FREEBUF,1); + /* acl is a global mode */ + XPAMode(rec_mode, &(xpa->receive_mode), "acl", XPA_MODE_ACL, 1); + + /* enter into list, in alphabetical order */ + if( xpa->commands == NULL ){ + xpa->commands = xnew; + return(xnew); + } + else{ + for(prev=NULL, cur=xpa->commands; cur!=NULL; prev=cur, cur=cur->next){ + /* if new name is an existing name, add it before */ + if( strcmp(xnew->name, cur->name) ==0 ) + goto addname; + /* if existing name is a subset of new name, add it before */ + else if( !strncmp(xnew->name, cur->name, strlen(cur->name)) ) + goto addname; + /* if new name is a subset of existing name, add it after */ + else if( !strncmp(xnew->name, cur->name, strlen(xnew->name)) ) + continue; + /* if new name is lexically greater than existing name, add it after */ + else if( strcmp(xnew->name, cur->name) >0 ) + continue; +addname: + /* add the new name here and return */ + if( prev == NULL ){ + xpa->commands = xnew; + xnew->next = cur; + return(xnew); + } + else{ + prev->next = xnew; + xnew->next = cur; + return(xnew); + } + } + /* if we are still here, we did not find a place to insert, i.e., + we are at the end of the list */ + prev->next = xnew; + return(xnew); + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdDel + * + * Purpose: free a named command access point + * + * Results: none + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPACmdDel (XPA xpa, XPACmd cmd) +#else +int XPACmdDel(xpa, cmd) + XPA xpa; + XPACmd cmd; +#endif +{ + XPACmd cur; + int got=0; + + /* gotta have something to free */ + if( cmd == NULL ) + return(-1); + + /* remove from list of xpa's commands */ + if( xpa && xpa->commands ){ + if( xpa->commands == cmd ){ + xpa->commands = cmd->next; + got++; + } + else{ + for(cur=xpa->commands; cur!=NULL; cur=cur->next){ + if( cur->next == cmd ){ + cur->next = cmd->next; + got++; + break; + } + } + } + } + + /* free up space */ + if( got ){ + if( cmd->name ) + xfree(cmd->name); + if( cmd->help ) + xfree(cmd->help); + xfree(cmd); + return(0); + } + else{ + return(-1); + } +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdInternalReceive + * + * Purpose: internal execute of the receive callback for this command + * + * Results: number of commands processed + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPACmdInternalReceive (void *client_data, void *call_data, + char *paramlist, char *buf, size_t len) +#else +int XPACmdInternalReceive(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + + /* make sure we have something */ + if( xpa == NULL ) + return(-1); + /* make the call */ + return(XPAReceiveCommands(client_data, xpa, paramlist, buf, len)); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPACmdInternalSend + * + * Purpose: internal execute of the send callback for this command + * + * Results: number of commands processed (currently 0 or 1) + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +int +XPACmdInternalSend (void *client_data, void *call_data, + char *paramlist, char **buf, size_t *len) +#else +int XPACmdInternalSend(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + XPA xpa = (XPA)call_data; + + /* make sure we have something */ + if( xpa == NULL ) + return(-1); + + /* make the call */ + return(XPASendCommands(client_data, xpa, paramlist, buf, len)); +} + +/* + *---------------------------------------------------------------------------- + * + * Routine: XPAGetReserved + * + * Purpose: return xpa handle for reserved xpa commands + * + * Return: xpa handle + * + *---------------------------------------------------------------------------- + */ +#ifdef ANSI_FUNC +XPA +XPAGetReserved (void) +#else +XPA XPAGetReserved() +#endif +{ + return(rxpa); +} diff --git a/conf.h b/conf.h new file mode 100644 index 0000000..4831f03 --- /dev/null +++ b/conf.h @@ -0,0 +1,91 @@ +/* conf.h. Generated from conf.h.in by configure. */ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* Define as 1 if you have string.h */ +#define HAVE_STRING_H 1 + +/* Define as 1 if you have stdlib.h */ +#define HAVE_STDLIB_H 1 + +/* Define as 1 if you have malloc.h */ +#define HAVE_MALLOC_H 1 + +/* Define as 1 if you have unistd.h */ +#define HAVE_UNISTD_H 1 + +/* Define as 1 if you have getopt.h */ +#define HAVE_GETOPT_H 1 + +/* Define as 1 if you have pwd.h */ +#define HAVE_PWD_H 1 + +/* Define as 1 if you have values.h */ +#define HAVE_VALUES_H 1 + +/* Define as 1 if you have dlfcn.h */ +#define HAVE_DLFCN_H 1 + +/* Define as 1 if you have sys/un.h */ +#define HAVE_SYS_UN_H 1 + +/* Define as 1 if you have sys/shm.h */ +#define HAVE_SYS_SHM_H 1 + +/* Define as 1 if you have sys/mman.h */ +#define HAVE_SYS_MMAN_H 1 + +/* Define as 1 if you have sys/ipc.h */ +#define HAVE_SYS_IPC_H 1 + +/* Define as 1 if you have setjmp.h */ +#define HAVE_SETJMP_H 1 + +/* Define as 1 if you have socklen_t */ +#define HAVE_SOCKLEN_T 1 + +/* Define as 1 if you have strchr */ +#define HAVE_STRCHR 1 + +/* Define as 1 if you have memcpy */ +#define HAVE_MEMCPY 1 + +/* Define as 1 if you have snprintf */ +#define HAVE_SNPRINTF 1 + +/* Define as 1 if you have setenv */ +#define HAVE_SETENV 1 + +/* Define as 1 if you have posix_spawn */ +/* #undef HAVE_POSIX_SPAWN */ + +/* Define as 1 if you have crt_externs.h */ +/* #undef HAVE_CRT_EXTERNS_H */ + +/* Define as 1 if you have NSGetEvniron */ +/* #undef HAVE__NSGETENVIRON */ + +/* Define as 1 if you have atexit */ +#define HAVE_ATEXIT 1 + +/* Define as 1 if you have pthread library */ +/* #undef HAVE_LIBPTHREAD */ + +/* Define as 1 if you need reentrant errno, etc. */ +/* #undef _REENTRANT */ + +/* Define as 1 if you have Tcl */ +/* #undef HAVE_TCL */ + +/* Define as 1 if you have Xt */ +#define HAVE_XT 1 + +/* Define as 1 if you have Gtk */ +/* #undef HAVE_GTK */ + +/* Define as 1 if you are running Cygwin. */ +/* #undef HAVE_CYGWIN */ + +/* Define as 1 if you are running MinGW. */ +/* #undef HAVE_MINGW32 */ diff --git a/conf.h.in b/conf.h.in new file mode 100644 index 0000000..d78af89 --- /dev/null +++ b/conf.h.in @@ -0,0 +1,90 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* Define as 1 if you have string.h */ +#undef HAVE_STRING_H + +/* Define as 1 if you have stdlib.h */ +#undef HAVE_STDLIB_H + +/* Define as 1 if you have malloc.h */ +#undef HAVE_MALLOC_H + +/* Define as 1 if you have unistd.h */ +#undef HAVE_UNISTD_H + +/* Define as 1 if you have getopt.h */ +#undef HAVE_GETOPT_H + +/* Define as 1 if you have pwd.h */ +#undef HAVE_PWD_H + +/* Define as 1 if you have values.h */ +#undef HAVE_VALUES_H + +/* Define as 1 if you have dlfcn.h */ +#undef HAVE_DLFCN_H + +/* Define as 1 if you have sys/un.h */ +#undef HAVE_SYS_UN_H + +/* Define as 1 if you have sys/shm.h */ +#undef HAVE_SYS_SHM_H + +/* Define as 1 if you have sys/mman.h */ +#undef HAVE_SYS_MMAN_H + +/* Define as 1 if you have sys/ipc.h */ +#undef HAVE_SYS_IPC_H + +/* Define as 1 if you have setjmp.h */ +#undef HAVE_SETJMP_H + +/* Define as 1 if you have socklen_t */ +#undef HAVE_SOCKLEN_T + +/* Define as 1 if you have strchr */ +#undef HAVE_STRCHR + +/* Define as 1 if you have memcpy */ +#undef HAVE_MEMCPY + +/* Define as 1 if you have snprintf */ +#undef HAVE_SNPRINTF + +/* Define as 1 if you have setenv */ +#undef HAVE_SETENV + +/* Define as 1 if you have posix_spawn */ +#undef HAVE_POSIX_SPAWN + +/* Define as 1 if you have crt_externs.h */ +#undef HAVE_CRT_EXTERNS_H + +/* Define as 1 if you have NSGetEvniron */ +#undef HAVE__NSGETENVIRON + +/* Define as 1 if you have atexit */ +#undef HAVE_ATEXIT + +/* Define as 1 if you have pthread library */ +#undef HAVE_LIBPTHREAD + +/* Define as 1 if you need reentrant errno, etc. */ +#undef _REENTRANT + +/* Define as 1 if you have Tcl */ +#undef HAVE_TCL + +/* Define as 1 if you have Xt */ +#undef HAVE_XT + +/* Define as 1 if you have Gtk */ +#undef HAVE_GTK + +/* Define as 1 if you are running Cygwin. */ +#undef HAVE_CYGWIN + +/* Define as 1 if you are running MinGW. */ +#undef HAVE_MINGW32 diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..22906b3 --- /dev/null +++ b/config.guess @@ -0,0 +1,1495 @@ +#! /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-03-13' + +# 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 powerppc-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/[-(].*//'` ;; + *) + 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*:[345]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + 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 ;; + 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(__sun) + 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/config.sub b/config.sub new file mode 100755 index 0000000..5705e54 --- /dev/null +++ b/config.sub @@ -0,0 +1,1609 @@ +#! /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-03-07' + +# 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 \ + | 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 \ + | 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 \ + | 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 \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + 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-* \ + | 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-* \ + | 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-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # 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 + ;; + 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*) + # 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 + *-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/configure b/configure new file mode 100755 index 0000000..9c209a7 --- /dev/null +++ b/configure @@ -0,0 +1,9696 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.63 for xpa 2.1.15. +# +# Report bugs to . +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# 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.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); 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. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# 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 || +$as_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=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_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=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_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 bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + 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" || + { $as_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 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +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='xpa' +PACKAGE_TARNAME='xpa' +PACKAGE_VERSION='2.1.15' +PACKAGE_STRING='xpa 2.1.15' +PACKAGE_BUGREPORT='saord@cfa.harvard.edu' + +ac_unique_file="./xpa.h" +# 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='LTLIBOBJS +LIBOBJS +EXTRA_LIBS +GTK_LIBS +GTK_CFLAGS +TCL_LIBS +TCL_CFLAGS +TCL_STUB_LIB_SPEC +TCL_STUB_LIB_FLAG +TCL_STUB_LIB_FILE +TCL_LIB_SPEC +TCL_LIB_FLAG +TCL_LIB_FILE +TCL_SRC_DIR +TCL_BIN_DIR +TCL_VERSION +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +LLIB +DOSHARED +TLIB +RANLIB +SZ_LONG +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_threaded_xpans +enable_shared +enable_posix_spawn +with_x +with_tcl +with_threads +with_gtk +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +XMKMF' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { $as_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 && + { $as_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. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { $as_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 + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_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 -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_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" || { $as_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 xpa 2.1.15 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/xpa] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xpa 2.1.15:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-threaded-xpans build threaded xpans + --enable-shared build shared libraries + --enable-posix_spawn use posix_spawn() if available + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-x use the X Window System + --with-tcl directory containing tcl configuration (tclConfig.sh) + --with-threads build for use in threaded programs + --with-gtk= include directory for gtk e.g. /usr/include/gtk-1.2 + +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 + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +xpa configure 2.1.15 +generated by GNU Autoconf 2.63 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 xpa $as_me 2.1.15, which was +generated by GNU Autoconf 2.63. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) 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_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_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=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_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 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (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 an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + 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 + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_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 conf.h" + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_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. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_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` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_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 + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_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 + + + +# save LDFLAGS +XLDFLAGS="$LDFLAGS" + +# +# checks that we use in most projects +# +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_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. +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_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.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_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 | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_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. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_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 +$as_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 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + +rm -f -r a.out a.out.dSYM 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. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_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 | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$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 + + + +if test x"${EXEEXT}" = "xno"; then + EXEEXT="" +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_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 + + +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + 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 + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + 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 + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep 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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if test "${ac_cv_sizeof_long+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; +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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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_hi=$ac_mid; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; +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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; +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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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_lo=$ac_mid; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo= ac_hi= +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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_hi=$ac_mid +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_lo=`expr '(' $ac_mid ')' + 1` +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute sizeof (long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long=0 + fi ;; +esac +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 +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (((long int) (sizeof (long))) < 0) + { + long int i = longval (); + if (i != ((long int) (sizeof (long)))) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (long)))) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute sizeof (long) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long=0 + fi +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +SZ_LONG=$ac_cv_sizeof_long + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$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 malloc.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in getopt.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in pwd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in values.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in setjmp.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/un.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/shm.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/mman.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/ipc.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +if (sizeof (socklen_t)) + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +if (sizeof ((socklen_t))) + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SOCKLEN_T 1 +_ACEOF + + +fi + + +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const /**/ +_ACEOF + +fi + + + + + + + +for ac_func in strchr memcpy snprintf atexit setenv +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:$LINENO: checking for connect" >&5 +$as_echo_n "checking for connect... " >&6; } +if test "${ac_cv_func_connect+set}" = set; then + $as_echo_n "(cached) " >&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 connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* 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 connect (); +/* 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_connect || defined __stub___connect +choke me +#endif + +int +main () +{ +return connect (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_connect=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +$as_echo "$ac_cv_func_connect" >&6; } + +if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_connect+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $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 connect (); +int +main () +{ +return connect (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_socket_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_connect=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = x""yes; then + EXTRA_LIBS="$EXTRA_LIBS -lsocket" +fi + +fi +{ $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } +if test "${ac_cv_func_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&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 gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* 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 gethostbyname (); +/* 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_gethostbyname || defined __stub___gethostbyname +choke me +#endif + +int +main () +{ +return gethostbyname (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } + +if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $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 gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_nsl_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostbyname=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then + EXTRA_LIBS="$EXTRA_LIBS -lnsl" +fi + +fi +# AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb") + +# +# checks specific to this project +# + +{ $as_echo "$as_me:$LINENO: checking for threaded xpans" >&5 +$as_echo_n "checking for threaded xpans... " >&6; } +# Check whether --enable-threaded-xpans was given. +if test "${enable_threaded_xpans+set}" = set; then + enableval=$enable_threaded_xpans; fun_ok=$enableval +else + fun_ok=no +fi + +if test "$fun_ok" = "yes"; then + { $as_echo "$as_me:$LINENO: result: $fun_ok" >&5 +$as_echo "$fun_ok" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } +if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $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 pthread_create (); +int +main () +{ +return pthread_create (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_pthread_pthread_create=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_pthread_create=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } +if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then + have_pthread=yes +fi + + if test x"${have_pthread}" = x"yes"; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _REENTRANT 1 +_ACEOF + + TLIB="-lpthread" + else + { { $as_echo "$as_me:$LINENO: error: no threads found ... can't use enable-threaded-xpans" >&5 +$as_echo "$as_me: error: no threads found ... can't use enable-threaded-xpans" >&2;} + { (exit 1); exit 1; }; } + fi +else + { $as_echo "$as_me:$LINENO: result: $fun_ok" >&5 +$as_echo "$fun_ok" >&6; } +fi + + +{ $as_echo "$as_me:$LINENO: checking for shared library build" >&5 +$as_echo_n "checking for shared library build... " >&6; } +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; fun_ok=$enableval +else + fun_ok=no +fi + +if test "$fun_ok" != "no"; then + fpic="yes" + DOSHARED=shlib + + if test "$fun_ok" = "link"; then + LLIB="-L. -l$PACKAGE_NAME" + else + LLIB='$(LIB)' + fi +else + DOSHARED="" + LLIB='$(LIB)' +fi + +{ $as_echo "$as_me:$LINENO: result: $fun_ok" >&5 +$as_echo "$fun_ok" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for request to use posix_spawn" >&5 +$as_echo_n "checking for request to use posix_spawn... " >&6; } +# Check whether --enable-posix_spawn was given. +if test "${enable_posix_spawn+set}" = set; then + enableval=$enable_posix_spawn; fun_ok=$enableval +else + fun_ok=no +fi + +{ $as_echo "$as_me:$LINENO: result: $fun_ok" >&5 +$as_echo "$fun_ok" >&6; } +if test "$fun_ok" = "yes"; then + + +for ac_func in posix_spawn _NSGetEnviron +do +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + eval "$as_ac_var=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_header in crt_externs.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + $as_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 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------------ ## +## Report this to saord@cfa.harvard.edu ## +## ------------------------------------ ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + +fi +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +fi + +{ $as_echo "$as_me:$LINENO: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5 +$as_echo "$as_me: error: cannot use X directory names containing '" >&2;} + { (exit 1); exit 1; }; };; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 + # We can compile using X headers with no special include directory. +ac_x_includes= +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi + +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XrmInitialize () + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:$LINENO: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\_ACEOF +#define X_DISPLAY_MISSING 1 +_ACEOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + LIBS="$ac_xsave_LIBS -R $x_libraries" + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: result: neither works" >&5 +$as_echo "neither works" >&6; } +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + 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 XOpenDisplay (); +int +main () +{ +return XOpenDisplay (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $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 dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dnet_dnet_ntoa=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dnet_dnet_ntoa=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $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 dnet_ntoa (); +int +main () +{ +return dnet_ntoa (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } +if test "${ac_cv_func_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&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 gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* 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 gethostbyname (); +/* 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_gethostbyname || defined __stub___gethostbyname +choke me +#endif + +int +main () +{ +return gethostbyname (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_gethostbyname=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } + + if test $ac_cv_func_gethostbyname = no; then + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $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 gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_nsl_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_nsl_gethostbyname=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $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 gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_bsd_gethostbyname=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bsd_gethostbyname=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + { $as_echo "$as_me:$LINENO: checking for connect" >&5 +$as_echo_n "checking for connect... " >&6; } +if test "${ac_cv_func_connect+set}" = set; then + $as_echo_n "(cached) " >&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 connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* 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 connect (); +/* 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_connect || defined __stub___connect +choke me +#endif + +int +main () +{ +return connect (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_connect=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +$as_echo "$ac_cv_func_connect" >&6; } + + if test $ac_cv_func_connect = no; then + { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_connect+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_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 connect (); +int +main () +{ +return connect (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_socket_connect=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_connect=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = x""yes; then + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + { $as_echo "$as_me:$LINENO: checking for remove" >&5 +$as_echo_n "checking for remove... " >&6; } +if test "${ac_cv_func_remove+set}" = set; then + $as_echo_n "(cached) " >&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 remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef remove + +/* 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 remove (); +/* 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_remove || defined __stub___remove +choke me +#endif + +int +main () +{ +return remove (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_remove=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_remove=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +$as_echo "$ac_cv_func_remove" >&6; } + + if test $ac_cv_func_remove = no; then + { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if test "${ac_cv_lib_posix_remove+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $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 remove (); +int +main () +{ +return remove (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_posix_remove=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_posix_remove=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + { $as_echo "$as_me:$LINENO: checking for shmat" >&5 +$as_echo_n "checking for shmat... " >&6; } +if test "${ac_cv_func_shmat+set}" = set; then + $as_echo_n "(cached) " >&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 shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shmat + +/* 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 shmat (); +/* 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_shmat || defined __stub___shmat +choke me +#endif + +int +main () +{ +return shmat (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_func_shmat=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shmat=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +$as_echo "$ac_cv_func_shmat" >&6; } + + if test $ac_cv_func_shmat = no; then + { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $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 shmat (); +int +main () +{ +return shmat (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_ipc_shmat=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ipc_shmat=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = x""yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_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 IceConnectionNumber (); +int +main () +{ +return IceConnectionNumber (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_ICE_IceConnectionNumber=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ICE_IceConnectionNumber=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + +if test x"${have_x}" = "xyes"; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_XT 1 +_ACEOF + +fi + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then + withval=$with_tcl; with_tclconfig=${withval} +fi + + { $as_echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } + if test x"${withval}" != xno ; then + if test "${ac_cv_c_tclconfig+set}" = set; then + $as_echo_n "(cached) " >&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { $as_echo "$as_me:$LINENO: result: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +$as_echo "${with_tclconfig} directory doesn't contain tclConfig.sh" >&6; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + else + { $as_echo "$as_me:$LINENO: result: skipping Tcl configuration" >&5 +$as_echo "skipping Tcl configuration" >&6; } + ac_cv_c_tclconfig="none" + fi + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { $as_echo "$as_me:$LINENO: result: can't find Tcl configuration definitions" >&5 +$as_echo "can't find Tcl configuration definitions" >&6; } +# no Tcl is OK egm 03/25/03 +# AC_MSG_WARN(Can't find Tcl configuration definitions) +# exit 0 + elif test x"${ac_cv_c_tclconfig}" = xnone ; then + TCL_BIN_DIR="" + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + { $as_echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 +$as_echo "found $TCL_BIN_DIR/tclConfig.sh" >&6; } + fi + fi + +if test x"${no_tcl}" = x ; then + + { $as_echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +$as_echo_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh... " >&6; } + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + { $as_echo "$as_me:$LINENO: result: loading" >&5 +$as_echo "loading" >&6; } + . $TCL_BIN_DIR/tclConfig.sh + else + { $as_echo "$as_me:$LINENO: result: file not found" >&5 +$as_echo "file not found" >&6; } + fi + + # + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f $TCL_BIN_DIR/Makefile ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + fi + + # + # eval is required to do the TCL_DBGX substitution + # + + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + if test -r $TCL_PREFIX/include/tcl.h; then + TCL_CFLAGS="$TCL_INCLUDE_SPEC" + if test x"$DOSHARED" != x -a x"$TCL_SUPPORTS_STUBS" = x1; then + TCL_LIBS="$TCL_STUB_LIB_SPEC" + TCL_CFLAGS="$TCL_CFLAGS -DUSE_TCL_STUBS=1" + { $as_echo "$as_me:$LINENO: result: Tcl support will utilize stubs library: $TCL_LIBS" >&5 +$as_echo "Tcl support will utilize stubs library: $TCL_LIBS" >&6; } + else + TCL_LIBS="$TCL_LIB_SPEC" + { $as_echo "$as_me:$LINENO: result: Tcl support will utilize library: $TCL_LIBS" >&5 +$as_echo "Tcl support will utilize library: $TCL_LIBS" >&6; } + fi + cat >>confdefs.h <<\_ACEOF +#define HAVE_TCL 1 +_ACEOF + + else + if test x"${with_tclconfig}" != x ; then + TCL_CFLAGS="$TCL_INCLUDE_SPEC" + TCL_LIBS="$TCL_LIB_SPEC" + cat >>confdefs.h <<\_ACEOF +#define HAVE_TCL 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: warning: tcl.h not found with --with-tcl ... tcl build might fail" >&5 +$as_echo "warning: tcl.h not found with --with-tcl ... tcl build might fail" >&6; } + else + { $as_echo "$as_me:$LINENO: result: $TCL_PREFIX/include/tcl.h not found ... use --with-tcl to build tcl explicitly" >&5 +$as_echo "$TCL_PREFIX/include/tcl.h not found ... use --with-tcl to build tcl explicitly" >&6; } + fi + fi +fi + + + +{ $as_echo "$as_me:$LINENO: checking for incorporation of thread support" >&5 +$as_echo_n "checking for incorporation of thread support... " >&6; } + +# Check whether --with-threads was given. +if test "${with_threads+set}" = set; then + withval=$with_threads; thr=1 +else + thr=0 +fi + +if test x"$thr" = x1 ; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$CFLAGS -D_REENTRANT" +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + +{ $as_echo "$as_me:$LINENO: checking for gtk" >&5 +$as_echo_n "checking for gtk... " >&6; } + +# Check whether --with-gtk was given. +if test "${with_gtk+set}" = set; then + withval=$with_gtk; havelib=1 +else + havelib=0 +fi + +if test x"$havelib" = x1 ; then + { $as_echo "$as_me:$LINENO: result: yes ($withval)" >&5 +$as_echo "yes ($withval)" >&6; } + GTK_CFLAGS="`pkg-config gtk+-2.0 --cflags` -DHAVE_GTK=1" + GTK_LIBS="`pkg-config gtk+-2.0 --libs`" + cat >>confdefs.h <<\_ACEOF +#define HAVE_GTK 1 +_ACEOF + +else + GTK_CFLAGS="" + GTK_LIBS="" + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +# restore LDFLAGS +LDFLAGS="$LDFLAGS $XLDFLAGS" + +{ $as_echo "$as_me:$LINENO: checking $host_os configuration" >&5 +$as_echo_n "checking $host_os configuration... " >&6; } +case $host_os in + *cygwin*|*Cygwin* ) + cat >>confdefs.h <<\_ACEOF +#define HAVE_CYGWIN 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: flagging Cygwin" >&5 +$as_echo "flagging Cygwin" >&6; } + ;; + *mingw32*|*Mingw32*) + CFLAGS="$CFLAGS -mconsole" + EXTRA_LIBS="$EXTRA_LIBS -lwsock32" + cat >>confdefs.h <<\_ACEOF +#define HAVE_MINGW32 1 +_ACEOF + + { $as_echo "$as_me:$LINENO: result: flagging MinGW" >&5 +$as_echo "flagging MinGW" >&6; } + ;; + *darwin*|*Darwin*) + LDFLAGS="$LDFLAGS $CFLAGS" + G=`$CC -v 2>&1 | grep version | awk '{print $3}' | awk -F. '{print $1$2}'` + if test x"$G" != x -a "$G" -lt 42; then + CFLAGS="$CFLAGS -no-cpp-precomp" + fi + if test x"$TCL_PREFIX" = x"/usr/local"; then + TCL_CFLAGS="" + { $as_echo "$as_me:$LINENO: result: removing -I/usr/local/include" >&5 +$as_echo "removing -I/usr/local/include" >&6; } + fi + ;; + *osf*|*Osf*) + { $as_echo "$as_me:$LINENO: checking for snprintf in -ldb" >&5 +$as_echo_n "checking for snprintf in -ldb... " >&6; } +if test "${ac_cv_lib_db_snprintf+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldb $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 snprintf (); +int +main () +{ +return snprintf (); + ; + 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$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 + $as_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 && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_db_snprintf=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_db_snprintf=no +fi + +rm -rf conftest.dSYM +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 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_db_snprintf" >&5 +$as_echo "$ac_cv_lib_db_snprintf" >&6; } +if test "x$ac_cv_lib_db_snprintf" = x""yes; then + EXTRA_LIBS="$EXTRA_LIBS -ldb" +fi + + ;; + * ) + if test x"$fpic" = x"yes" ; then + if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + CFLAGS="$CFLAGS -fPIC" + { $as_echo "$as_me:$LINENO: result: adding -fPIC to gcc" >&5 +$as_echo "adding -fPIC to gcc" >&6; } + else + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } + fi + else + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } + fi + ;; +esac + + + +ac_config_files="$ac_config_files Makefile" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $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" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + 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 + + + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# 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 + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + +# 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.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); 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. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# 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 || +$as_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" || + { $as_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 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +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 xpa $as_me 2.1.15, which was +generated by GNU Autoconf 2.63. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTION]... [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_version="\\ +xpa config.status 2.1.15 +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2008 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' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { $as_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 || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "conf.h") CONFIG_HEADERS="$CONFIG_HEADERS conf.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_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 +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") +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_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 +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_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 || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_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 || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; 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 '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + 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=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } + fi + ;; + + + esac + +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + +# 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 +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..9731067 --- /dev/null +++ b/configure.ac @@ -0,0 +1,213 @@ +# This file is an input file used by the GNU "autoconf" program to +# generate the file "configure", which is run during XPA installation +# to configure the system for the local environment. +AC_INIT(xpa, 2.1.15, saord@cfa.harvard.edu, xpa) + +AC_CONFIG_HEADERS([conf.h]) +AC_CONFIG_SRCDIR(./xpa.h) +AC_CANONICAL_HOST + +# save LDFLAGS +XLDFLAGS="$LDFLAGS" + +# +# checks that we use in most projects +# +AC_PROG_CC + +AC_EXEEXT +if test x"${EXEEXT}" = "xno"; then + EXEEXT="" +fi + +AC_CHECK_SIZEOF(long) +SZ_LONG=$ac_cv_sizeof_long +AC_SUBST(SZ_LONG) + +AC_PROG_RANLIB + +AC_HEADER_STDC +AC_CHECK_HEADERS(malloc.h) +AC_CHECK_HEADERS(getopt.h) +AC_CHECK_HEADERS(pwd.h) +AC_CHECK_HEADERS(values.h) +AC_CHECK_HEADERS(dlfcn.h) +AC_CHECK_HEADERS(setjmp.h) +AC_CHECK_HEADERS(sys/un.h) +AC_CHECK_HEADERS(sys/shm.h) +AC_CHECK_HEADERS(sys/mman.h) +AC_CHECK_HEADERS(sys/ipc.h) + +AC_CHECK_TYPES([socklen_t], [], [], [#include ]) + +AC_C_CONST + +AC_CHECK_FUNCS(strchr memcpy snprintf atexit setenv) + +AC_CHECK_FUNC(connect) +if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, EXTRA_LIBS="$EXTRA_LIBS -lsocket") +fi +AC_CHECK_FUNC(gethostbyname) +if test $ac_cv_func_gethostbyname = no; then + AC_CHECK_LIB(nsl, gethostbyname, EXTRA_LIBS="$EXTRA_LIBS -lnsl") +fi +# AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb") + +# +# checks specific to this project +# + +AC_MSG_CHECKING(for threaded xpans) +AC_ARG_ENABLE(threaded-xpans, [ --enable-threaded-xpans build threaded xpans], + [fun_ok=$enableval], [fun_ok=no]) +if test "$fun_ok" = "yes"; then + AC_MSG_RESULT($fun_ok) + AC_CHECK_LIB(pthread, pthread_create, have_pthread=yes) + if test x"${have_pthread}" = x"yes"; then + AC_DEFINE(HAVE_LIBPTHREAD) + AC_DEFINE(_REENTRANT) + TLIB="-lpthread" + else + AC_MSG_ERROR([no threads found ... can't use enable-threaded-xpans], 1) + fi +else + AC_MSG_RESULT($fun_ok) +fi +AC_SUBST(TLIB) + +AC_MSG_CHECKING(for shared library build) +AC_ARG_ENABLE(shared, [ --enable-shared build shared libraries], + [fun_ok=$enableval], [fun_ok=no]) +if test "$fun_ok" != "no"; then + fpic="yes" + DOSHARED=shlib + AC_SUBST(DOSHARED) + if test "$fun_ok" = "link"; then + LLIB="-L. -l$PACKAGE_NAME" + else + LLIB='$(LIB)' + fi +else + DOSHARED="" + LLIB='$(LIB)' +fi +AC_SUBST(LLIB) +AC_MSG_RESULT($fun_ok) + +AC_MSG_CHECKING(for request to use posix_spawn) +AC_ARG_ENABLE(posix_spawn, [ --enable-posix_spawn use posix_spawn() if available], + [fun_ok=$enableval], [fun_ok=no]) +AC_MSG_RESULT($fun_ok) +if test "$fun_ok" = "yes"; then + AC_CHECK_FUNCS(posix_spawn _NSGetEnviron) + AC_CHECK_HEADERS(crt_externs.h) +fi + +AC_PATH_XTRA +if test x"${have_x}" = "xyes"; then + AC_DEFINE(HAVE_XT) +fi + +SC_PATH_TCLCONFIG +if test x"${no_tcl}" = x ; then + SC_LOAD_TCLCONFIG + if test -r $TCL_PREFIX/include/tcl.h; then + TCL_CFLAGS="$TCL_INCLUDE_SPEC" + if test x"$DOSHARED" != x -a x"$TCL_SUPPORTS_STUBS" = x1; then + TCL_LIBS="$TCL_STUB_LIB_SPEC" + TCL_CFLAGS="$TCL_CFLAGS -DUSE_TCL_STUBS=1" + AC_MSG_RESULT([Tcl support will utilize stubs library: $TCL_LIBS]) + else + TCL_LIBS="$TCL_LIB_SPEC" + AC_MSG_RESULT([Tcl support will utilize library: $TCL_LIBS]) + fi + AC_DEFINE(HAVE_TCL) + else + if test x"${with_tclconfig}" != x ; then + TCL_CFLAGS="$TCL_INCLUDE_SPEC" + TCL_LIBS="$TCL_LIB_SPEC" + AC_DEFINE(HAVE_TCL) + AC_MSG_RESULT([warning: tcl.h not found with --with-tcl ... tcl build might fail]) + else + AC_MSG_RESULT([$TCL_PREFIX/include/tcl.h not found ... use --with-tcl to build tcl explicitly]) + fi + fi +fi +AC_SUBST(TCL_CFLAGS) +AC_SUBST(TCL_LIBS) + +AC_MSG_CHECKING(for incorporation of thread support) +AC_ARG_WITH(threads, + [ --with-threads build for use in threaded programs], thr=1, thr=0) +if test x"$thr" = x1 ; then + AC_MSG_RESULT(yes) + CFLAGS="$CFLAGS -D_REENTRANT" +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(for gtk) +AC_ARG_WITH(gtk, + [ --with-gtk= include directory for gtk e.g. /usr/include/gtk-1.2], havelib=1, havelib=0) +if test x"$havelib" = x1 ; then + AC_MSG_RESULT(yes ($withval)) + GTK_CFLAGS="`pkg-config gtk+-2.0 --cflags` -DHAVE_GTK=1" + GTK_LIBS="`pkg-config gtk+-2.0 --libs`" + AC_DEFINE(HAVE_GTK) +else + GTK_CFLAGS="" + GTK_LIBS="" + AC_MSG_RESULT(no) +fi +AC_SUBST(GTK_CFLAGS) +AC_SUBST(GTK_LIBS) + +# restore LDFLAGS +LDFLAGS="$LDFLAGS $XLDFLAGS" + +AC_MSG_CHECKING([$host_os configuration]) +case $host_os in + *cygwin*|*Cygwin* ) + AC_DEFINE(HAVE_CYGWIN) + AC_MSG_RESULT([flagging Cygwin]) + ;; + *mingw32*|*Mingw32*) + CFLAGS="$CFLAGS -mconsole" + EXTRA_LIBS="$EXTRA_LIBS -lwsock32" + AC_DEFINE(HAVE_MINGW32) + AC_MSG_RESULT([flagging MinGW]) + ;; + *darwin*|*Darwin*) + LDFLAGS="$LDFLAGS $CFLAGS" + G=`$CC -v 2>&1 | grep version | awk '{print $3}' | awk -F. '{print $1$2}'` + if test x"$G" != x -a "$G" -lt 42; then + CFLAGS="$CFLAGS -no-cpp-precomp" + fi + if test x"$TCL_PREFIX" = x"/usr/local"; then + TCL_CFLAGS="" + AC_MSG_RESULT([removing -I/usr/local/include]) + fi + ;; + *osf*|*Osf*) + AC_CHECK_LIB(db, snprintf, EXTRA_LIBS="$EXTRA_LIBS -ldb") + ;; + * ) + if test x"$fpic" = x"yes" ; then + if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + CFLAGS="$CFLAGS -fPIC" + AC_MSG_RESULT([adding -fPIC to gcc]) + else + AC_MSG_RESULT(none) + fi + else + AC_MSG_RESULT(none) + fi + ;; +esac + +AC_SUBST(EXTRA_LIBS) + +AC_CONFIG_FILES(Makefile) + +AC_OUTPUT diff --git a/ctest.c b/ctest.c new file mode 100644 index 0000000..b4827d1 --- /dev/null +++ b/ctest.c @@ -0,0 +1,684 @@ +/* + * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory + */ + +/* + * + * ctest -- client test for xpa + * + */ +#include + +extern char *optarg; +extern int optind; + +int quiet=0; +int dowait=0; +int n=0; +int don=0; +int save_bytes=-1; +int exitonerror=0; +char *save_buf=NULL; +char *mode=""; +char name[SZ_LINE]; + +#define MAX_FPS 4 + +#ifdef ANSI_FUNC +int +send_cb (void *client_data, void *call_data, char *paramlist, + char **buf, size_t *len) +#else +int send_cb(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char **buf; + size_t *len; +#endif +{ + char *s = (char *)client_data; + XPA xpa = (XPA)call_data; + char tbuf[SZ_LINE]; + int sendbuf=0; + + /* introduce ourselves */ + if( !quiet ){ + fprintf(stdout, "SEND_CB #%d: %s:%s (%s)\n", + n++, xpa_class(xpa), xpa_name(xpa), s); + } + + /* process special paramlist tokens */ + if( paramlist && *paramlist ){ + if( !quiet ) + fprintf(stdout, "\tparamlist: %s\n", paramlist); + if( !strncmp(paramlist, "buf", 3) ){ + sendbuf=1; + } + else if( !strncmp(paramlist, "error", 5) ){ + if( !quiet ) + fprintf(stdout, "\treturning error: %s\n", ¶mlist[6]); + *len = 0; + *buf = NULL; + XPAError(xpa, ¶mlist[6]); + return(-1); + } + else if( !strcmp(paramlist, "exit") ){ + if( !quiet ) + fprintf(stdout, "Exiting\n"); + exit(0); + } + else if( !strcmp(paramlist, "wait") ){ + fprintf(stdout, "Press to continue ..."); + fgets(tbuf, SZ_LINE, stdin); + } + } + else if( dowait ){ + fprintf(stdout, "Press to continue ..."); + fgets(tbuf, SZ_LINE, stdin); + } + + /* return information about this xpa */ + if( !sendbuf ){ + snprintf(tbuf, SZ_LINE, + "nclass: %s\nname: %s\nmethod: %s\nsendian: %s\ncendian: %s\n", + xpa_class(xpa), xpa_name(xpa), xpa_method(xpa), + xpa_sendian(xpa), xpa_cendian(xpa)); + + if( (xpa->send_mode & XPA_MODE_FILLBUF) ){ + send(xpa_datafd(xpa), tbuf, strlen(tbuf), 0); + *len = 0; + *buf = NULL; + if( !quiet) + fprintf(stdout, "\tcallback writes %d bytes to client\n", + (int)strlen(tbuf)); + } + /* return the buffer and let xpa transmit it */ + else{ + *len = strlen(tbuf); + *buf = (char *)xmalloc(*len); + memcpy(*buf, tbuf, *len); + if( !quiet) + fprintf(stdout, "\tcallback returns %d bytes to xpa handler\n", + (int)strlen(tbuf)); + } + } + /* return the last buffer we were sent */ + else{ + if( (xpa->send_mode & XPA_MODE_FILLBUF) ){ + send(xpa_datafd(xpa), save_buf, save_bytes, 0); + *len = 0; + *buf = NULL; + if( !quiet) + fprintf(stdout, "\tcallback writes %d bytes to client\n", save_bytes); + } + /* return the buffer and let xpa transmit it */ + else{ + *len = save_bytes; + *buf = (char *)xmalloc(*len); + memcpy(*buf, save_buf, *len); + if( !quiet) + fprintf(stdout, "\tcallback returns %d bytes to xpa handler\n", + save_bytes); + } + } + fflush(stdout); + fflush(stderr); + return(0); +} + +#ifdef ANSI_FUNC +int +receive_cb (void *client_data, void *call_data, char *paramlist, + char *buf, size_t len) +#else +int receive_cb(client_data, call_data, paramlist, buf, len) + void *client_data; + void *call_data; + char *paramlist; + char *buf; + size_t len; +#endif +{ + XPA xpa = (XPA)call_data; + char *s = (char *)client_data; + char tbuf[SZ_LINE]; + char *errs[1]; + int i; + int ip; + int got; + int xwait; + + if( !quiet ){ + fprintf(stdout, "RECEIVE_CB #%d: %s:%s (%s)\n", + n++, xpa_class(xpa), xpa_name(xpa), s); + } + if( !quiet ){ + fprintf(stdout, "\tbuf: %lu bytes\n", (unsigned long)len); + } + + /* process param list */ + if( paramlist && *paramlist ){ + if( !quiet ) + fprintf(stdout, "\tparamlist: %s\n", paramlist); + if( !strcmp(paramlist, "free") ){ + if( !quiet ) + fprintf(stdout, "Freeing xpa struct\n"); + XPAFree(xpa); + return(0); + } + else if( !strncmp(paramlist, "error", 5) ){ + if( !quiet ) + fprintf(stdout, "Processing error: %s\n", ¶mlist[6]); + XPAError(xpa, ¶mlist[6]); + return(-1); + } + else if( !strcmp(paramlist, "exit") ){ + if( !quiet ) + fprintf(stdout, "Exiting\n"); + exit(0); + } + else if( !strcmp(paramlist, "wait") ){ + fprintf(stdout, "Press to continue ..."); + fgets(tbuf, SZ_LINE, stdin); + } + else if( !strncmp(paramlist, "xpaset", 6) ){ + ip = 0; + word(paramlist, tbuf, &ip); + if( word(paramlist, tbuf, &ip) ){ + if( !quiet ) + fprintf(stdout, "calling XPASet(%s, \"%s\")\n", + tbuf, &(paramlist[ip])); + got = XPASet(NULL, tbuf, &(paramlist[ip]), mode, + paramlist, strlen(paramlist), NULL, errs, 1); + if( got == 0 ){ + if( !quiet ) + fprintf(stdout, "no XPA access points matched template %s\n", + tbuf); + } + else if( errs[0] != NULL ){ + if( !quiet ) + fprintf(stdout, "Error on xpaset to %s: %s\n", tbuf, errs[0]); + xfree(errs[0]); + if( exitonerror ) + exit(1); + } + else{ + if( !quiet ) + fprintf(stdout, "XPASet to %s successful\n", tbuf); + } + } + return(0); + } + } + else if( dowait ){ + fprintf(stdout, "Press to continue ..."); + fgets(tbuf, SZ_LINE, stdin); + } + + /* reset save buffer */ + if( save_buf != NULL ){ + xfree(save_buf); + save_buf = NULL; + } + save_bytes = 0; + + xwait = dowait; + if( !(xpa->receive_mode & XPA_MODE_FILLBUF) ){ + while( (got=recv(xpa_datafd(xpa), tbuf, SZ_LINE, 0)) >0 ){ + if( xwait >0 ){ + fprintf(stdout, "got %d bytes ... press to continue ...", got); + fgets(tbuf, SZ_LINE, stdin); + xwait--; + } + i = save_bytes; + save_bytes += got; + if( save_buf == NULL ) + save_buf = (char *)xmalloc(save_bytes); + else + save_buf = (char *)xrealloc(save_buf, save_bytes); + memcpy(&save_buf[i], tbuf, got); + } + if( !quiet ) + fprintf(stdout, "callback read %d bytes\n", save_bytes); + } + else{ + save_bytes = len; + save_buf = (char *)xmalloc(len); + memcpy(save_buf, buf, len); + } + fflush(stdout); + fflush(stderr); + return(0); +} + +#ifdef ANSI_FUNC +int +info_cb (void *client_data, void *call_data, char *paramlist) +#else +int info_cb(client_data, call_data, paramlist) + void *client_data; + void *call_data; + char *paramlist; +#endif +{ + XPA xpa = (XPA)call_data; + char *s = (char *)client_data; + char xtemplate[SZ_LINE]; + char *names[MAX_FPS]; + char *bufs[MAX_FPS]; + char *errs[MAX_FPS]; + size_t lens[MAX_FPS]; + int i; + int ip; + int got; + + if( !quiet ){ + fprintf(stdout, "INFO_CB #%d: %s:%s (%s)\n", + n++, xpa_class(xpa), xpa_name(xpa), s); + } + + if( paramlist && *paramlist ){ + if( !quiet ) + fprintf(stdout, "\tparamlist: %s\n", paramlist); + ip = 0; + word(paramlist, xtemplate, &ip); + if( !strcmp(xtemplate, "xpaget") ){ + word(paramlist, xtemplate, &ip); + got = XPAGet(xpa, xtemplate, &(paramlist[ip]), NULL, + bufs, lens, names, errs, MAX_FPS); + if( !quiet ) + fprintf(stdout, "XPAGet (%s) returned %d buffer(s)\n", xtemplate, got); + for(i=0; i 0 ){ + fprintf(stdout, "contents (%lu bytes):\n", (unsigned long)lens[i]); + write(fileno(stdout), bufs[i], lens[i]); + } + if( !quiet ) + fprintf(stdout, "\n"); + } + else{ + write(fileno(stdout), errs[i], strlen(errs[i])); + if( exitonerror ) + exit(1); + } + if( bufs[i] ) + xfree(bufs[i]); + if( names[i] ) + xfree(names[i]); + if( errs[i] ) + xfree(errs[i]); + } + } + } + fflush(stdout); + fflush(stderr); + return(0); +} + +#ifdef ANSI_FUNC +int +main (int argc, char **argv) +#else +int +main(argc, argv) + int argc; + char **argv; +#endif +{ + char *plist=NULL; + char *paramlist=NULL; + char *xtemplate="*:*"; + char *smode=NULL; + char tbuf[SZ_LINE]; + char name[SZ_LINE]; + char cmd[SZ_LINE]; + char fxpa[SZ_LINE]; + char *names[MAX_FPS]; + char *bufs[MAX_FPS]; + char *dbufs[MAX_FPS]; + char *errs[MAX_FPS]; + char *buf=NULL; + int c; + size_t lens[MAX_FPS]; + size_t dlens[MAX_FPS]; + int i; + int got; + int maxbufs; + int j=0; + int loop=1; + int delay=0; + int get=1; + int set=0; + int info=0; + int access=0; + int pipe=0; + int tiny=0; + int doxpa = 0; + int xpaopen=0; + int wait=0; + XPA xpa=NULL; + XPA xpa1=NULL; + int fds[1]; + +#if HAVE_MINGW32==0 + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); +#endif + + *cmd = '\0'; + /* process switch arguments */ + while ((c = getopt(argc, argv, "abd:ef:gil:m:nopqstwx:")) != -1){ + switch(c){ + case 'a': + get = 0; + set = 0; + info = 0; + access = 1; + break; + case 'b': + get = 1; + set = 1; + info = 0; + access = 0; + break; + case 'd': + delay = atoi(optarg); + break; + case 'e': + exitonerror++; + break; + case 'f': + snprintf(cmd, SZ_LINE, "stest %s &\n", optarg); + snprintf(fxpa, SZ_LINE, "%s1", optarg); + break; + case 'g': + get = 1; + set = 0; + info = 0; + access = 0; + break; + case 'i': + get = 0; + set = 0; + info = 1; + access = 0; + break; + case 'l': + loop = atoi(optarg); + break; + case 'm': + smode = xstrdup(optarg); + break; + case 'n': + don = 1; + break; + case 'o': + xpaopen = 1; + break; + case 'p': + pipe = 1; + fds[0] = fileno(stdout); + break; + case 'q': + quiet = 1; + break; + case 's': + get = 0; + set = 1; + info = 0; + access = 0; + break; + case 't': + tiny = 1; + break; + case 'w': + wait = 1; + break; + case 'x': + doxpa = 1; + strcpy(name, optarg); + break; + } + } + if( optind < argc ){ + xtemplate = argv[optind]; + optind++; + } + + /* make up the paramlist */ + plist = XPAArgvParamlist(argc, argv, optind); + if( !don ) + paramlist = plist; + else + paramlist = (char *)xcalloc(strlen(plist)+SZ_LINE, sizeof(char)); + + /* for setting, make up a number of dbufs that we will send */ + if( set ){ + /* must be less than MAX_FPS */ + maxbufs = 2; + + dbufs[0] = (char *)xmalloc(SZ_LINE); + strcpy(dbufs[0], "this is a short string"); + dlens[0] = strlen(dbufs[0]); + + if( tiny ) + dlens[1] = 256+1; + else + dlens[1] = 256*1000+1; + dbufs[1] = (char *)xmalloc(dlens[1]); + for(j=0, buf=dbufs[1]; j 1 ){ + if( !quiet ){ + fprintf(stdout, "CLIENT #%d: %s\n", j, xtemplate); + if( paramlist && *paramlist ) + fprintf(stdout, "\tparamlist: %s\n", paramlist); + } + } + /* make up paramlist, if necessary */ + if( don ) + snprintf(paramlist, SZ_LINE, "%s %d", plist, j); + /* XPAGet, XPAGetFd */ + if( get ){ + if( pipe ){ + got = XPAGetFd(xpa, xtemplate, paramlist, smode, + fds, names, errs, -MAX_FPS); + } + else{ + got = XPAGet(xpa, xtemplate, paramlist, smode, + bufs, lens, names, errs, MAX_FPS); + for(i=0; i 0 ){ + write(fileno(stdout), bufs[i], lens[i]); + } + if( strcmp(paramlist, "buf") ) + fprintf(stdout, "\n"); + } + else{ + write(fileno(stdout), errs[i], strlen(errs[i])); + if( exitonerror ) + exit(1); + } + } + if( bufs[i] ) + xfree(bufs[i]); + if( names[i] ) + xfree(names[i]); + if( errs[i] ) + xfree(errs[i]); + } + } + } + + /* XPASet, XPASetFd */ + if( set ){ + if( pipe ){ + if( !quiet ) + fprintf(stdout, "\tsending data from stdin\n"); + got =XPASetFd(xpa, xtemplate, paramlist, smode, + fileno(stdin), names, errs, MAX_FPS); + } + else{ + got = XPASet(xpa, xtemplate, paramlist, smode, + dbufs[j%maxbufs], dlens[j%maxbufs], + names, errs, MAX_FPS); + } + for(i=0; i to continue ..."); + fgets(tbuf, SZ_LINE, stdin); + } + + /* delay */ + if( delay ) + XPASleep(delay); + } + + /* XPAOpen/XPAClose */ + if( xpaopen ){ + XPAClose(xpa); + } + + /* free up space */ + if( set ){ + for(j=0; j +#include +#include +#include /* gethostbyname() */ + +#define SZ_LINE 1024 + +int main(int argc, char **argv) +{ + int i; + char host[SZ_LINE]; + struct hostent *hostent; + + if( argc > 1 ) + strcpy(host, argv[1]); + else{ + fprintf(stderr, "calling gethostname() ...\n"); + if( gethostname(host, SZ_LINE) == -1 ){ + perror("gethostname"); + exit(1); + } + else{ + fprintf(stderr, "host name is %s\n", host); + } + } + fprintf(stderr, "calling gethostbyname(host) ...\n"); + if( !(hostent = gethostbyname(host)) ){ + perror("gethostbyname"); + exit(1); + } + else{ + fprintf(stderr, "gethostbyname() succeeded\n"); + } + fprintf(stderr, "printing ip address(es) for this host ...\n"); + if( hostent ){ + for(i=0; hostent->h_addr_list[i]; i++){ + fprintf(stderr, "%x\n", *(int *)hostent->h_addr_list[i]); + } + } + else{ + fprintf(stderr, "ERROR: can't look up: %s\n", host); + } + return(0); +} diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..eda8931 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,51 @@ +# +# Makefile for misc programs, not good enough for their own directory +# + +RM = rm +RMFLAGS = -f +MV = mv +MVFLAGS = -f +CP = cp +CPFLAGS = -p + +MANDIR = ../man + +all: dirs files hardcopy + +dirs: + @(if [ ! -d ${MANDIR} ]; then \ + mkdir ${MANDIR}; \ + mkdir ${MANDIR}/man1 ${MANDIR}/man3 ${MANDIR}/mann; \ + fi) + +files: + @(for i in *.html; do \ + echo processing $$i; \ + ./html2man ../man < $$i; \ + done) + +hardcopy: + html2ps -C fb -d -g -n -u -W b -x 1 -o xpa.ps help.html + ps2pdf xpa.ps xpa.pdf + + +# NB: sman.conf must be copied to $HOME or else its not found ... +# we also have to figure out where swish-e is located and hardwire it +index: szlong + @(cd ..; MANPATH=`pwd`/man; export MANPATH; cd doc; \ + SW=`which swish-e`; \ + SZ_LONG=`./szlong`; \ + sed -e 's#@SW@#'$$SW'#g' < sman_conf.tmpl > $${HOME}/sman.conf; \ + sman-update --clearcache; \ + sman-update --verbose --index=./sman/xpa$${SZ_LONG}.index; \ + rm -f $${HOME}/sman.conf szlong) + +szlong: szlong.c + $(CC) $(CFLAGS) -o szlong szlong.c + +clean: + -$(RM) $(RMFLAGS) *.BAK *.bak *.o core errs ,* *~ *.a \ + foo* goo* tags TAGS html2ps.dbg + + diff --git a/doc/acl.html b/doc/acl.html new file mode 100644 index 0000000..b1f458d --- /dev/null +++ b/doc/acl.html @@ -0,0 +1,137 @@ + + + +XPA Access Control + + + + +

XPAAcl: Access Control for XPA Messaging

+ + +

Summary

+

+XPA supports host-based access control for each XPA access point. You +can enable/disable access control using the XPA_ACL environment +variable. You can specify access to specific XPA access points for +specific machines using the XPA_DEFACL and XPA_ACLFILE environment +variables. By default, an XPA access point is accessible only to +processes running on the same machine (same as X Windows). + + +

Description

+

+When INET sockets are in use (the default, as specified by the +XPA_METHOD environment variable), XPA supports a host-based +access control mechanism for individual access points. This mean that +access can be specified for get, set, or info operations for each +access point on a machine by machine basis. For LOCAL sockets, access +is restricted (by definition) to the host machine. + +

+XPA access control is enabled by default, but can be turned off by +setting the XPA_ACL environment variable to false. +In this case, any process can access any XPA server. + +

+Assuming that access control is turned on, the ACL for an individual +XPA access point is set up when that access point is registered +(although it can be changed later on; see below). This can be done in +one of two ways: + +Firstly, the XPA_ACLFILE environment variable can defined to +point to a file of access controls for individual access points. The format +of this file is: +

+ class:name ip acl
+
+The first argument is a template that specifies the class:name of the +access point covered by this ACL. See +XPA Access Points and Templates +for more information about xpa templates. + +

+The second argument is the IP address (in human-readable format) of +the machine which is being given access. This argument can be +* to match all IP addresses. It also can be $host +to match the IP address of the current host. + +

+The third argument is a string combination of s, g, +or i to allow xpaset, xpaget, or +xpainfo access respectively. The ACL argument can be ++ to give sgi access or it can be - to turn +off all access. + +

+For example, +

+  *:xpa1  somehost sg
+  *:xpa1  myhost +
+  * * g
+
+will allow processes on the machine somehost to make xpaget and xpaset calls, +allow processes on myhost to make any call, and allow all other hosts to +make xpaget (but not xpaset) calls. + +Secondly, if the XPA_ACLFILE does not exist, then a single +default value for all access points can be specified using the +XPA_DEFACL environment variable. The default value for this +variable is: +
+  #define XPA_DEFACL "*:* $host +"
+
+meaning that all access points are fully accessible to all processes +on the current host. Thus, in the absence of any ACL environment variables, +processes on the current host have full access to all access points +created on that host. This parallels the X11 xhost mechanism. + +

+Access to an individual XPA access point can be changed using the -acl +parameter for that access point. For example: +

+  xpaset -p xpa1 -acl "somehost -"
+
+will turn off all access control for somehost to the xpa1 access point, while: +
+  xpaset -p XPA:xpa1 -acl "beberly gs"
+
+will give beberly xpaget and xpaset access to the access point whose +class is XPA and whose name is xpa1. +

+Similarly, the current ACL for a given access point can be retrieved using: +

+  xpaget xpa1 -acl
+
+Of course, you must have xpaget access to this XPA access point to +retrieve its ACL. + +

+Note that the XPA access points registered in the xpans +program also behave according to the ACL rules. That is, you cannot +use xpaget to view the access points registered with xpans unless +you have the proper ACL. + +

+Note also when a client request is made to an XPA server, the access +control is checked when the initial connection is established. This +access in effect at this time remains in effect so long as the client +connection is maintained, regardless of whether the access fro that +XPA is changed later on. + +

+We recognize that host-based access control is only relatively secure +and will consider more stringent security (e.g., private key) in the +future if the community requires such support. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + + diff --git a/doc/changelog.html b/doc/changelog.html new file mode 100644 index 0000000..20a1c19 --- /dev/null +++ b/doc/changelog.html @@ -0,0 +1,801 @@ + + +XPA ChangeLog + + +

XPA ChangeLog

+ +

+This ChangeLog covers the XPA 2 implementation. It will be updated +as we continue to develop and improve XPA. The up-to-date version can be +found here. + +

Public Release 2.1.15 (July 23, 2013)

+
    +

    +

  • Added support for large data transfers +

    +

  • XPAGet and XPASet now pass size_t instead of int for lengths +

    +

  • Send and receive callbacks now pass size_t instead of int for lengths +

    +

  • Port to mingw (Windows) +
+ + +

Public Release 2.1.14 (June 7, 2012)

+
    +

    +

  • Fixed several memory leaks in the Tcl wrappers (tcl.c). +

    +

  • Use Tcl stubs library for linking shared Tcl, if available. +
+ +

Public Release 2.1.13 (April 14, 2011)

+
    +

    +

  • An atexit handler is no longer installed automatically (it crashes +Tcl 8.5.8 applications). Call XPAAtExit(void) to install the handler. +

    +

  • Removed permission checking from Find() on cygwin systems. This was broken +by Windows 7. +

    +

  • Removed addition of -no-cpp-precomp flag from gcc 4.2 and beyond (Mac). +
+ +

Public Release 2.1.12 (January 26, 2010)

+
    +

    +

  • Added XPA_HOST environment variable to allow users to specify +the hostname (and hence, ip) component of the INET method id. This is +useful, for example, if you want to register an access point using a +VPN-generated IP instead of the canonical IP. +

    +

  • Fix typo in Tcl binding to xpainfo causing a crash after 2 invocations. +
+ +

Public Release 2.1.11 (December 7, 2009)

+
    +

    +

  • Generalized XPANSKeepAlive() to send messages to xpans, proxy xpans, or +both. The default is to send just to proxies (e.g. chandra-ed). +

    +

  • Changed XPANSKeepAlive() to send an in-band new-line char to +xpans, changed xpans to handle an in-band new-line as a keep-alive +message. Necessitated by Cisco routers that clear the URG flag in +a TCP packet, breaking OOB data transfer for the whole Internet, as +well as the OOB-based keep-alive implemented in xpans. +

    +

  • In xpans, print warning when the keep-alive option switch is used. +

    +

  • Port to mingw (thanks to B.Schoenhammer) +

    +

  • Change OOB character sent by xpans keepalive to a space, trying to working around cisco routers that force OOB data into the inbound stream. +

    +

  • fix gcc fprintf warning in xpans.c +
+ +

Public Release 2.1.10 (September 1, 2009)

+
    +

    +

  • Update mklib and configure.ac to support 64-bit builds on Macs. +

    +

  • Fixed bug in XPAAccess() in which the returned names could have an extra +(bogus) character when the target is an explicit ip:port or local socket file. +

    +

  • Add setjmp/longjmp support to xalloc. +

    +

  • Add XPASaveJmp(void *env) as a high-level interface to xalloc_savejmp(); +
+ +

Internal Release 2.1.9

+
    +

    +

  • Fixed a bug that prevented an access point starting with a number +from being recognized peoperly. NB: a pure number still signifies a +port on the current machine. Also num:num signifies ip:port, where ip +can be a pure hex value or the canonical form vvv.xxx.yyy.zzz. +

    +

  • Modified internal Launch() routine to use posix_spawn(), if necessary. +This is required for OS X 10.5 (leopard), which frowns upon use of fork() +and exec(). Also modified zprocess routines to use Launch(). +

    +

  • Added XPASetFree(xpa, void (*myfree)(void *)) routine to allow callbacks +to specify a free routine other than malloc free (e.g. Perl garbage collection). +

    +

  • XPACmdAdd() now checks to ensure that it was passed an XPA struct created +by XPACmdNew(). +

    +

  • Change launch.h to xlaunch.h to avoid conflict with OS X. +
+ +

Public Release 2.1.8 (1 November 2007)

+
    +

    +

  • A public release to complete current XPA development work. +
+ +

Patch Release 2.1.7b[1,2] (Feb 22, 2006; March 8, 2007)

+
    + +

    +

  • Added a convenience null to the end of the buffers returned by XPAGet. + +

    +

  • Added code to avoid calling atexit routine if a fork'ed child +calls exit() instead of _exit(). + +

    +

  • Added XPA_CLIENT_DOXPA environment variable to turn off client +processing of xpa server requests. + +

    +

  • Added --version to xpaset, xpaget, xpainfo, xpaaccess, xpans to +display XPA version and exit. + +

    +

  • Added support for integrating XPA into a Gtk loop. + +

    +

  • xpaaccess now returns its answer in the error code as well as to stdout +(without the -n switch, it returns 1 for a match, with the -n switch, +the number of matches is returned). + +

    +

  • Fixed bug which prevented xpans from being started up automatically +by an xpa server if its pathname contained a space character. + +

    +

  • Fixed bug in MINGW port of xpans in which an XPA server that +terminated via an interrupt was not being properly removed from the +list of registered access points. + +

    +

  • Added XPA_LOGNAME to override LOGNAME when registering username + +

    +

  • Upgraded swish-e indexing code to 2.4.5. + +
+ +

Patch Release 2.1.6 (4 May 2005)

+
    + +

    +

  • Added -P switch to xpans to enable experimental proxy support +(default is disabled). An argument of 1 processes proxy requests in +the same thread as xpans requests, while an argument of 2 processes +proxy requests in a separate thread. (The latter is recommended to +avoid xpans timeouts, since xpa callback processing can take a long +time.) + +

    +

  • Added ability to build shared libraries (done automatically with +configure --enable-shared) with compilers other than gcc. + +

    +

  • Made yet another attempt to build shared libraries under OS X. + +

    +

  • Fixed a server bug in Tcl support under Windows (introduced early +in 2.1.6) which caused an occasional SEGV. + +

    +

  • Fixed race condition in cases where 2 or more servers makes client calls +to one another. + +

    +

  • Fixed bug in the XPA handler routine in which an access point was +turned off if an error occurred in that routine (as opposed to the +user-defined callback routine). + +

    +

  • Fixed race condition when "ack=false" flag (or -n) is used with XPASet() +(or xpaset). + +

    +

  • Added defensive code to XPA handler to ensure that the passed XPA record +is valid. + +

    +

  • Tcl/XPA servers such as ds9 were not turning off select() on the +xpa channels inside an xpa callback, as required. This is now fixed. + +

    +

  • Added timestamps to most server and client error messages if the +XPA_TIMESTAMP_ERRORS variable is set. This is useful when XPA errors are +being logged in an error log (e.g. Web/CGI use). + +

    +

  • Generated PostScript and PDF versions of the help pages. + +

    +

  • Moved OPTIONS section before (often-lengthy) DESCRIPTION section in +man pages. + +

    +

  • All memory allocation now performs error checking on the result. + +

    +

  • Removed some compiler warnings that surfaced when using gcc -O2. + +

    +

  • Updated configure.ac to better support Tcl in Panther with Apple +Frameworks. + +
+ +

Patch Release 2.1.5 (12 January 2004)

+
    + +

    +

  • Fixed bug in XPAPoll(). Erroneously, no requests were being +processed when maxreq==0. Now, all pending events are processed, as +per the documentation. + +

    +

  • Added ack=false to XPAInfo() (and corresponding -n to xpainfo) +so that client does not wait for a response from the server. This is +essential in cases where XPA servers wish to send info messages to +one another without causing a race condition. + +

    +

  • Generated man pages from the html pages. These are installed +automatically at build time. + +

    +

  • The xpans program with Unix sockets now uses a lock file to signal +that it is running, in order to avoid a potential (but rare) race +condition at startup. + +

    +

  • Code that calls Unix-type bind() now manipulate umask() to ensure that +all users have write permissions to the socket file (OS X apparently uses +these permissions while previous platforms ignore them). + +

    +

  • Configure now checks for socklen_t type (OS X does not define it). + +

    +

  • Added an atexit function to run XPAFree. The aim here is to delete Unix +socket files on exiting. + +

    +

  • Under Windows, the Tcl event-handling code now blocks for 1/1000 of a +second instead of not blocking at all (which inadvertently used 100% of cpu). + +

    +

  • Upgraded Tcl/Tk support to 8.4. + +

    +

  • Made another round of checks was made through all instances of +strcat, strcpy, etc. to look for potential buffer overflows. Changed +all instances of sprintf() to snprintf(). + +

    +

  • Class and name designators are now limited to 1024 characters, for +no particular reason. + +

    +

  • The obsolete $SAORD_BIN variable was being added to the path when +searching for xpans. This is no longer the case. + +

    +

  • Fixed non-ANSI compiler errors in both xpa.c and xpans.c. + +

    +

  • Fixed minor problems to support compilation with g++. + +

    +

  • Ported to Intel icc and gcc 3.3 compilers. + +

    +

  • Upgraded autoconf to 2.57. Included in this upgrade is a change that +makes gcc the default compiler (use "configure CC=cc" to change this). +Also, by default, the Tcl shared object is no longer automatically built +if the Tcl libraries are used. Use the --enable-tclshlib switch in +configure to enable this feature. + +

    +

  • Changed license from public domain to GNU GPL. + +
+ +

Patch Release 2.1.4 (24 March 2003)

+
    + +

    +

  • Made inet method unique, even when hosts are behind a firewall using +the same ports (on different local machines). + +

    +

  • The initial connection from an xpa server to a local xpans now is +controlled by a timeout (default 5 sec, controlled by XPA_CONNECT_TIMEOUT +variable). This should prevent a hang on connect() if the network +is not set up correctly. + +

    +

  • Fixed rare race condition when an XPA server callback performed its own +XPAGet or XPASet call to another XPA server. + +

    +

  • Use POSIX O_NONBLOCK for non-blocking I/O in fcntl call if it +exists, instead of O_NDELAY. + +
+ +

Patch Release 2.1.3 (26 September 2002)

+
    + +

    +

  • Added -k [sec] switch to xpans to support sending one-byte keepalive +messages from xpans to registered xpa servers. + +

    +

  • Added XPANSKeepAlive routine (and Tcl equivalent) to allow +xpa servers to send a one-byte keepalive message to xpans. + +
+ +

Patch Release 2.1.2 (18 July 2002)

+
    + +

    +

  • The "-help" reserved command now also displays the XPA version, if +no explicit sub-commands are specified. + +

    +

  • Change internal state of xpans proxy to save ip:port value of a +server behind a NAT firewall. This is required to give some hope of +distinguishing multiple instances of ds9 running behind NAT. + +
+ +

Patch Release 2.1.1 (20 June 2002)

+
    + +

    +

  • Added a version check between xpans and an access point, +performed when it gets registered by an XPA server. If the server +has a version greater than the xpans version, a warning is issued by +both programs. + +

    +

  • Added a boolean XPA_NSREGISTER environment variable to allow an +XPA server to skip xpans registration. The default is to register with +the name server. If set to "false", the access point still is set up +but it is not registered with an xpans. It can be registered later on +(using -remote or -proxy, for example). + +

    +

  • Fixed bug in which xpans was still listening on any interface when +XPA_METHOD was localhost (instead of just listening on localhost). + +
+ +

Public Release 2.1.0 (22 April 2002)

+ +

+New features include: + +

    +

    +

  • Support for proxy access to XPA servers (e.g. ds9) situated +behind a firewall (useful for NVO-type applications). + +

    +

  • Improved support for allowing remote machines access rights to the +XPA access points (useful for NVO-type applications). + +

    +

  • Ability for XPAAccess() routine and xpaaccess program to contact XPA + directly. + +

    +

  • Support for a clipboard access point that allows clients to store ASCII +state information in an XPA-enabled server. + +

    +

  • Improved support for Windows platform, as well as new support for Mac OSX. +
+ +

Pre-Release 2.1.0e (2 April 2002)

+
    + +

    +

  • Removed the environment variable generated by each XPA access +point (of the form XPA_name=method). The putenv() call was causing ds9 +to crash under both Linux and LinuxPPC during a socket operation. We +suspect a bug in putenv but cannot prove it and this feature is not +essential, so ... + +
+ +

Pre-Release 2.1.0e (1 April 2002)

+
    + +

    +

  • Fixed an uninitialized variable in xpamb which prevented it from +working at all on some systems. + +

    +

  • Changed xpamb switch from "-add" to "-data" (to store named data). + +

    +

  • Changed how xpamb works with xpaget so that xpamb can return data +from XPA access points as well as from stored data. (Previous versions +only returned stored data.) Now, you can retrieve stored data +explicitly using the -info and/or -data switches. For example: +
    +  xpaget xpamb -info foo
    +
    +will return info about the previously stored data named foo. If +neither switch is present, then the name is assumed to be an XPA access +point. +
+ +

Pre-Release 2.1.0e (25 March 2002)

+
    + +

    +

  • Changed symbol for default port from "*" to "$port" to avoid +a syntactical conflict between class:* and machine:* when processing an +XPA access point class:name specification. Thus, the default inet +method now is '$host:$port' instead of '$host:*'. + +
+ +

Pre-Release 2.1.0e (19 March 2002)

+
    + +

    +

  • Removed timeout check when reading data (in clients using xpaget +and servers filling the data buffer). We have more and more cases +where we need to wait a long time to retrieve data (e.g., slow +networks or receiving data being compressed on the fly). + +

    +

  • Moved call to sigaction(SIGCHLD,...) out of XPAOpen(), so that it +is only executed when needed by XPAGet()/XPASet() routines called from +within xpans/proxy. But then changed logic to use a double fork() instead +of sigaction() to prevent zombies (Stevens Adv. Programming p 202). + +

    +

  • Each XPA access point now generates an environment variable of the +form XPA_name=method so that children can communicate with the parent access +point more easily. + +

    +

  • Added version option to Tcl xparec: +
    +  if [catch { xparec "" version } version] {
    +    puts "pre-2.1.0e"
    +  } else {
    +    puts [split $version .]
    +  }
    +
    +to help differentiate between XPA versions within Tcl code. + +
+ +

Pre-Release 2.1.0e (14 February 2002)

+
    +

    +

  • Fixed client handling of out-of-sync messages. +
+ +

Pre-Release 2.1.0e (11 February 2002)

+
    + +

    +

  • Fixed client.c/xopen() so that it does not open an extra socket. + +

    +

  • Fixed xpainfo/xopen() to prevent client from hanging waiting for ack. + +

    +

  • Modified stest to generate xpaaccess points xpa, xpa1, c_xpa, and +i_xpa (or more generally, , 1, c_, i) to allow +more flexible testing of templates. Also added -a for testing XPAAccess(). + +
+ +

Beta Release 2.1.0b10 (31 January 2002)

+
    + +

    +

  • Added support for Mac OSX/Darwin to configure file. + +
+ +

Beta Release 2.1.0b9 (26 January 2002)

+
    + +

    +

  • Fixed bug in client library that caused XPAAccess() call to hang. + +
+ +

Beta Release 2.1.0b8 (4 January 2002)

+
    + +

    +

  • Made modifications to Makefile.in to make releases easier. + +

    +

  • Added instructions to Makefile.in so that xpa.h will always have +correct #defines for XPA_VERSION, XPA_MAJOR_VERSION, XPA_MINOR_VERSION, +and XPA_PATCH_LEVEL. + +
+ +

Beta Release 2.1.0b7 (21 December 2001)

+
    + +

    +

  • Added -proxy switch to -remote sub-command to allow remote access +through a firewall, using xpans as a proxy server. The support for proxy +processing required a change to the client/server protocol. This means +that new xpa servers will not work with old xpa clients (although new +xpa clients will work with old xpa servers). For details about proxy +firewall support, see http://hea-www.harvard.edu/RD/xpa/inet.html. + +

    +

  • Fixed Tcl support for XPA under Windows/Cygwin by re-writing +the code used to add XPA to the Tcl event loop. This fix makes ds9 +support for XPA much more stable under Windows. + +

    +

  • Added the shutdown() call to XPA under Cygwin/Windows before +closing send() sockets. It appears that a Cygwin recv() socket call +does not always sense when the other end closes the socket using +close(). This measure must be considered a hack, since the actual +problem was never resolved. + +

    +

  • Added code to protect accept() and select() calls from interrupts. + +

    +

  • Extended syntax of the environment variable XPA_NSINET to: +
    +  setenv XPA_NSINET host:port[,port[,port]]
    +
    +to allow specification of the XPA access point port for xpans, +as well as the proxy data port. + +

    +

  • Modified xpans log file so that it contains the xpaset commands +required to reconnect with xpa servers. + +

    +

  • xpans now deletes its Unix socket files. + +
+ +

Beta Release 2.1.0b6 (29 October 2001)

+
    + +

    +

  • Implemented a reserve public access point named -clipboard so +that clients can store ASCII state information on any number of named +clipboards. Clipboards of the same name created by clients on +different machines are kept separate. The syntax for creating a +clipboard is: +
    +  [data] | xpaset [server] -clipboard add|append [clipboard_name]
    +  xpaset -p [server] -clipboard delete [clipboard_name]
    +  xpaget [server] -clipboard [clipboard_name]
    +
    +Use "add" to create a new clipboard or replace the contents of an existing +one. Use "append" to append to an existing clipboard. + +
+ +

Beta Release 2.1.0b5 (22 October 2001)

+
    + +

    +

  • Use FD_SETSIZE instead of getdtablesize() to determine how many files +to check during select(); + +

    +

  • Under Cygwin, the launch() routine now uses the Cygwin spawnvp() +instead of fork()/exec() where possible (i.e., if no stdfiles are +being redirected). This is recommended by Cygwin's (skimpy) on-line +documentation and seems to fix the problems ds9 had when starting xpans +automatically. + +

    +

  • Added error check to select() call in xpans. + +
+ +

Beta Release 2.1.0b4 (24 September 2001)

+
    + +

    +

  • The launch() now can return an error code if the execv() system +call fails (something system() does not do). + +

    +

  • INET socket calls between xpa clients and servers now will use +localhost if they are on the same machine. This protects against +Linux systems where the hostname is hardwired (wrongly) in a DHCP +environment. + +
+ +

Beta Release 2.1.0b3 (6 September 2001)

+
    + +

    +

  • Modified xpans so that, in the case of a firewall, it tries to +correct the specified ip:port by matching against the ip found in +the socket packet at accept() time. + +

    +

  • Replaced system() call used to start xpans automatically with +a special launch() call, which performs execvp() directly without going +through sh. (launch() works under DOS and has fewer security problems.) + +

    +

  • Fixed bug in xpans in which its xpa port was always being set to 14286. + +
+ +

Beta Release 2.1.0b2 (17 August 2001)

+
    + +

    +

  • Added support for -remote command, which registers the access +point in the XPA name server of the specified remote server, and gives +the remote server access rights to the access point. This is used, for +example, to give data servers xpa access to ds9 so that data can be +sent to ds9 as a result of a CGI-based Web query. + +

    +

  • Reserved commands (except "-help" and "-version") now can only be +executed on the machine on which the xpa service is running (not +through -remote servers). + +

    +

  • Fixed bug in xpans in which a bad telnet command could hang the program. + +

    +

  • Added -s [security file] to xpans to allow logging of all external +connections. + +
+ +

Beta Release 2.1.0b1 (6 August 2001)

+
    +

    +

  • The xpaaccess client program and XPAAccess() client subroutine +were modified so that an access-type query can directly contact the +xpa servers matching the requested xpa template, instead of just +querying the name server for registered access points. This avoid the +race condition in which an access point is registered but is not yet +available, perhaps because the server has not yet entered its event +loop. Note that the calling sequence of the XPAAccess() routine was +changed to return all matching access points and their availability +status (instead of just returning the number of registered access +points). Because of this, we are calling this a minor release instead +of a patch. + +

    +

  • Added support for XPA_PORT and XPA_PORTFILE environment variables +to allow specification of the port to be used by the command channel +(and data channel, if an optional second port is specified) for a given +access point. + +

    +

  • Added -m switch to xpaget, xpaset, xpainfo, xpaaccess to allow +override of the XPA_METHOD environment variable. + +

    +

  • Changed the default name of the ACL file from xpa.acl to acls.xpa. + +

    +

  • Fixed bug in which it was not possible to send a "set ACL" +command to an XPA server which did not have a receive callback (i.e., +did not allow xpaset). The xpans program is one such server. It now is +possible to set the ACL on xpans. + +

    +

  • We have discovered that Tcl support for datachan and cmdchan is +broken under Windows due to an unexplained incompatibility between +Cygwin sockets and Win32 sockets. We therefore have removed datachan +and cmdchan from the Windows/Tcl support until further notice. + +

    +

  • Extended the behavior of the XPA_DEFACL environment variable so that +it can support more than one acl, using a list of semi-colon delimited +controls such as: setenv XPA_DEFACL '*:* $host +; *:foo1 otherhost +'. + +

    +

  • Fixed bug in which the class:name specifier "*:*" was erroneously +trying to access the xpans name server, instead of accessing all +access points. + +

    +

  • Support TMPDIR and TMP environment variables as well as XPA_TMPDIR. + +
+ +

Patch Release 2.0.5 (10 November 2000)

+
    +

    +

  • Added support for Tcl on Windows where there is no select()-based +event loop (i.e., where there is no Tcl_CreateFileHandler call in Tcl) +

    +

  • Minor fixes in Makefile for installing on Windows +

    +

  • Minor compiler fixes from gcc -Wall. +
+ +

Patch Release 2.0.4 (20 September 2000)

+
    +

    +

  • Removed extraneous include of varargs.h from find.c. +

    +

  • Ported to SGI C compiler, which caught lots of unused variables, etc. +

    +

  • Ported to Cygwin/Windows, which required that we change socket read() +and write() calls to recv() and send() respectively. Also had to ensure that +we only did socket I/O on sockets (no fileio). +
+ +

Patch Release 2.0.3 (15 June 2000)

+
    +

    +

  • Fixed the client XPASet() and XPASetFd() calls to handle the specified +max number of connections (they were ignoring this argument, leading to +memory overwrites). +

    +

  • Fixed Makefile.in so that CFLAGS and LDFLAGS are not hard-wired values. +

    +

  • Fixed word.h to load malloc.h and stdlib.h only if they exist. +

    +

  • Documentation fixes to programs.html (in xpaaccess) and client.html +(XPANSLookup). +

    +

  • Added explicit typecast to strlen() argument to MAX #define in +XPAClientStart (strlen() is unsigned in Linux, which can break MAX). +

    +

  • Removed bogus Imakefile from directory. +

    +

  • Changed directory name to include patch level (i.e., xpa-2.0.3). +
+ +

Patch Release 2.0.2 (9 September 1999)

+
    +

    +

  • Fixed server mode (-s) in the xpaset program by properly cleaning up +the input buffers (sending commands and data in server mode was broken). +
+ +

Patch Release 2.0.1 (6 August 1999)

+
    +

    +

  • Fixed the Tcl binding code (tcl.c) for 64-bit machines (Dec Alpha) +(erroneously used %x instead of %p when converting pointers to ASCII). +

    +

  • Got rid of a few compiler warnings on 64-bit machines (a few are +unavoidable since we must cast int to void * and back when passing around +client data). +
+ +

Public Release 2.0 (27 May 1999)

+
    +

    +

  • "a new day with no mistakes ... yet" +
+ +
+

+Index to the XPA Help Pages + +


+
Last updated: 22 April 2002
+ + diff --git a/doc/changes.html b/doc/changes.html new file mode 100644 index 0000000..8488985 --- /dev/null +++ b/doc/changes.html @@ -0,0 +1,69 @@ + + + +Changes For Users from XPA 1.0 and 2.0 + + + + +

XPA Changes: Changes For Users from XPA 1.0 and 2.0

+ + +

Summary

+

+This document describes changes that will affect users who migrate +from XPA 1.0 to XPA 2.0. + + +

Description

+

+There have been a few changes that affect users who upgrade XPA +from version 1.0 to version 2.0. These changes are detailed below. +

    +

    +

  • XPA commands no longer have a resolver routine (this is open to +negotiations, but we decided the idea was dumb). For the SAOtng +program, this means that you must explicitly specify the access +point, i.e.,: +
    +  cat foo.fits | xpaset SAOtng fits
    +
    + +

    +instead of: +

    +  cat foo.fits | xpaset SAOtng
    +
    +

    +

  • By default, xpaset, xpaget, etc. now wait for the server callback to +complete; i.e., the old -W is implied (and the switch is ignored). +This allows support for better error handling. If you want xpaset, etc. +to return before the callback is complete, use -n switch: +
    +  echo "file foo.fits" | xpaset -n SAOtng
    +
    +

    +

  • The old -w switch in xpaset and xpaget is no longer necessary (and is +ignored), since you can have more than one process communicating with +an xpa access point at one time. + +

    +

  • The new -p switch on xpaset means you need not read from stdout: +
                  
    +  xpaset -p SAOtng colormap I8
    +
    +

    +will send the paramlist to the SAOtng callback without reading from stdin. + +

+ + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/client.html b/doc/client.html new file mode 100644 index 0000000..5648d85 --- /dev/null +++ b/doc/client.html @@ -0,0 +1,898 @@ + + + +XPA Client API + + + + +

XPAClient: The XPA Client-side Programming Interface

+ + +

Summary

+A description of the XPA client-side programming interface. + + +

Introduction to XPA Client Programming

+

+Sending/receiving data to/from an XPA access point is easy: you +generally only need to call the XPAGet() or XPASet() subroutines. +

+  #include <xpa.h>
+
+  int XPAGet(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      char **bufs, size_t *lens, char **names, char **messages, int n);
+
+  int XPASet(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      char *buf, size_t len, char **names, char **messages, int n);
+
+  int XPAInfo(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      char **names, char **messages, int n);
+
+  int XPAAccess(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      char **names, char **messages, int n);
+
+  int XPAGetFd(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      int *fds, char **names, char **messages, int n);
+
+  int XPASetFd(XPA xpa,
+      char *template, char *paramlist, char *mode,
+      int fd, char **names, char **messages, int n);
+
+  XPA XPAOpen(char *mode);
+
+  void XPAClose(XPA xpa);
+
+  int XPANSLookup(XPA xpa,
+      char *template, char *type,
+      char ***classes, char ***names, char ***methods, char ***infos);
+
+ +

Introduction

+ +To use the XPA application programming interface, a software developer +generally will include the xpa.h definitions file: +
+  #include <xpa.h>
+
+in the software module that defines or accesses an XPA access point and +then will link against the libxpa.a library: +
+  gcc -o foo foo.c libxpa.a
+
+XPA has been compiled using both C and C++ compilers. +

+Client communication with XPA public access points generally is +accomplished using XPAGet() or XPASet() within a program (or xpaget +and xpaset at the command line). Both routines require specification +of the name of the access point. If a template +is used to specify the access point name (e.g., "ds9*"), then +communication will take place with all servers matching that template. + + + + +

XPAGet: retrieve data from one or more XPA servers

+ + + +
+  #include <xpa.h>
+
+  int XPAGet(XPA xpa,
+             char *template, char *paramlist, char *mode,
+             char **bufs, size_t *lens, char **names, char **messages,
+	     int n);
+
+
+ + +

+Retrieve data from one or more XPA servers whose class:name identifier +matches the specified template. + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most n matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, then the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPAGet() routine then retrieves data from at most n XPA servers, +places these data into n allocated buffers and places the buffer +pointers in the bufs array. The length of each buffer is stored in the +lens array. A string containing the class:name and ip:port is stored +in the name array. If a given server returned an error or the server +callback sends a message back to the client, then the message will be +stored in the associated element of the messages array. NB: if +specified, the name and messages arrays must be of size n or greater. + +

+The returned message string will be of the form: +

+  XPA$ERROR error-message (class:name ip:port)
+
+or +
+  XPA$MESSAGE message (class:name ip:port)
+
+

+Note that when there is an error stored in an messages entry, the +corresponding bufs and lens entry may or may not be NULL and 0 +(respectively), depending on the particularities of the server. + +

+The return value will contain the actual number of servers that were +processed. This value thus will hold the number of valid entries in +the bufs, lens, names, and messages arrays, and can be used to loop +through these arrays. In names and/or messages is NULL, no information is +passed back in that array. + +

+The bufs, names, and messages arrays should be freed upon completion (if +they are not NULL); + +

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server (after callback completes)
+  doxpa		true/false	true		client processes xpa requests
+
+

+The ack keyword is not very useful, since the server completes the callback +in order to return the data anyway. It is here for completion (and perhaps +for future usefulness). + +

+Normally, an XPA client will process incoming XPA server requests +while awaiting the completion of the client request. Setting this +variable to "false" will prevent XPA server requests from being +processed by the client. + +

+Example: +

+  #include <xpa.h>
+
+  #define NXPA 10
+  int  i, got;
+  size_t  lens[NXPA];
+  char *bufs[NXPA];
+  char *names[NXPA];
+  char *messages[NXPA];
+  got = XPAGet(NULL, "ds9", "file", NULL, bufs, lens, names, messages,
+  NXPA);
+  for(i=0; i<got; i++){
+    if( messages[i] == NULL ){
+      /* process buf contents */
+      ProcessImage(bufs[i], ...);
+      free(bufs[i]);
+    }
+    else{
+      /* error processing */
+      fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]);
+    }
+    if( names[i] )
+      free(names[i]);
+    if( messages[i] )
+      free(messages[i]);
+  }
+
+ + + + +

XPASet: send data to one or more XPA servers

+ + + +
+  #include <xpa.h>
+
+  int XPASet(XPA xpa,
+             char *template, char *paramlist, char *mode,
+             char *buf, size_t len, char **names, char **messages,
+             int n);
+
+
+ + +

+Send data to one or more XPA servers whose class:name identifier +matches the specified template. + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most n matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPASet() routine transfers data from buf to the XPA servers. +The length of buf (in bytes) should be placed in the len variable. + +

+A string containing the class:name and ip:port of each of these server +is returned in the name array. If a given server returned an error or +the server callback sends a message back to the client, then the +message will be stored in the associated element of the messages +array. NB: if specified, the name and messages arrays must be of size +n or greater. + +

+The returned message string will be of the form: + +

+  XPA$ERROR   [error] (class:name ip:port)
+
+or +
+  XPA$MESSAGE [message] (class:name ip:port)
+
+

+The return value will contain the actual number of servers that were +processed. This value thus will hold the number of valid entries in +the names and messages arrays, and can be used to loop through these +arrays. In names and/or messages is NULL, no information is passed back +in that particular array. + +

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server (after callback completes)
+  verify	true/false	false		send buf from XPASet[Fd] to stdout
+  doxpa		true/false	true		client processes xpa requests
+
+

+The ack keyword is useful in cases where one does not want to wait for +the server to complete, e.g. if a lot of processing needs to be done +by the server on the passed data or when the success of the server +operation is not relevant to the client. + +

+Normally, an XPA client will process incoming XPA server requests +while awaiting the completion of the client request. Setting this +variable to "false" will prevent XPA server requests from being +processed by the client. + +

+Example: +

+  #include <xpa.h>
+
+  #define NXPA 10
+  int  i, got;
+  size_t  len;
+  char *buf;
+  char *names[NXPA];
+  char *messages[NXPA];
+  ...
+  [fill buf with data and set len to the length, in bytes, of the data]
+  ...
+  /* send data to all access points */
+  got = XPASet(NULL, "ds9", "fits", NULL, buf, len, names, messages, NXPA);
+  /* error processing */
+  for(i=0; i<got; i++){
+    if( messages[i] ){
+      fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]);
+    }
+    if( names[i] )    free(names[i]);
+    if( messages[i] ) free(messages[i]);
+  }
+
+ + + + +

XPAInfo: send short message to one or more XPA servers

+ + + +
+  #include <xpa.h>
+
+  int XPAInfo(XPA xpa,
+              char *template, char *paramlist, char *mode,
+	      char **names, char **messages, int n);
+
+
+ + +

+Send a short paramlist message to one or more XPA servers whose +class:name identifier matches the specified +template. + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most n matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, then the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPAInfo() routine does not send data from a buf to the XPA +servers. Only the paramlist is sent. The semantics of the paramlist +is not formalized, but at a minimum is should tell the server how to +get more information. For example, it might contain the class:name +of the XPA access point from which the server (acting as a client) +can obtain more info using XPAGet. + +

+A string containing the class:name and ip:port of each server is +returned in the name array. If a given server returned an error or +the server callback sends a message back to the client, then the +message will be stored in the associated element of the messages +array. The returned message string will be of the form: +

+  XPA$ERROR   error-message (class:name ip:port)
+
+or +
+  XPA$MESSAGE message 	  (class:name ip:port)
+
+

+The return value will contain the actual number of servers that were +processed. This value thus will hold the number of valid entries in +the names and messages arrays, and can be used to loop through these +arrays. In names and/or messages is NULL, no information is passed back +in that array. + +

+The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server
+
+

+When ack is false, XPAInfo() will not wait for an error return from the XPA +server. This means, in effect, that XPAInfo will send its paramlist string +to the XPA server and then exit: no information will be sent from the server +to the client. This UDP-like behavior is essential to avoid race +conditions in cases where XPA servers are sending info messages to +other servers. If two servers try to send each other an info message +at the same time and then wait for an ack, a race condition will result and +one or both will time out. + +

+Example: +

+  (void)XPAInfo(NULL, "IMAGE", "ds9 image", NULL, NULL, NULL, 0);
+
+ + + + +

XPAGetFd: retrieve data from one or more XPA servers and write to files

+ + + +
+  #include <xpa.h>
+
+  int XPAGetFd(XPA xpa,
+               char *template, char *paramlist, char *mode,
+	       int *fds, char **names, char **messages, int n);
+
+
+ + +

+Retrieve data from one or more XPA servers whose class:name identifier +matches the specified +template +and write it to files associated with +one or more standard I/O fds (i.e, handles returned by open()). + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most ABS(n) matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, then the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPAGetFd() routine then retrieves data from the XPA servers, +and write these data to the fds associated with one or more fds +(i.e., results from open). Is n is positive, then there will be n fds +and the data from each server will be sent to a separate fd. If n is +negative, then there is only 1 fd and all data is sent to this single +fd. (The latter is how xpaget is implemented.) + +

+A string containing the class:name and ip:port is stored in the name +array. If a given server returned an error or the server callback +sends a message back to the client, then the message will be stored in +the associated element of the messages array. NB: if specified, the +name and messages arrays must be of size n or greater. + +

+The returned message string will be of the form: +

+  XPA$ERROR   error-message (class:name ip:port)
+
+or +
+  XPA$MESSAGE message 	  (class:name ip:port)
+
+

+Note that when there is an error stored in an messages entry, the +corresponding bufs and lens entry may or may not be NULL and 0 +(respectively), depending on the particularities of the server. + +

+The return value will contain the actual number of servers that were +processed. This value thus will hold the number of valid entries in +the bufs, lens, names, and messages arrays, and can be used to loop +through these arrays. In names and/or messages is NULL, no information is +passed back in that array. + +

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server (after callback completes)
+
+

+The ack keyword is not very useful, since the server completes the callback +in order to return the data anyway. It is here for completion (and perhaps +for future usefulness). + +

+Example: +

+  #include <xpa.h>
+  #define NXPA 10
+  int  i, got;
+  int fds[NXPA];
+  char *names[NXPA];
+  char *messages[NXPA];
+  for(i=0; i<NXPA; i++)
+    fds[i] = open(...);
+  got = XPAGetFd(NULL, "ds9", "file", NULL, fds, names, messages, NXPA);
+  for(i=0; i<got; i++){
+    if( messages[i] != NULL ){
+      /* error processing */
+      fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]);
+    }
+    if( names[i] )
+      free(names[i]);
+    if( messages[i] )
+      free(messages[i]);
+  }
+
+ + + + +

XPASetFd: send data from stdin to one or more XPA servers

+ + + +
+  #include <xpa.h>
+
+  int XPASetFd(XPA xpa,
+               char *template, char *paramlist, char *mode,
+	       int fd, char **names, char **messages, int n)
+
+ + + +

+Read data from a standard I/O fd and send it to one or more XPA +servers whose class:name identifier matches the specified +template. + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most n matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, then the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPASetFd() routine then reads bytes from the specified fd +until EOF and sends these bytes to the XPA servers. +The final parameter n specifies the maximum number of servers to contact. +A string containing the class:name and ip:port of each server is returned in +the name array. If a given server returned an error, then the error +message will be stored in the associated element of the messages array. +NB: if specified, the name and messages arrays must be of size n or greater. + +

+The return value will contain the actual number of servers that were +processed. This value thus will hold the number of valid entries in +the names and messages arrays, and can be used to loop through these +arrays. In names and/or messages is NULL, no information is passed back +in that array. + +

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server (after callback completes)
+  verify	true/false	false		send buf from XPASet[Fd] to stdout
+
+

+The ack keyword is useful in cases where one does not want to wait for +the server to complete, e.g. is a lot of processing needs to be done +on the passed data or when the success of the server operation is not +relevant to the client. + +

+Example: +

+  #include <xpa.h>
+
+  #define NXPA 10
+  int  i, got;
+  int fd;
+  char *names[NXPA];
+  char *messages[NXPA];
+  fd = open(...);
+  got = XPASetFd(NULL, "ds9", "fits", NULL, fd, names, messages, NXPA);
+  for(i=0; i<got; i++){
+    if( messages[i] != NULL ){
+      /* error processing */
+      fprintf(stderr, "ERROR: %s (%s)\n", messages[i], names[i]);
+    }
+    if( names[i] )
+      free(names[i]);
+    if( messages[i] )
+      free(messages[i]);
+  }
+
+ + + + +

XPAOpen: allocate a persistent client handle

+ + + +
+  #include <xpa.h>
+
+  XPA XPAOpen(char *mode);
+
+
+ + +

+XPAOpen() allocates a persistent XPA struct that can be used with +calls to XPAGet(), XPASet(), XPAInfo(), XPAGetFd(), and +XPASetFd(). Persistence means that a connection to an XPA server is +not closed when one of the above calls is completed but will be +re-used on successive calls. Using XPAOpen() therefore saves the time +it takes to connect to a server, which could be significant with slow +connections or if there will be a large number of exchanges with a +given access point. The mode argument currently is ignored ("reserved +for future use"). + +

+An XPA struct is returned if XPAOpen() was successful; otherwise NULL +is returned. This returned struct can be passed as the first argument +to XPAGet(), etc. Those calls will update the list of active XPA +connections. Already connected servers (from a previous call) are +left connected and new servers also will be connected. Old servers +(from a previous call) that are no longer needed are disconnected. +The connected servers will remain connected when the next call to +XPAGet() is made and connections are once again updated. + +

+Example: +

+ #include <xpa.h>
+
+  XPA xpa;
+  xpa = XPAOpen(NULL);
+
+ + + + +

XPAClose: close a persistent XPA client handle

+ + + +
+  #include <xpa.h>
+
+  void XPAClose(XPA xpa);
+
+
+ + +

+XPAClose closes the persistent connections associated with this XPA struct +and frees all allocated space. It also closes the open sockets connections +to all XPA servers that were opened using this handle. + +

+Example: +

+  #include <xpa.h>
+
+  XPA xpa;
+  XPAClose(xpa);
+
+ + + + +

XPANSLookup: lookup registered XPA access points

+ + + +
+  #include <xpa.h>
+
+  int XPANSLookup(XPA xpa,
+  	          char *template, char type,
+	          char ***classes, char ***names,
+	          char ***methods, char ***infos)
+
+
+ + +

+XPA routines act on a class:name identifier in such a way +that all access points that match the identifier are processed. It is +sometimes desirable to choose specific access points from the +candidates that match the +template. In order to do this, the +XPANSLookup routine can be called to return a list of matches, so that +specific class:name instances can then be fed to XPAGet(), XPASet(), etc. + +

The first argument is an optional XPA struct. If non-NULL, the +existing name server connection associated with the specified xpa is +used to query the xpans name server for matching templates. Otherwise, +a new (temporary) connection is established with the name server. + +

+The second argument to XPANSLookup is the class:name +template +to match. + +

+The third argument for XPANSLookup() is the type of access and can be +any combination of: +

+  type   	explanation
+  ------	-----------
+  g		xpaget calls can be made on this access point
+  s		xpaset calls can be made on this access point
+  i		xpainfo calls can be made on this access point
+
+

+The call typically specifies only one of these at a time. + +

+The final arguments are pointers to arrays that will be filled +in and returned by the name server. The name server will allocate and +return arrays filled with the classes, names, and methods of all XPA +access points that match the template +and have the specified type. Also returned are info strings, which +generally are used internally by the client routines. These can be +ignored (but the strings must be freed). The function returns the +number of matches. The returned value can be used to loop through the +matches: + +Example: +

+  #include <xpa.h>
+
+  char **classes;
+  char **names;
+  char **methods;
+  char **infos;
+  int i, n;
+  n = XPANSLookup(NULL, "foo*", "g", &classes, &names, &methods, &infos);
+  for(i=0; i<n; i++){
+    [more specific checks on possibilities ...]
+    [perhaps a call to XPAGet for those that pass, etc. ...]
+    /* don't forget to free alloc'ed strings when done */
+    free(classes[i]);
+    free(names[i]);
+    free(methods[i]);
+    free(infos[i]);
+  }
+  /* free up arrays alloc'ed by names server */
+  if( n > 0 ){
+    free(classes);
+    free(names);
+    free(methods);
+    free(infos);
+  }
+
+

+The specified +template +also can be a host:port specification, for example: +

+  myhost:12345
+
+

+In this case, no connection is made to the name server. Instead, the +call will return one entry such that the ip array contains the ip for +the specified host and the port array contains the port. The class +and name entries are set to the character "?", since the class and +name of the access point are not known. + + + + +

XPAAccess: return XPA access points matching +template (XPA 2.1 and above)

+ + + +
+  #include <xpa.h>
+
+  int XPAAccess(XPA xpa,
+	        char *template, char *paramlist, char *mode,
+	        char **names, char **messages, int n);
+
+
+ + +

+The XPAAccess routine returns the public access points that match the +specified second argument template and +have the specified access type. + +

+A +template +of the form "class1:name1" is sent to the +XPA name server, which returns a list of at most n matching XPA +servers. A connection is established with each of these servers and +the paramlist string is passed to the server as the data transfer +request is initiated. If an XPA struct is passed to the call, then the +persistent connections are updated as described above. Otherwise, +temporary connections are made to the servers (which will be closed +when the call completes). + +

+The XPAAccess() routine retrieves names from at most n XPA servers +that match the specified template and that were checked for access +using the specified mode. The return string contains both the +class:name and ip:port. If a given server returned an error or the +server callback sends a message back to the client, then the message +will be stored in the associated element of the messages array. +NB: if specified, the name and messages arrays must be of size n or greater. + +

+The returned message string will be of the form: +

+  XPA$ERROR error-message (class:name ip:port)
+
+

+Note that names of matching registered access points are always +returned but may not be valid; it is not sufficient to assume that the +returned number of access points is the number of valid access points. +Rather, it is essential to check the messages array for error +messages. Any string in the messages array is an error message and +indicated that the associated access point is not available. + +

+For example, assume that a server registers a number of access points +but delays entering its event loop. If a call to XPAAccess() is made +before the event loop is entered, the call will timeout (after waiting +for the long timeout period) and return an error of the form: +

+  XPA$ERROR: timeout waiting for server authentication (XPA:xpa1)
+
+The error means that the XPA access point has been registered but is +not yet available (because events are not being processed). When the +server finally enters its event loop, subsequent calls to XPAAccess() +will return successfully. + +

+NB: This routine only works with XPA servers built with XPA 2.1.x and later. +Servers with older versions of XPA will return the error message: + + XPA$ERROR invalid xpa command in initialization string + +If you get this error message, then the old server actually is ready +for access, since it got to the point of fielding the query! The +xpaaccess program, for example, ignores this message in order to work +properly with older servers. + +

+The third argument for XPAAccess() is the type of access and can be +any combination of: +

+  type   	explanation
+  ------	-----------
+  g		xpaget calls can be made on this access point
+  s		xpaset calls can be made on this access point
+  i		xpainfo calls can be made on this access point
+
+

+The mode string argument is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  ack		true/false	true		if false, don't wait for ack from server (after callback completes)
+
+

+The ack keyword is not very useful, since the server completes the callback +in order to return the data anyway. It is here for completion (and perhaps +for future usefulness). + + + + + + + + + + + + + + + + + + + + + + + +

+Go to XPA Help Index + +

Last updated: March 10, 2007
+ + + diff --git a/doc/convert.html b/doc/convert.html new file mode 100644 index 0000000..a8d0dd2 --- /dev/null +++ b/doc/convert.html @@ -0,0 +1,146 @@ + + + +Converting the XPA API to 2.0 + + + + +

XPAConvert: Converting the XPA API to 2.0

+ + +

Summary

+

+This document describes tips for converting from xpa 1.0 (Xt-based +xpa) to xpa 2.0 (socket-based xpa). + + +

Description

+

+The following are tips for converting from xpa 1.0 (Xt-based xpa) to +xpa 2.0 (socket-based xpa). The changes are straight-forward and +almost can be done automatically (we used editor macros for most of +the conversion). +

    +

    +

  • The existence of the cpp XPA_VERSION directive to distinguish between 1.0 +(where it is not defined) and 2.0 (where it is defined). + +

    +

  • Remove the first widget argument from all send and receive server +callbacks. Also change first 2 arguments from XtPointer to void +*. For example: +
    +#ifdef XPA_VERSION
    +static void XPAReceiveFile(client_data, call_data, paramlist, buf, len)
    +     void *client_data;
    +     void *call_data;
    +     char *paramlist;
    +     char *buf;
    +     int len;
    +#else
    +static void XPAReceiveFile(w, client_data, call_data, paramlist, buf, len)
    +     Widget w;
    +     XtPointer client_data;
    +     XtPointer call_data;
    +     char *paramlist;
    +     char *buf;
    +     int len;
    +#endif
    +
    +

    +

  • Server callbacks should be declared as returning int instead +of void. They now should return 0 for no errors, -1 for error. + +

    +

  • The mode flags have changed when defining XPA server callbacks. +The old S flag (save buffer) is replaced by freebuf=false. +The old E flag (empty buffer is OK) is no longer used (it +was an artifact of the X implementation). + +

    +

  • Change NewXPACommand() to XPAcmdNew(), with the new calling sequence: +
    +  xpa = NewXPACommand(toplevel, NULL, prefix, NULL);
    +
    +is changed to: +
    +  xpa = XPACmdNew(xclass, name);
    +
    +

    +

  • Change the AddXPACommand() subroutine name to XPACmdAdd (with the same +calling sequence): +
    +  AddXPACommand(xpa, "file",
    +    "\tdisplay a new file\n\t\t  requires: filename",
    +    NULL, NULL, NULL, XPAReceiveFile, text, NULL);
    +
    +is changed to: +
    +  XPACmdAdd(xpa, "file",
    +    "\tdisplay a new file\n\t\t  requires: filename",
    +    NULL, NULL, NULL, XPAReceiveFile, text, NULL);
    +
    +

    +

  • The XPAXtAppInput() routine should be called just before XtAppMainLoop() +to add xpa fds to the Xt event loop: +
    +  /* add the xpas to the Xt loop */
    +  XPAXtAddInput(app, NULL);
    +
    +  /* process events */
    +  XtAppMainLoop(app);
    +
    +

    +

  • Change NewXPA() to XPANew() and call XPAXtAddInput() if the XtAppMainLoop +routine already has been entered: +
    +  xpa = NewXPA(saotng->xim->toplevel, prefix, xparoot,
    +               "FITS data or image filename\n\t\t  options: file type",
    +               XPASendData, new, NULL,
    +               XPAReceiveData, new, "SE");
    +
    +is changed to: +
    +  sprintf(tbuf, "%s.%s", prefix, xparoot);
    +  xpa = XPANew("SAOTNG", tbuf,
    +               "FITS data or image filename\n\t\t  options: file type",
    +               XPASendData, new, NULL,
    +               XPAReceiveData, new, "SE");
    +  XPAXtAddInput(XtWidgetToApplicationContext(saotng->xim->toplevel), xpa);
    +
    +

    +

  • Change XPAInternalReceiveCommand() to XPACmdInternalReceive() +remove first argument in the calling sequence): +
    +  XPAInternalReceiveCommand(im->saotng->xim->toplevel,
    +			    im->saotng, im->saotng->commands,
    +			    "zoom reset", NULL, 0);
    +
    +is changed to: +
    +  XPACmdInternalReceive(im->saotng, im->saotng->commands,
    +			"zoom reset", NULL, 0);
    +
    +

    +

  • Change DestroyXPA to XPAFree: +
    +  DestroyXPA(im->dataxpa);
    +
    +is changed to: +
    +  XPAFree(im->dataxpa);
    +
    +
+ + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + + diff --git a/doc/env.html b/doc/env.html new file mode 100644 index 0000000..4a71e80 --- /dev/null +++ b/doc/env.html @@ -0,0 +1,371 @@ + + + +The XPA Environment + + + + +

XPAEnv: Environment Variables for XPA Messaging

+ + +

Summary

+Describes the environment variables which can be used to tailor the overall +XPA environment. + + +

Description

+

+The following environment variables are supported by XPA: +

+

+

XPA_ACL +
If XPA_ACL is true, then +host-based XPA Access Control +is turned on and only specified machines can access specified access +points. If false, then access control is turned off and any +machine can access point. The default is turn turn access control on. + +

+

XPA_ACLFILE +
If +XPA Access Control +is turned on, this variable specifies the name of the file containing +access control information for all access points started by this user. +The default file name is: $HOME/acls.xpa. + +

+

XPA_CONNECT_TIMEOUT +
When an XPA server first starts up, it immediately tries to +connect to the XPA name server program (xpans) on the host specified by +the XPA_NSINET variable. (If this connection fails on the +local host, and if xpans can be found in the path, then the name +server is started automatically.) Unfortunately, a mis-configured +network can cause this connect attempt to hang for many seconds while +the connect() system call times out. Therefore, an alarm is started +to interrupt the connect() call and prevent a long hang. The initial +value of the alarm timeout is 10 seconds, but can be changed by setting +this environment variable. If you want to disable the alarm and allow +the initial connect() to time out, set the value of this variable to +0. Normally, users would not change this variable at all. + +

+

XPA_CLIENT_DOXPA +
Normally, an XPA client (xpaget, xpaset, etc.) will process incoming +XPA server requests while awaiting the completion of the client request. +Setting this variable to "false" will prevent XPA server requests from +being processed by the client. + +

+

XPA_DEFACL +
If +XPA Access Control +is turned on, this variable specifies the default access control +condition for all access points, if the XPA_ACLFILE file does +not exist. The default acl is: $host:* $host +, meaning that +all processes on the host machine have full access to all access points. + +

+

XPA_HOST +
+For the INET socket method, XPA utilizes the canonical hostname (as +returned by the gethostname() routine) to construct the IP part of the +method id. Under some circumstances, this might not be a correct choice +of name and IP. For example, if an XPA server is started on a machine +running VPN, you might want to use the VPN name and IP instead of the +canonical host name, so that other machines in the VPN network can +access the server. In this case, you can set the XPA_HOST to be +the VPN name (if resolvable) or, more easily, the VPN IP. + +

+

XPA_IOCALLSXPA +
+Setting this variable causes all XPA socket IO calls to process +outstanding XPA requests whenever the primary socket is not ready for +IO. This means that a server making a client call will (recursively) +process incoming server requests while waiting for client completion. +This inter-IO XPA processing avoids a rare +XPA Race Condition: two or more +XPA servers sending messages to one another using an XPA client +routine such as XPASet() can deadlock while each waits for the other +server to respond. This can happen, for example, if the servers call +XPAPoll() with a time limit, and send messages in between the polling call. + +

+By default, this option is turned off, because we judge that the added +code complication and overhead involved will not be justified by the +amount of its use. Moreover, processing XPA requests within socket IO +can lead to non-intuitive results, since incoming server requests will +not necessarily be processed to completion in the order in which they +are received. + +

+

XPA_LOGNAME +
+XPA preferentially uses the de facto standard environment variable +LOGNAME to determine the username when registering an access point in +the name server. If this environment variable has been used for +something other than the actual user name (such as a log file name), +unexpected results can ensue. In such cases, use the XPA_LOGNAME +variable to set the user name. (If neither exists, then getpwuid(geteuid()) +is used as a last resort). + +

+

XPA_LONG_TIMEOUT +
XPA is designed to allow data to be sent from one process to +another over a long period of time (i.e., a program that generates +image data sends that data to an image display, but slowly) but it +also seeks to prevent hangs. This is done by supporting 2 timeout +periods: a short timeout for protocol communication +and a long for data communication. +

+The XPA_LONG_TIMEOUT variable controls the long +timeout and is used to prevent hangs in cases where communication +between the client and server that is not controlled by the +XPA interface itself. Transfer of data between client and server, or a +client's wait for a status message after completion of the server +callback, are two examples of this sort of communication. By default, +the long timeout is set to 180 seconds. +Setting the value to -1 will disable long timeouts and allow +an infinite amount of time. + +

+

XPA_MAXHOSTS +
The maximum number of access points that the programs +xpaset, xpaget, and xpainfo will +communicate with at one time. The default is 64, meaning, for +example, that the xpaset program will not send a message +to more than 100 access points at one time and xpaget will +not retrieve from more than 100 access points at one time. + +

+

XPA_METHOD +
+Determines the socket connection method used by this session of XPA. +The choices are: inet (to use INET or Internet-based +sockets), localhost (to use the machines localhost inet +socket), or local (unix) (to use UNIX sockets). The default +is INET. Using the inet method will allow access +from other machines (subject to access controls) but using +localhost or local will not. Localhost is most useful +for private access and when the machine in question is not connected +to the Internet. The unix method also can be used for private access +and non-Internet connections (Unix platforms only). +

+Once defined, the first registration of an XPA access point will +ensure that an instance of the +XPA Name Server (xpans) +is running that handles that connection method. All new access points +will use the new connection method but existing access points will use +the original method. + +

+

XPA_NSINET +
For the inet method of socket connection, this variable +specifies the host and port on which the +XPA Name Server (xpans) +is listens for new access points. The default is $host:$port, +meaning that the default XPA port (14285) on the current machine +(as returned by gethostname()) is used. If several machines were all +accessing the same XPA access points, you would use this variable to +specify that they all use the same name server to find out about these +access points. For example, a value of myhost:$port would +mean that the xpans name server is running on myhost and uses the +default port 12345. All machines would then get the XPA access points +registered with that name server, subject to access controls. +

+The port used by xpans to register its XPA access point normally is +taken to be one greater than the port on which it receives new access +points from XPA servers. You can specify a specific access point port +using the syntax machine:port1,port2, i.e., the access point port is +specified after the comma. For example, $host:12345,23456 will listen +for new access ports on 12345 and will accept XPA commands on 23456. + +

+

XPA_NSREGISTER +
+This boolean variable specifies whether a server registers its XPA +access point with the specified xpans name server. The default is +true. If set to false, the access point still is +set up but it is not registered with xpans and therefore cannot be +accessed by name. (It can be accessed by method, if the latter is +known.) Note that an access point can be registered later on (using +-remote or -proxy, for example). This variable mainly is useful in +cases where the Internet configuration is broken (so that registration +causes a DNS hang) but you still wish to and can use the server with a +remote xpans (e.g., ds9's Virtual Observatory capability). + +

+

XPA_NSUNIX +
For the local method of socket connection, this variable +specifies the name of the Unix file that will be used to access the +XPA Name Server (xpans). The default is +xpans_unix. This variable is not usually needed. Note that +is the local socket method is used, then remote machines will +not be able to access the xpans name server or the registered XPA access +points. + +

+

XPA_NSUSERS +
+This variable specifies whether other users' access points will be +returned by the +XPA Name Server (xpans) for use by +xpaget, xpaset, etc. +Generally speaking, it is sufficient to run one xpans name server per +machine and register the access points for all users with that xpans. +This means, for example, that if you request information from +ds9 by running: +
+  xpaget ds9 colormap
+
+you might get information from your own ds9 as well as +from another user running ds9 on the same machine. The +XPA_NSUSERS variable controls whether you want such access +to the access points of other users. +By default, only your own access points are returned, so +that, in the example above, you would only get the colormap information +from the ds9 you registered. If, however, you had set the value of the +XPA_NSUSERS variable to eric,fred, then you would be +able to communicate with both eric and fred's access points. Note that +this variable can be overridden using the -u switch on the +xpaget, xpaset, and xpainfo programs. + +

+

XPA_PORT +
+A semi-colon delimited list of user specified ports to use for specific +XPA access points. The format is each specification is: +
+class:template port1[ port2]
+
+where port1 is the main (command) port for the access point and +port2 is the (secondary) data port. If port2 is not specified, +it defaults to a value of 0 (meaning the system assigns the port). + +

+Specification of specific ports is useful, for example, when a machine +outside a firewall needs to communicate with a machine inside a +firewall. In such a case, the firewall should be configured to allow +socket connections to both the command and data port from the outside +machine, and the inside XPA program should be started up with the +outside machine in its ACL list. Then, when the inside program is +started with specified ports, outside XPA programs can use +"machine:port" to contact the inside access points, instead of the +access point names. That is, the machine outside the firewall does not +need access to the XPA name server: +

+export XPA_PORT="DS9:ds9 12345 12346"   # on machine "inside"
+cat foo.fits | xpaset inside:12345 fits # on machine "outside"
+
+Note that 2 ports are required for full XPA communication and +therefore 2 ports should be specified to go through a firewall. The +second port assignment is not important if you simply are assigning +the command port in order to communicate commands with a known +port (e.g., to bypass the xpans name server). If only one (command) +port is specified, the system will negotiate a random data port and +everything will work properly. + +

+This support is somewhat experimental. If you run into problems, please +let us know. + +

+

XPA_PORTFILE +
+A list of user-specified port to use for specific xpa access points. +The format of the file is: +
+class:template port1 [port2]
+
+where port1 is the main port for the access point and +port2 is the data port. If port2 is not specified, it defaults +to a value of 0 (meaning the system assigns the port). See +XPA_PORT above for an explanation of user-specified ports. + +

+

XPA_SHORT_TIMEOUT +
XPA is designed to allow data to be sent from one process to +another over a long period of time (i.e., a program that generates +image data sends that data to an image display, but slowly) but it +also seeks to prevent hangs. This is done by supporting 2 timeout +periods: a short timeout for protocol communication +and a long for data communication. +

+The XPA_SHORT_TIMEOUT variable +controls the short timeout and is used to prevent hangs +in cases where the XPA protocol requires internal communication between +the client and server that is controlled by the XPA interface +itself. Authentication is an example of this sort of communication, +as is the establishment of a data channel between the two processes. +The default value for the short is 30 seconds (which is +a pretty long time, actually). Setting the value to -1 will disable +short timeouts and allow an infinite amount of time. + +

+

XPA_SIGUSR1 +
If the value of this variable is true, then XPA will +catch SIGUSR1 signals when performing an I/O operation in order to +curtail that operation. This facility allows users to send a SIGUSR1 +signal to an XPA server if a client is hanging up the server by +sending or receiving data too slowly (timeouts also can be used -- see +above). When enabled in this way, the SIGUSR1 signal is ignored at all other +times, so that its safe to send the signal at any time. If the +variable is set to false, then SIGUSR1 is not used at +all. Turning off SIGUSR1 would be desired in cases there the program +uses SIGUSR1 for some other reason and does not want XPA interfering. +The default is to use the signal. + +

+

XPA_TIMESTAMP_ERRORS +
If XPA_TIMESTAMP_ERRORS is true, then error +messages will include a date/time string. This can be useful when +XPA errors are being saved in an error log (e.g. Web/CGI use). The +default is false. +
+ +

+

XPA_TMPDIR +
This variable specifies the directory into which XPA logs, Unix +socket files (when XPA_METHOD is local), etc. are +stored. The default is /tmp/.xpa. + +

+

XPA_VERBOSITY +
Specify the verbosity level of error messages. If the value is +set to 0, false, or off, then no error +messages are printed to stderr. If the value is 1, then +important XPA error messages will be output. If the value is +set to 2, XPA warnings about out-of-sync messages will also +be output. These latter almost always can be ignored. + +

+

XPA_VERSIONCHECK +
Specify whether a new access point should check its major and minor XPA +version number against the version used by the xpans name server at +registration time. The default is true. When checking is +performed, a warning is issued if the server major version is found to +be greater than the xpans version. Note that the check is performed +both by the XPA server and by the xpans process and warnings will be +issued by each. Also, instead of the values of true or +false, you can give this variable an integer value n. In this +case, each version checking process (i.e., the XPA-enabled server or +xpans) will print out a maximum of n warning messages (after which +version warnings are silently swallowed). +

+In general, it is a bad idea to run an XPA-enabled server program +using a version of XPA newer than the basic xpaset, xpaget, xpaaccess, +xpans programs. This sort of mismatch usually will not work due to +protocol changes. + + + + + +

+Go to XPA Help Index + +

Last updated: December 23, 2009
+ + + diff --git a/doc/examples.html b/doc/examples.html new file mode 100644 index 0000000..0bd68d4 --- /dev/null +++ b/doc/examples.html @@ -0,0 +1,64 @@ + + + +Where to Find Example/Test Code + + + + +

XPACode: Where to Find Example/Test Code

+ + +

Summary

+

+The XPA source code directory contains two test programs, +stest.c, and ctest.c that can serve as +examples for writing XPA servers and clients, respectively. +They also can be used to test various features of XPA. + + +

Description

+

+To build the XPA test programs, execute: +

+   make All
+
+in the XPA source directory to generate the stest and +ctest programs. (NB: this should work on all platforms, +although we have had problems with unresolved externals on one +Sun/Solaris machine, for reasons still unknown.) +

+The stest program can be executed with no arguments to start +an XPA server that contains the access points: xpa, xpa1, +c_xpa (containing sub-commands cmd1 and cmd2), and i_xpa. +You then can use xpaset and xpaget to interact with these access points: +

+  cat xpa.c | xpaset xpa      # send to xpa
+  cat xpa.c | xpaset "xpa*"   # send to xpa and xpa1
+  xpaget xpa                  # receive from xpa
+  xpaget xpa*                 # receive from xpa and xpa1
+
+etc. You also can use ctest to do the same thing, or to iterate: +
+  ctest -s -l 100 xpa        # send to xpa 100 times
+  ctest -s -l 100 "xpa*"     # send to xpa and xpa1 100 times
+  ctest -g -l 100 xpa        # receive from xpa 100 times
+  ctest -g -l 100 "xpa*"     # receive from xpa and xpa1 100 times
+
+More options are available: see the stest.c and ctest.c code itself, which +were used extensively to debug XPA. + +

+The file test.tcl in the XPA source directory gives examples for using the +XPATclInterface. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/help.html b/doc/help.html new file mode 100644 index 0000000..dfe51f9 --- /dev/null +++ b/doc/help.html @@ -0,0 +1,162 @@ + + + +The XPA Help Facility + + + + +

XPA: Public Access to Data and Algorithms

+ + +

Summary

+This document is the Table of Contents for XPA. + + +

Description

+

+The XPA messaging system provides seamless communication between many +kinds of Unix programs, including X programs and Tcl/Tk programs. It +also provides an easy way for users to communicate with XPA-enabled +programs by executing XPA client commands in the shell or by utilizing +such commands in scripts. Because XPA works both at the programming +level and the shell level, it is a powerful tool for unifying any +analysis environment: users and programmers have great flexibility in +choosing the best level or levels at which to access XPA services, and +client access can be extended or modified easily at any time. + +

+A program becomes an XPA-enabled server by defining named points of +public access through which data and commands can be exchanged with +other client programs (and users). Using standard TCP sockets as a +transport mechanism, XPA supports both single-point and broadcast +messaging to and from these servers. It supports direct communication +between clients and servers, or indirect communication via an +intermediate message bus emulation program. Host-based access control +is implemented, as is as the ability to communicate with XPA servers +across a network. + +

+XPA implements a layered interface that is designed to be useful both +to software developers and to users. The interface consists of a +library of XPA client and server routines for use in C/C++ programs and +a suite of high-level user programs built on top of these libraries. +Using the XPA library, access points can be added to Tcl/Tk programs, +Xt programs, or to Unix programs that use the XPA event loop or any +event loop based on select(). Client access subroutines can be added +to any Tcl/Tk, Xt, or Unix program. Client access also is supported at +the command line via a suite of high-level programs. + +

+Choose from the following topics: + +

+ + + +
Last updated: September 10, 2003
+ + diff --git a/doc/inet.html b/doc/inet.html new file mode 100644 index 0000000..3155885 --- /dev/null +++ b/doc/inet.html @@ -0,0 +1,260 @@ + + + +XPA Communication Between Hosts + + + + +

XPAInet: XPA Communication Between Hosts

+ + +

Summary

+XPA uses standard inet sockets to support communication between two or +more host computers. + + +

Description

+

+When the Communication Method is set to +inet (as it is by default), XPA can be used to communicate +between different computers on the Internet. INET sockets utilize the +IP address of the given machine and a (usually random) port number to +communicate between processes on the same machine or between different +machines on the Internet. These standard Internet sockets are also +used by programs such as Netscape, ftp. etc. + +

+XPA supports a host-based Access Control mechanism +to prevent unauthorized access of XPA access points by other computers +on the Net. By default, only the machine on which the XPA server is +running can access XPA services. Therefore, setting up communication +between a local XPA server machine and a remote client machine +requires a two-part registration process: + +

    +
  • the XPA service on the local machine must be made known to the +remote machine +
  • the remote machine must be given permission to access the local +XPA service +
+ +Three methods by which this remote registration can be accomplished +are described below. + +

Manual Registration

+ +The first method is the most basic and does not require the remote +client to have xpans running. To use it, the local server simply +gives a remote client machine access to one or more XPA access points +using xpaset and the -acl sub-command. For example, +consider the XPA test program "stest" running on a local machine. By +default the access control for the access point named "xpa" is +restricted to that machine: +
+  [sh]$ xpaget xpa -acl
+  *:* 123.456.78.910 gisa
+  *:* localhost gisa
+
+Using xpaset and the -acl sub-command, a remote client +machine can be given permission to perform xpaget, xpaset, xpaaccess, +or xpainfo operations. For example, to allow the xpaget operation, the +following command can be issued on the local machine: +
+  [sh]$ xpaset -p xpa -acl "remote_machine g"
+
+This results in the following access permissions on the local machine: +
+  [sh]$ xpaget xpa -acl
+  XPA:xpa 234.567.89.012 g
+  *:* 123.456.78.910 gisa
+  *:* localhost gisa
+
+ +The remote client can now use the local server's xpans name server to +establish communication with the local XPA service. This can be done +on a call-by-call basis using the -i switch on xpaset, xpaget, etc: +
+  [sh]$ xpaget -i "local_machine:12345" xpa
+  class: XPA
+  name: xpa
+  method: 88877766:2778
+  sendian: little
+  cendian: big
+
+Alternatively, the XPA_NSINET variable on the remote machine can be +set to point directly to xpans on the local machine, removing +the need to override this value each time an XPA program is run: +
+  [csh]$ setenv XPA_NSINET 'karapet:$port'
+  [csh]$ xpaget xpa
+  class: XPA
+  name: xpa
+  method: 88877766:2778
+  sendian: little
+  cendian: big
+
+Here, '$port' means to use the default XPA name service port (14285). +not a port environment variable. + +

+Access permission for remote client machines can be stored in a file +on the local machine pointed to by the XPA_ACLFILE environment +variable or using the XPA_DEFACL environment variable. See XPA Access Control for more information. + +

Remote Registration

+ +If xpans is running on the remote client machine, then a local xpaset +command can be used with the -remote sub-command to +register the local XPA service in the remote name service, while at +the same time giving the remote machine permission to access the local +service. For example, assume again that "stest" is running on the +local machine and that xpans is also running on the remote machine. +To register access of this local xpa on the remote machine, use +the xpaset and the -remote sub-command: +
+  [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' +
+
+To register the local xpa access point on the remote machine with xpaget +access only, execute: +
+  [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g
+
+Once the remote registration command is executed, the remote client +machine will have an entry such as the following in its own xpans name +service: +
+  [csh]$ xpaget xpans
+  XPA xpa gs 88877766:2839 eric
+
+The xpa access point can now be utilized on the remote machine without +further setup: +
+  [csh]$ xpaget xpa
+  class: XPA
+  name: xpa
+  method: 838e2f68:2839
+  sendian: little
+  cendian: big
+
+To unregister remote access from the local machine, use the same +command but with a '-' argument: +
+  [sh]$ xpaset -p xpa -remote 'remote_machine:$port' -
+
+The benefit of using remote registration is that communication with +remote access points can be mixed with that of other access points +on the remote machine. Using Access Point +Names and Templates, one XPA command can be used to send or +receive messages to the remote and local services. + +

XPANS Proxy Registration

+ +The two methods described above are useful when the local and remote +machines are able to communicate freely to one another. This would be +the case on most Local Area Networks (LANs) where all machines are +behind the same firewall and there is no port blocking between +machines on the same LAN. The situation is more complicated when the +XPA server is behind a firewall, where outgoing connections are +allowed, but incoming port blocking is implemented to prevent machines +outside the firewall from connecting to machines inside the +firewall. Such incoming port blocking will prevent xpaset and xpaget +from connecting to an XPA server inside a firewall. + +

+To allow locally fire-walled XPA services to register with remote +machines, we have implemented a proxy service within the xpans name +server. To register remote proxy service, xpaset and the +-remote sub-command is again used, but with an additional +-proxy argument added to the end of the command: +

+  [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g -proxy
+
+Once a remote proxy registration command is executed, the remote +machine will have an entry such as the following in its own xpans name +service: +
+  [csh]$ xpaget xpans
+  XPA xpa gs @88877766:2839 eric
+
+The '@' sign in the name service entry indicates that xpans proxy +processing is being used for this access point. Other than that, from +the user's point of view, there is no difference in how this XPA +access point is contacted using XPA programs (xpaset, xpaget, etc.) or +libraries: +
+  [csh]$ xpaget xpa
+  class: XPA
+  name: xpa
+  method: 88877766:3053
+  sendian: little
+  cendian: big
+
+

+Of course, the underlying processing of the XPA requests is very much +different when xpans proxy is involved. Instead of an XPA program such +contacting the XPA service directly, it contacts the local xpans. +Acting as a proxy server, xpans communicates with the XPA service +using the command channel established at registration time. Commands +(including establishing a new data channel) are sent between xpans and +the XPA service to set up a new message transfer, and then data is fed +to/from the xpa request, through xpans, from/to the XPA service. In +this way, it can be arranged so that connections between the +fire-walled XPA service and the remote client are always initiated by +the XPA service itself. Thus, incoming connections that would be +blocked by the firewall are avoided. Note that there is a performance +penalty for using the xpans/proxy service. Aside from extra overhead +to set up proxy communication, all data must be sent through the +intermediate proxy process. + +

+The xpans proxy scheme requires that the remote client allow the local +XPA server machine to connect to the remote xpans/proxy server. If the +remote client machine also is behind a port-blocking firewall, such +connections will be disallowed. In this case, the only solution is to +open up some ports on the remote client machine to allow incoming +connections to xpans/proxy. Two ports must be opened (for command and +data channel connections). By default, these two ports are 14285 and +14287. The port numbers can be changed using the XPA_NSINET +environment variable. This variable takes the form: +

+  setenv XPA_NSINET machine:port1[,port2[,port3]]
+
+where port1 is the main connecting port, port2 is the XPA access port, +and port3 is the secondary data connecting port. The second and third +ports are optional and default to port1+1 and port1+2, respectively. +It is port1 and port3 that must be left open for incoming connections. + +

+For example, to change the port assignments so that xpans listens +for registration commands on port 12345 and data commands on port 28573: +

+  setenv XPA_NSINET myhost:12345
+
+Alternatively, all three ports can be assigned explicitly: +
+  setenv XPA_NSINET remote:12345,3000,12346
+
+In this case 12345 and 12346 should be open for incoming connections. +The XPA access port (which need not be open to the outside +world) is set to 3000. + +

+Finally, note that we currently have no mechanism to cope with +Internet proxy servers (such as SOCKS servers). If an XPA service is +running on a machine that cannot connect directly to outside machines, +but goes through a proxy server instead, there currently is no way to +register that XPA service with a remote machine. We hope to implement +support for SOCKS proxy in a future release. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/info.html b/doc/info.html new file mode 100644 index 0000000..75837bd --- /dev/null +++ b/doc/info.html @@ -0,0 +1,193 @@ + + + +Getting Common Information About Access Points + + + + +

XPACommon: Getting Common Information About Access Points

+ + +

Summary

+

+There are various kinds of generic information you can retrieve about +an XPA access point by using the xpaget command. + + +

Description

+

+You can find out which XPA access points have been registered with +the currently running +XPA name server +by executing the +xpaget +command to retrieve info from the XPA name server: +

+  xpaget xpans
+
+If, for example, the +stest test server program +is running, the following XPA access points will be returned (the specifics +of the returned info will vary for different machines and users): +
+  XPA xpa gs 838e2f67:1262 eric
+  XPA xpa1 gs 838e2f67:1266 eric
+  XPA c_xpa gs 838e2f67:1267 eric
+  XPA i_xpa i 838e2f67:1268 eric
+
+Note that access to this information is subject to the usual +XPA Access Control restrictions. + +

+Each XPA access point supports a number of reserved sub-commands that provide +access to different kinds of information, e.g. the access control for +that access point. These sub-commands can be executed by using +xpaset +or +xpaget +at the command line, or +XPAGet() +or +XPASet() +in programs, e.g: +

+  xpaget ds9 -acl
+  xpaget ds9 -help
+  xpaget ds9 env FOO
+
+  xpaset -p ds9 env FOO foofoo
+
+With the exception of -help and -version, reserved +sub-commands are available only on the machine on which the XPA server +itself is running. + +The following reserved sub-commands are defined for all access points: +
+ +

+

-acl get (set) the access control list [options: host type acl, for set] +
+The 'xpaset' option allows you to add a new acl for a given host, or change +the acl for an existing host. See +XPA Access Control +for more information. +This access point is available only on the server machine. + +

+

-env get (set) an environment variable [options: name (value, for set)] +
+The 'xpaget' option will return the value of the named environment +variable. The 'xpaset' option will set the value of the names +variable to the specified value. +This access point is available only on the server machine. +(Please be advised that we have had problems setting environment +variables in static Tcl/Tk programs such as ds9 running under Linux.) + +

+

-clipboard set(get) information on a named clipboard +
Clients can store ASCII state information on any number of named +clipboards. Clipboards of the same name created by clients on +different machines are kept separate. The syntax for creating a +clipboard is: +
+  [data] | xpaset [server] -clipboard add|append [clipboard_name]
+  xpaset -p [server] -clipboard delete [clipboard_name]
+
+Use "add" to create a new clipboard or replace the contents of an existing +one. Use "append" to append to an existing clipboard. +

+Information on a named clipboard is retrieved using: +

+  xpaget [server] -clipboard [clipboard_name]
+
+

+

-exec set: execute commands from buffer [options: none] +
+If -exec is specified in the paramlist of an 'xpaset' call, then further +sub-commands will be retrieved from the data buffer. + +

+

-help get: return help string for this XPA or sub-command [options: name (for sub-commands)] +
+Each XPA access point and each XPA sub-command can have a help string +associated with it that is specified when the access point is defined. +The -help option will return this help string. For XPA access points +that contain user-defined sub-commands, you can get the help string +for a particular sub-command by specifying its name, or else get the +help strings for all sub-commands if not name is specified. + +

+

-ltimeout get (set) the long timeout value [options: seconds|reset] +
+The 'xpaget' option will return the value of the long timeout (in seconds). +The 'xpaset' option will set the value of the long timeout. If "reset" is +specified, then the timeout value will be reset to the default value. + +

+

-nsconnect set: re-establish name server connection to all XPA's [options: none] +
+If the +XPA Name Server (xpans) +process has terminated unexpectedly and then re-started, this +sub-command can be used to re-establish the connection. You use it by +sending the command to the [name:port] or [file] of the access point +instead of to the XPA name (since the latter requires the xpans +connection!): +
+  xpaset -p 838e2f67:1268 -nsconnect
+
+See xpans for more information. + +

+

-nsdisconnect set: break name server connection to all XPA's [options: none] +
+This sub-command will terminate the connection to the +XPA Name Server (xpans), thereby making +all access points inaccessible except through their underlying [name:port] +or [file] identifiers. I forget why we added it, it seems pretty useless. + +

+

-stimeout get (set) the short timeout value [options: seconds|reset] +
+The 'xpaget' option will return the value of the short timeout (in seconds). +The 'xpaset' option will set the value of the short timeout. If "reset" is +specified, then the timeout value will be reset to the default value. + +

+

-remote set: register xpa with remote server [options: host[:port] [acl]] [-proxy] +
+This sub-command will register the XPA access point with the XPA name +server (xpans) on the specified host (which must already be running). +The specified host also is given access control to the access point, +using the specified acl or the default acl of "+" (meaning the remote +host can xpaset, xpaget, xpainfo or xpaaccess). If the acl is +specified as "-", then the access point is unregistered. +See Communication Between Machines +for more information on how this sub-command is used. + +

+

-version get: return XPA version string [options: none] +
+The version refers to the version of XPA used to define this access point +(currently something like 2.0). + +
+ +

+You can add your own reserved commands to all XPA access points by using the +XPACmdAdd() +routine, passing the XPA handle returned by XPA XPAGetReserved(void) +as the first argument. Note again that these will only be available on the +machine where the XPA service is running. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/intro.html b/doc/intro.html new file mode 100644 index 0000000..f9c9947 --- /dev/null +++ b/doc/intro.html @@ -0,0 +1,148 @@ + + + +Introduction to XPA + + + + +

XPAIntro: Introduction to the XPA Messaging System

+ + +

Summary

+

+A brief introduction to the XPA messaging system, which provides +seamless communication between all kinds of Unix event-driven +programs, including X programs, Tcl/Tk programs, and Perl programs. + + +

Description

+

+The XPA messaging system provides seamless communication between all +kinds of Unix programs, including X programs, Tcl/Tk programs, and +Perl programs. It also provides an easy way for users to communicate +with these XPA-enabled programs by executing XPA client commands in +the shell or by utilizing such commands in scripts. Because XPA works +both at the programming level and the shell level, it is a powerful +tool for unifying any analysis environment: users and programmers have +great flexibility in choosing the best level or levels at which to +access XPA services, and client access can be extended or modified +easily at any time. + +

+A program becomes an XPA-enabled server by defining named points of +public access through which data and commands can be exchanged with +other client programs (and users). Using standard TCP sockets as +a transport mechanism, XPA supports both single-point and broadcast +messaging to and from these servers. It supports direct communication +between clients and servers, or indirect communication via an +intermediate message bus emulation program. Host-based access control +is implemented, as is as the ability to communicate with XPA servers +across a network. + +

+XPA implements a layered interface that is designed to be useful both +to software developers and to users. The interface consists of a +library of XPA client and server routines for use in programs and a +suite of high-level user programs built on top of these libraries. +Using the XPA library, access points can be added to +Tcl/Tk +programs, +Xt +programs, or to Unix programs that use the XPA event loop or any +event loop based on select(). Client access subroutines can be added +to any Tcl/Tk or Unix program. Client access also is supported at the +command line via a suite of high-level programs. + +

+The major components of the XPA layered interface are: +

    +
  • +A set of XPA server routines, centered on +XPANew(), +which are used by XPA server programs to tag public access points with +string identifiers and to register send and receive callbacks for +these access points. + +
  • +A set of XPA client routines, centered on the +XPASet() +and +XPAGet(), +which are used by external client applications to exchange data and +commands with an XPA server. + +
  • +High-level programs, centered on +xpaset +and +xpaget, +which allow data +and information to be exchanged with XPA server programs from the +command line and from scripts. These programs have the command syntax: +
    +  [data] | xpaset  [qualifiers ...]
    +           xpaget  [qualifiers ...]
    +
    +
  • +An XPA name server program, +xpans, +through which XPA access point names are +registered by servers and distributed to clients. +
+ +

+Defining an XPA access point is easy: a server application calls +XPANew(), +XPACmdNew(), +or the experimental +XPAInfoNew() +routine to +create a named public access point. An XPA service can specify "send" +and "receive" callback procedures (or an "info" procedure in the case +of XPAInfoNew()) to be executed by the program when an external +process either sends data or commands to this access point or requests +data or information from this access point. Either of the callbacks +can be omitted, so that a particular access point can be specified as +read-only, read-write, or write-only. Application-specific client +data can be associated with these callbacks. Having defined one or +more public access points in this way, an XPA server program enters +its usual event loop (or uses the standard XPA event loop). + +

+Clients communicate with these XPA public access points +using programs such as +xpaget, +xpaset, and +xpainfo +(at the command line), +or routines such as +XPAGet(), +XPASet(), +and +XPAInfo() +within a program. Both methods require specification of the name of +the access point. The xpaget program returns data or other +information from an XPA server to its standard output, while the +xpaset program sends data or commands from its standard input to an +XPA application. The corresponding API routines set/get data to/from +memory, returning error messages and other info as needed. If a +template +is used to specify the access point name (e.g., "ds9*"), then +communication will take place with all servers matching that template. + +

+Please note that XPA currently is not thread-safe. All XPA calls must be +in the same thread. + + + + + +

+Go to XPA Help Index + +

Last updated: March 10, 2007
+ + + diff --git a/doc/method.html b/doc/method.html new file mode 100644 index 0000000..d85fc89 --- /dev/null +++ b/doc/method.html @@ -0,0 +1,90 @@ + + + +XPA Communication Methods + + + + +

XPAMethod: XPA Communication Methods

+ + +

Summary

+

+XPA supports both inet and unix (local) socket communication. + + +

Description

+

+XPA uses sockets for communication between processes. It supports +three methods of socket communication: inet, localhost, and unix. In +general, the same method should be employed for all XPA processes in a +session and the global environment variable XPA_METHOD should be used +to set up the desired method. By default, the preferred method is +"inet", which is appropriate for most users. You can set up a +different method by typing something like: +

+  setenv XPA_METHOD local              # unix csh
+  XPA_METHOD=local; export XPA_METHOD  # unix sh, bash, windows/cygwin
+  set XPA_METHOD=localhost             # dos/windows
+
+The options for XPA_METHOD are: inet, unix (or +local), and localhost. On Unix machines, this +environment setup command can be placed in your shell init file +(.cshrc, .profile, .bashrc, etc.) On Windows platforms, it can be +placed in your AUTOEXEC.BAT file (I think!). + +

+By default, inet sockets are used by XPA. These are the standard +Internet sockets that are used by programs such as Netscape, +ftp. etc. Inet sockets utilize the IP address of the given machine and +a (usually random) port number to communicate between processes on the +same machine or between different machines on the Internet. (Note that +XPA has an Access Control mechanism to +prevent unauthorized access of XPA access points by other computers on +the Net). For users connected to the Internet, this usually is the +appropriate communication method. For more information about setting +up XPA communication between machines, see +Communication Between Machines. + +

+In you are using XPA on a machine without an Internet connection, then +inet sockets are not appropriate. In fact, an XPA process often will +hang for many seconds while waiting for a response from the Domain +Name Service (DNS) when using inet sockets. Instead of inet sockets, +users on Unix platforms can also use unix sockets (also known +as local sockets). These sockets are based on the local file system +and do not make use of the DNS. They generally are considered to be +faster than inet sockets, but they are not implemented under +Windows. Use local sockets as a first resort if you are on a Unix +machine that is not connected to the Internet. + +

+Users not connected to the Internet also can use localhost +sockets. These are also inet-type sockets but the IP address used for +the local machine is the localhost address, 0x7F000001, instead +of the real IP of the machine. Depending on how sockets are set up for +a given platform, communication with the DNS usually is not required in +this case (though of course, XPA cannot interact with other machines). +The localhost method will generally work on both Unix and Windows +platforms, but whether the DNS is required or not is subject to +individual configurations. + +

+A final warning/reminder: if your XPA-enabled server hangs at startup +time and your XPA_METHOD is inet, the problem probably is +related to an incorrect Internet configuration. This can be confirmed +by using the unix method or (usually) the localhost +method. You can use these alternate methods if other hosts do not need +access to the XPA server. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/name.html b/doc/name.html new file mode 100644 index 0000000..5269378 --- /dev/null +++ b/doc/name.html @@ -0,0 +1,48 @@ + + + +What does XPA stand for? + + + + +

XPAName: What does XPA stand for?

+ + +

Summary

+

+What does XPA stand for? Who knows anymore! + + +

Description

+

+What does XPA stand for? Dunno! The XPA messaging system originally +was built on top of the X Window System and XPA was the mnemonic for +X Public Access, to emphasize that we were providing public +access to previously private data and algorithms in Xt programs. Now +that XPA no longer is tied to X, it can be argued that we ought to +change the name (how about SPAM: simple public access mechanism +), but XPA is in wide-spread use in the astronomical community of +its birth, and the name has taken on a life of its own. If anyone can +think of what XPA now means, please let us know. + +

+If you think this is bad, consider the MMT Telescope on Mount Hopkins, +Arizona. When first installed twenty years ago, it featured an array +of six 72-inch diameter mirrors. from which came its name: the +Multiple Mirror Telescope. In spring of 1999, these mirrors +were replaced by a single 21 and 1/2 -foot diameter primary mirror, +the largest single-piece glass reflector on the North American +continent. And now MMT stands for ... MMT! + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + + diff --git a/doc/oom.html b/doc/oom.html new file mode 100644 index 0000000..360740e --- /dev/null +++ b/doc/oom.html @@ -0,0 +1,52 @@ + + + +Out of Memory + + + + +

Xpaoom: What happens when XPA runs out of memory?

+ + +

Summary

+

+When XPA can't allocate memory, it exits. You can arrange to have it call +longjmp() instead. + + +

Description

+

+When an XPA server or client cannot allocate memory, it will attempt to +output an error message and then exit. If this is not satisfactory (e.g., +perhaps your program is interactive and can recover from OOM errors), you +can tell XPA to call longjmp() to go to a recovery branch. To pass the +requisite jmp_buf variable to XPA, make the following call: +

+  XPASaveJmp(void *env);
+
+The value of env is the address of a jmp_buf variable that was previously +passed to setjmp(). For example: +
+  jmp_buf env;
+  ...
+  if( setjmp(jmp_buf) != 0 ){
+    /* out of memory -- take corrective action, if possible */
+  } else {
+    /* save env for XPA */
+    XPASaveJmp((void *)&jmp_buf);
+  }
+  // enter main loop ...
+
+ + + + + +

+Go to XPA Help Index + +

Last updated: April 7, 2009
+ + + diff --git a/doc/programs.html b/doc/programs.html new file mode 100644 index 0000000..b37031f --- /dev/null +++ b/doc/programs.html @@ -0,0 +1,274 @@ + + +XPA Programs + + +

XPA Programs

+ +

Summary

+ +

+Use the XPA programs to send/receive data to/from XPA servers from the +command line or from scripts. + +

+

+  <data> | xpaset  [-h] [-i nsinet] [-m method] [-n] [-p] [-s] [-t sval,lval] [-u users] [-v] <template> [paramlist]
+
+  xpaget  [-h] [-i nsinet] [-m method] [-s] [-t sval,lval] [-u users] <template> [paramlist]
+	
+  xpainfo [-h] [-i nsinet] [-m method] [-n] [-s] [-t sval,lval] [-u users] <template> [paramlist]
+
+  xpaaccess [-c] [-h] [-i nsinet] [-m method] [-n] [-u users] [-v|-V] <template> [type]
+
+ + + + +

xpaset: send data to one or more XPA servers

+ + + +
+<data> | xpaset  [-h] [-i nsinet] [-m method] [-n] [-p] [-s] [-t sval,lval] [-u users] [-v] <template|host:port> [paramlist]
+
+
+ + +

+

+  -h		print help message
+  -i		access XPA point on different machine (override XPA_NSINET)
+  -m		override XPA_METHOD environment variable
+  -n		don't wait for the status message after server completes
+  -p		don't read (or send) buf data from stdin
+  -s		enter server mode
+  -t [s,l]	set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT)
+  -u [users]	XPA points can be from specified users (override XPA_NSUSERS)
+  -v		verify message to stdout
+  --version     display version and exit
+
+ + +

+Data read from stdin will be sent to access points matching the +template +or host:port. +A set of qualifying parameters can be appended. +

+Normally, xpaset reads data input from stdin until EOF and sends those +data to the XPA target, along with parameters entered on the command +line. For example to send a FITS file to the ds9 image display: +

+  cat foo.fits | xpaset ds9 fits
+
+

+Sometimes, however, it is desirable to send only parameters to an XPA +access point, without sending data. For such cases, use the -p switch to +indicate that there is no data being send to stdin. For example, to +change the colormap used by the ds9 image display program, use: +

+  csh> xpaset -p ds9 cmap Heat
+
+Of course, this also can be accomplished by sending EOF to stdin in +any of the usual ways: +
+  csh> echo "" | xpaset ds9 cmap Heat
+  csh> xpaget ds9 cmap Heat < /dev/null
+  csh> xpaset ds9 cmap Heat
+  ^D			# Ctl-D signals EOF
+
+

+The -s switch puts xpaset into server mode, in which commands and data +can be sent to access points without having to run xpaset multiple times. +(Its not clear if this buys you much!) The syntax for sending commands +in server mode is: +

+

+  csh> xpaset -s
+  xpaset ds9 colormap I8
+  ^D
+  xpaset ds9 regions
+  circle 200 300 40
+  circle 300 400 50
+  ^D
+etc.
+
+After the required "xpaset" command is specified, optional ASCII data +can be appended (as in the region example). A single data/command set is +delimited by ^D. Note that typing ^D when a command is expected terminates +the program. +

+NB: server mode only works from the terminal and only ASCII data can be +sent in this way. +

+Examples: +

+  csh> xpaset ds9 file < foo.fits
+  csh> echo "stop" | xpaset myhost:12345
+
+ + + + +

xpaget: retrieve data from one or more XPA servers

+ + + +
+xpaget [-h] [-i nsinet] [-m method] [-s] [-t sval,lval] [-u users] <template|host:port> [paramlist]
+
+
+ + +

+

+  -h		print help message
+  -i		access XPA point on different machine (override XPA_NSINET)
+  -m		override XPA_METHOD environment variable
+  -n		don't wait for the status message after server completes
+  -s		enter server mode
+  -t [s,l]	set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT)
+  -u [users]	XPA points can be from specified users (override XPA_NSUSERS)
+  --version     display version and exit
+
+ + +

+Data will be retrieved from access points matching the +template +or host:port. +A set of qualifying parameters can be appended. +

+Examples: +

+  csh> xpaget ds9 images
+  csh> xpaget myhost.harvard.edu:12345
+
+ + + + +

xpainfo: send short message to one or more XPA servers

+ + + +
+xpainfo [-h] [-i nsinet] [-m method] [-n] [-s] [-t sval,lval] [-u users] <template|host:port> [paramlist]
+
+
+ + +

+

+  -h		print help message
+  -i		access XPA point on different machine (override XPA_NSINET)
+  -m		override XPA_METHOD environment variable
+  -n		don't wait for the status message after server completes
+  -s		enter server mode
+  -t [s,l]	set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT)
+  -u [users]	XPA points can be from specified users (override XPA_NSUSERS)
+  --version     display version and exit
+
+ + +

+Info will be sent to access points matching the +template +or host:port. +A set of qualifying parameters can be appended. +

+Examples: +

+  csh> xpainfo IMAGE ds9 image
+
+ + + + +

xpaaccess: see if template matches registered XPA access points

+ + + +
+xpaaccess [-c] [-h] [-i nsinet] [-m method] [-n] [-t sval,lval] [-u users] -v <template> [type]
+
+
+ + +

+

+  -c		contact each access point individually
+  -h		print help message
+  -i		access XPA point on different machine (override XPA_NSINET)
+  -m		override XPA_METHOD environment variable
+  -n		return number of matches instead of "yes" or "no"
+  -t [s,l]	set short and long timeouts (override XPA_[SHORT,LONG]_TIMEOUT)
+  -u [users]	XPA points can be from specified users (override XPA_NSUSERS)
+  -v		print info about each successful access point
+  -V		print info or error about each access point
+  --version     display version and exit
+
+ + +

+xpaaccess returns "yes" to stdout (with a return error code if 1) if there are +existing XPA access points that match the +template +(and optional access type: g,i,s). Otherwise, it returns "no" (with a +return error code of 0). If -n is specified, the number of matches is +returned instead (both to stdout and in the returned error code). If +-v is specified, each access point is displayed to stdout instead of +the number of matches. + +

+By default, xpaaccess simply contacts the xpans name server to find +the list of registered access points that match the specified +template. It also checks to make sure the specified types are +supported by that access point. This is the fastest way to determine +available access points. However, an access point might registered but +not yet available, if, for example, the server program has not entered +its event loop to process XPA requests. To find access points that are +guaranteed to be available for processing, use the -c (contact) +switch. With this switch, xpaaccess contacts each matching XPA server +(rather than the name server) to make sure the registered access point +really is ready for processing. In this mode, if an access point is +registered but not available, xpaaccess will pause for a period of +time equal to the XPA_LONG_TIMEOUT, in order to give the server a +chance to ready itself. By default, this timeout is 30 seconds. You +can shorten the time of delay using the -t "short,long" switch. For +example, to shorten the delay time to 2 seconds, use: +

+  xpaaccess -c -t "2,2" ds9
+
+The first argument is the short delay value, and is ignored in this +operation. The second is the long delay timeout. + +

+Note also that the default xpaaccess method (no -c switch) does not +check access control (acls) but rather only checks whether the access +point is both registered with the xpans name server and provides the +specified type of access. In other words, the default xpaaccess could +return 'yes' when you might not actually have access. This mode also +always returns 'yes' for the xpans name server itself, regardless of +whether the name server is active. The -c (contact) switch, which +contacts the access point directly, can and does check the access +control (only for servers using version 2.1 and above) and also +returns the real status of xpans. + + + + + + + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/server.html b/doc/server.html new file mode 100644 index 0000000..2e10b11 --- /dev/null +++ b/doc/server.html @@ -0,0 +1,833 @@ + + + +XPA Server API + + + + +

XPAServer: The XPA Server-side Programming Interface

+ + +

Summary

+A description of the XPA server-side programming interface. + + +

Introduction to XPA Server Programming

+

+Creating an XPA server is easy: you generally only need to call the +XPANew() subroutine to define a named XPA access point and set up the +send and receive callback routines. You then enter an event loop such +as XPAMainLoop() to field XPA requests. +

+  #include <xpa.h>
+
+  XPA XPANew(char *class, char *name, char *help,
+      int (*send_callback)(), void *send_data, char *send_mode,
+      int (*rec_callback)(),  void *rec_data,  char *rec_mode);
+
+  XPA XPACmdNew(char *class, char *name);
+
+  XPACmd XPACmdAdd(XPA xpa,
+         char *name, char *help,
+         int (*send_callback)(), void *send_data, char *send_mode,
+         int (*rec_callback)(),  void *rec_data,  char *rec_mode);
+
+  void XPACmdDel(XPA xpa, XPACmd cmd);
+
+  XPA XPAInfoNew(char *class, char *name,
+      int (*info_callback)(), void *info_data, char *info_mode);
+
+  int XPAFree(XPA xpa);
+
+  void XPAMainLoop(void);
+
+  int XPAPoll(int msec, int maxreq);
+
+  void XPAAtExit(void);
+
+  void XPACleanup(void);
+
+
+ +

Introduction

+ +To use the XPA application programming interface, a software developer +generally will include the xpa.h definitions file: +
+  #include <xpa.h>
+
+in the software module that defines or accesses an XPA access point, and +then will link against the libxpa.a library: +
+  gcc -o foo foo.c libxpa.a
+
+XPA has been compiled using both C and C++ compilers. + +

+A server program generally defines an XPA access point by calling the +XPANew() routine and specifies "send" and/or "receive" callback +procedures to be executed by the program when an external process +either sends data or commands to this access point or requests data or +information from this access point. A program also can define several +sub-commands for a single access point by calling XPACmdNew() and +XPACmdAdd() instead. Having defined one or more public access points +in this way, an XPA server program enters its usual event loop (or +uses the standard XPA event loop). + + + + +

XPANew: create a new XPA access point

+ + + +
+  #include <xpa.h>
+
+  XPA XPANew(char *class, char *name, char *help,
+	     int (*send_callback)(),
+	     void *send_data, char *send_mode,
+	     int (*rec_callback)(),
+	     void *rec_data,  char *rec_mode);
+
+
+ + +

+Create a new XPA public access point with the class:name +identifier template +and enter this access point into the XPA name server, so that it +can be accessed by external processes. XPANew() returns an XPA struct. +Note that the length of the class and name designations must be less +than or equal to 1024 characters each. + +

+The XPA name server daemon, xpans, will be started automatically if it +is not running already (assuming it can be found in the path). The +program's ip address and listening port are specified by the +environment variable XPA_NSINET, which takes the form :. If +no such environment variable exists, then xpans is started on the +current machine listening on port 14285. It also uses 14286 as a +known port for its public access point (so that routines do not have +to go to the name server to find the name server ip and port!) +As of XPA 2.1.1, version information is exchanged between the xpans +process and the new access point. If the access point uses an XPA +major/minor version newer than xpans, a warning is issued by both processes, +since mixing of new servers and old xpa programs (xpaset, xpaget, +xpans, etc.) is not likely to work. You can turn off the warning +message by setting the XPA_VERSIONCHECK environment variable to "false". + +

+The help string is meant to be returned by a request from xpaget: +

+  xpaget class:name -help
+
+

+A send_callback and/or a receive_callback can be specified; at +least one of them must be specified. + +

+A send_callback can be specified that will be executed in response to +an external request from the xpaget program, the XPAGet() routine, or +XPAGetFd() routine. This callback is used to send data to the +requesting client. + +

+The calling sequence for send_callback() is: +

+  int send_callback(void *send_data, void *call_data,
+    char *paramlist, char **buf, size_t *len)
+  {
+    XPA xpa = (XPA)call_data;
+    ...
+    return(stat);
+  }
+
+

+The send_mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  acl		true/false	true		enable access control
+  freebuf	true/false	true		free buf after callback completes
+
+

+The call_data should be recast to the XPA struct as shown. In +addition, client-specific data can be passed to the callback in +send_data. + +

+The paramlist will be supplied by the client as qualifying parameters +for the callback. There are two ways in which the send_callback() +routine can send data back to the client: + +

+1. The send_callback() routine can fill in a buffer and pass back a +pointer to this buffer. An integer len also is returned to specify the +number of bytes of data in buf. XPA will send this buffer to the +client after the callback is complete. + +

+2. The send_callback can send data directly to the client by writing +to the fd pointed by the macro: +

+  xpa_datafd(xpa)
+
+

+Note that this fd is of the kind returned by socket() or open(). + +

+If a buf has been allocated by a standard malloc routine, filled, and +returned to XPA, then freebuf generally is set so that the buffer will +be freed automatically when the callback is completed and data has +been sent to the client. If a static buf is returned, freebuf should +be set to false to avoid a system error when freeing static storage. +Note that default value for freebuf implies that the callback will +allocate a buffer rather than use static storage. + +

+On the other hand, if buf is dynamically allocated using a method +other than a standard malloc/calloc/realloc routine (e.g. using Perl's +memory allocation and garbage collection scheme), then it is necessary +to tell XPA how to free the allocated buffer. To do this, use the +XPASetFree() routine within your callback: +

+  void XPASetFree(XPA xpa, void (*myfree)(void *), void *myfree_ptr);
+
+The first argument is the usual XPA handle. The second argument is the +special routine to call to free your allocated memory. The third +argument is an optional pointer. If not NULL, the specified free +routine is called with that pointer as its sole argument. If NULL, the +free routine is called with the standard buf pointer as its sole +argument. This is useful in cases where there is a mapping between the +buffer pointer and the actual allocated memory location, and the +special routine is expecting to be passed the former. + +

+If, while the callback performs its processing, an error occurs that +should be communicated to the client, then the routine XPAError should be +called: +

+  XPAError(XPA xpa, char *s);
+
+

+where s is an arbitrary error message. The returned error message +string will be of the form: +

+  XPA$ERROR   [error] (class:name ip:port)
+
+

+If the callback wants to send a specific acknowledgment message back +to the client, the routine XPAMessage can be called: +

+  XPAMessage(XPA xpa, char *s);
+
+

+where s is an arbitrary error message. The returned error message +string will be of the form: +

+  XPA$MESSAGE [message] (class:name ip:port)
+
+

+Otherwise, a standard acknowledgment is sent back to the client +after the callback is completed. + +

+The callback routine should return 0 if no error occurs, or -1 to +signal an error. + +

+A receive_callback can be specified that will be executed in response +to an external request from the xpaset program, or the XPASet (or +XPASetFd()) routine. This callback is used to process data received +from an external process. + +

+The calling sequence for receive_callback is: +

+  int receive_callback(void *receive_data, void *call_data,
+    char *paramlist, char *buf, size_t len)
+  {
+    XPA xpa = (XPA)call_data;
+    ...
+    return(stat);
+  }
+
+

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  acl		true/false	true		enable access control
+  buf		true/false	true		server expects data bytes from client
+  fillbuf	true/false	true		read data into buf before executing callback
+  freebuf	true/false	true		free buf after callback completes
+
+

+The call_data should be recast to the XPA struct as shown. In +addition, client-specific data can be passed to the callback in +receive_data. + +

+The paramlist will be supplied by the client. In addition, if the +receive_mode keywords buf and fillbuf are true, then on entry into the +receive_callback() routine, buf will contain the data sent by the +client. If buf is true but fillbuf is false, it becomes the callback's +responsibility to retrieve the data from the client, using the data fd +pointed to by the macro xpa_datafd(xpa). If freebuf is true, then buf +will be freed when the callback is complete. + +

+If, while the callback is performing its processing, an error occurs +that should be communicated to the client, then the routine XPAError +can be called: +

+  XPAError(XPA xpa, char *s);
+
+

+where s is an arbitrary error message. + +

+The callback routine should return 0 if no error occurs, or -1 to +signal an error. + + + + +

XPACmdNew: create a new XPA public access point for commands

+ + + +
+  #include <xpa.h>
+
+  XPA XPACmdNew(char *class, char *name);
+
+
+ + +

+Create a new XPA public access point for commands that will share a +common identifier class:name. Enter this access point into the XPA +name server, so that it can be accessed by external processes. +XPACmdNew() returns an XPA struct. + +

+It often is more convenient to have one public access point that can +manage a number of commands, rather than having individual access +points for each command. For example, it is easier to command the +ds9 image display using: +

+  echo "colormap I8"   | xpaset ds9
+  echo "scale log"     | xpaset ds9
+  echo "file foo.fits" | xpaset ds9
+
+

+then to use: +

+  echo "I8"       | xpaset ds9_colormap
+  echo "log"      | xpaset ds9_scale
+  echo "foo.fits" | xpaset ds9_file
+
+

+In the first case, the commands remain the same regardless of the +target XPA name. In the second case, the command names must change +for each instance of ds9. That is, if a second instance of ds9 +called DS9 were running, it would be commanded either as: +

+  echo "colormap I8"   | xpaset DS9
+  echo "scale log"     | xpaset DS9
+  echo "file foo.fits" | xpaset DS9
+
+

+or as: +

+  echo "I8"       | xpaset DS9_colormap
+  echo "log"      | xpaset DS9_scale
+  echo "foo.fits" | xpaset DS9_file
+
+

+Thus, in cases where a program is going to manage many commands, it +generally is easier to define them as commands associated with the +XPACmdNew() routine, rather than as separate access points using +XPANew(). + +

+When XPACmdNew() is called, only the class:name identifier is +specified. Each sub-command is subsequently defined using the +XPACmdAdd() routine. + + + + +

XPACmdAdd: add a command to an XPA command public access point

+ + + +
+  #include <xpa.h>
+
+  XPACmd XPACmdAdd(XPA xpa, char *name, char *help,
+	           int (*send_callback)(),
+		   void *send_data, char *send_mode,
+         	   int (*rec_callback)(),
+		   void *rec_data,  char *rec_mode);
+
+
+ + +

+Add a command to an XPA command access point. The XPA argument specifies the +XPA struct returned by a call to XPANewCmd(). The name argument is the +name of the command. The other arguments function identically to the +arguments in the XPANew() command, i.e., the send_callback and rec_callback +routines have identical calling sequences to their XPANew() counterparts, +with the exceptions noted below. + +

+When help is requested for a command access point using: +

+  xpaget -h class:name
+
+

+all of the command help strings are listed. To get help for a given +command, use: +

+  xpaget -h class:name cmd
+
+

+Also, the acl keyword in the send_mode and receive_mode strings is +global to the access point, not local to the command. Thus, the value +for the acl mode should be the same in all send_mode (or receive_mode) +strings for each command in a command access point. (The acl for +send_mode need not be the same as the acl for receive_mode, though). + + + + +

XPACmdDel: remove a command from an XPA command public access point

+ + + +
+  #include <xpa.h>
+
+  void XPACmdDel(XPA xpa, XPACmd cmd);
+
+
+ + +

+This routine removes a command from the list of available commands in +a given XPA. That command will no longer be available for processing. + + + + +

XPAInfoNew: define an XPA info public access point

+ + + +
+  #include <xpa.h>
+
+  XPA XPAInfoNew(char *class, char *name,
+	         int (*info_callback)(),
+		 void *info_data, char *info_mode);
+
+
+ + +

+[NB: this is an experimental interface, new to XPA 2.0, whose value +and best use is evolving.] + +

+A program can register interest in receiving a short message about a +particular topic from any other process that cares to send such a +message. Neither has to be an XPA server. For example, if a user +starts to work with a new image file called new.fits, she might +wish to alert interested programs about this new file by sending a +short message using xpainfo: +

+  xpainfo IMAGEFILE /data/new.fits
+
+ +

+In this example, each process that has used the XPAInfoNew() call to +register interest in messages associated with the identifier IMAGEFILE +will have its info_callback() executed with the following calling +sequence: +

+  int info_cb(void *info_data, void *call_data, char *paramlist)
+  {
+    XPA xpa = (XPA)call_data;
+  }
+
+

+The arguments passed to this routine are equivalent to those sent in +the send_callback() routine. The main difference is that there is no +buf sent to the info callback: this mechanism is meant for short +announcement of messages of interest to many clients. + +

+The mode string is of the form: "key1=value1,key2=value2,..." +The following keywords are recognized: +

+  key   	value		default		explanation
+  ------	--------	--------	-----------
+  acl		true/false	true		enable access control
+
+

+Because no buf is passed to this callback, the usual buf-related keywords +are not applicable here. + +

+The information sent in the parameter list is arbitrary. However, we +envision sending information such as file names or XPA access points +from which to collect more data. Note that the xpainfo program and +the XPAInfo() routine that cause the info_callback to execute do not +wait for the callback to complete before returning. + + + + +

XPAFree: remove an XPA public access point

+ + +
+
+  #include <xpa.h>
+
+  int XPAFree(XPA xpa);
+
+
+ + +

+Remove the specified XPA public access point from the name server and +free all associated storage. Note that removal from the name server +happens automatically when the process terminates, so this call is not +generally needed. It is used when public access points are being +defined temporarily and then destroyed when no longer needed. For +example, ds9 temporarily creates a public access point when it +loads a new image for display and destroys it when the image is +unloaded. + + + + +

XPAMainLoop: optional main loop for XPA

+ + + +
+  #include <xpa.h>
+
+  void XPAMainLoop();
+
+
+ + +

+Once XPA access points have been defined, a program must enter an +event loop to watch for requests from external programs. This can be +done in a variety of ways, depending on whether the event loop is +processing events other than XPA events. In cases where there are no +non-XPA events to be processed, the program can simply call the +XPAMainLoop() event loop. This loop is implemented essentially as +follows (error checking is simplified in this example): +

+  FD_ZERO(&readfds);
+  while( XPAAddSelect(NULL, &readfds) ){
+    if( sgot = select(swidth, &readfds, NULL, NULL, NULL) >0 )
+      XPAProcessSelect(&readfds, 0);
+    else
+      break;
+    FD_ZERO(&readfds);
+  }
+
+

+The XPAAddSelect() routine sets up the select() readfds variable so +that select() will wait for I/O on all the active XPA channels. It +returns the number of XPAs that are active; the loop will end when +there are no active XPAs. The standard select() routine is called to +wait for an external I/O request. Since no timeout struct is passed +in argument 5, the select() call hangs until there is an external +request. When an external I/O request is made, the XPAProcessSelect() +routine is executed to process the pending requests. In this routine, +the maxreq value determines how many requests will be processed: if +maxreq <=0, then all currently pending requests will be processed. +Otherwise, up to maxreq requests will be processed. (The most usual +values for maxreq is 0 to process all requests.) + +

+If a program has its own Unix select() loop, then XPA access points can +be added to it by using a variation of the standard XPAMainLoop: +

+  XPAAddSelect(xpa, &readfds);
+  [app-specific ...]
+  if( select(width, &readfds, ...) ){
+    XPAProcessSelect(&readfds, maxreq);
+    [app-specific ...]
+    FD_ZERO(&readfds);
+  }
+
+

+XPAAddSelect() is called before select() to add the access points. +If the first argument is NULL, then all active XPA access points +are added. Otherwise only the specified access point is added. +After select() is called, the XPAProcessSelect() routine can be called +to process XPA requests. Once again, the maxreq value determines how +many requests will be processed: if maxreq <=0, then all currently +pending requests will be processed. Otherwise, up to maxreq requests +will be processed. + +

+XPA access points can be added to +Xt event loops (using XtAppMainLoop()) +and +Tcl/Tk event loops (using vwait and the Tk loop). +When using XPA with these event loops, you only need to call: +

+int XPAXtAddInput(XtAppContext app, XPA xpa)
+
+or +
+  int XPATclAddInput(XPA xpa)
+
+respectively before entering the loop. + + + + +

XPAPoll: execute existing XPA requests

+ + + +
+  #include <xpa.h>
+
+  int XPAPoll(int msec, int maxreq);
+
+
+ + +

+It is sometimes desirable to implement a polling loop, i.e., where one +checks for and processes XPA requests without blocking. For this +situation, use the XPAPoll() routine: +

+  XPAPoll(int msec, int maxreq);
+
+

+The XPAPoll() routine will perform XPAAddSelect() and select(), but with a +timeout specified in millisecs by the msec argument. If one or more +XPA requests are made before the timeout expires, the XPAProcessSelect() +routine is called to process those requests. The maxreq value determines +how many requests will be processed: if maxreq < 0, then no events are +processed, but instead, the return value indicates the number of events +that are pending. If maxreq == 0, then all currently pending requests +will be processed. Otherwise, up to maxreq requests will be processed. +(The most usual values for maxreq are 0 to process all requests and 1 +to process one request). + + + + +

XPAAtExit: install exit handler

+ + +
+
+  #include <xpa.h>
+
+  void XPAAtExit(void);
+
+
+ + +

+XPAAtExit() will install an exit handler using atexit() to run XPAFree on all +XPA access points. This might be useful in cases where Unix sockets are being +used: if an explicit call to XPAFree() is not made by the program, the Unix +socket file will not be deleted immediately without an atexit handler. (NB: this +call should not be made in a Tcl/Tk application. Accessing the Tcl native file +system after Tcl has shut down all file systems causes the Tcl/Tl program to +crash). + + + + +

XPACleanup: release reserved XPA memory

+ + +
+
+  #include <xpa.h>
+
+  void XPACleanup(void);
+
+
+ + +

+When XPA is initialized, it allocates a small amount of memory for the +access control list, temp directory path, and reserved commands. This +memory is found by valgrind to be "still reachable", meaning that "your +program didn't free some memory it could have". Calling the +XPACleanup() routine before exiting the program will free this memory +and make valgrind happy. + + + + +

XPA Server Callback Macros

+ + + +
+  #include <xpa.h>
+
+  xpa_class, xpa_name, xpa_method, xpa_cmdfd, xpa_datafd,
+  xpa_sendian, xpa_cendian
+
+
+ + +

+Server routines have access to information about the XPA being called via +the following macros (each of which takes the xpa handle as an argument): +

+  macro		 	explanation
+  ------		-----------
+  xpa_class		class of this xpa
+  xpa_name		name of this xpa
+  xpa_method		method string (inet or local connect info)
+  xpa_cmdfd		fd of command socket
+  xpa_datafd		fd of data socket
+  xpa_sendian		endian-ness of server ("little" or "big")
+  xpa_cendian		endian-ness of client ("little" or "big"
+
+

+The argument to these macros is the call_data pointer that is passed +to the server procedure. This pointer should be type case to XPA +in the server routine: +

+  XPA xpa = (XPA)call_data;
+
+ +

+The most important of these macros is xpa_datafd(). A server routine +that sets "fillbuf=false" in receive_mode or send_mode can use this +macro to perform I/O directly to/from the client, rather than using +buf. + +

+The xpa_cendian and xpa_sendian macros can be used together to determine +if the data transferred from the client is byte swapped with respect +to the server. Values for these macros are: "little", "big", or "?". +In order to do a proper conversion, you still need to know the format +of the data (i.e., byte swapping is dependent on the size of the data +element being converted). + + + + +

XPA Race Conditions

+ + +Potential XPA race conditions and how to avoid them. + + +

+Currently, there is only one known circumstance in which XPA can get +(temporarily) deadlocked in a race condition: if two or more XPA +servers send messages to one another using an XPA client routine such +as XPASet(), they can deadlock while each waits for the other server +to respond. (This can happen if the servers call XPAPoll() with a +time limit, and send messages in between the polling call.) The +reason this happens is that both client routines send a string to the +other server to establish the handshake and then wait for the server +response. Since each client is waiting for a response, neither is able +to enter its event-handling loop and respond to the other's +request. This deadlock will continue until one of the timeout periods +expire, at which point an error condition will be triggered and the +timed-out server will return to its event loop. + +

+Starting with version 2.1.6, this rare race condition can be +avoided by setting the XPA_IOCALLSXPA environment variable for servers +that will make client calls. Setting this variable causes all XPA +socket IO calls to process outstanding XPA requests whenever the +primary socket is not ready for IO. This means that a server making a +client call will (recursively) process incoming server requests while +waiting for client completion. It also means that a server callback +routine can handle incoming XPA messages if it makes its own XPA call. +The semi-public routine oldvalue=XPAIOCallsXPA(newvalue) can be used +to turn this behavior off and on temporarily. Passing a 0 will turn +off IO processing, 1 will turn it back on. The old value is returned +by the call. + +

+By default, the XPA_IOCALLSXPA option is turned off, because we judge +that the added code complication and overhead involved will not be +justified by the amount of its use. Moreover, processing XPA requests +within socket IO can lead to non-intuitive results, since incoming +server requests will not necessarily be processed to completion in the +order in which they are received. + +

+Aside from setting XPA_IOCALLSXPA, the simplest way to avoid this race +condition is to multi-process: when you want to send a client message, +simply start a separate process to call the client routine, so that +the server is not stopped. It probably is fastest and easiest to use +fork() and then have the child call the client routine and exit. But +you also can use either the system() or popen() routine to start one +of the command line programs and do the same thing. Alternatively, you +can use XPA's internal launch() routine instead of system(). Based on +fork() and exec(), this routine is more secure than system() because +it does not call /bin/sh. + +

+Starting with version 2.1.5, you also can send an XPAInfo() message with +the mode string "ack=false". This will cause the client to send a message +to the server and then exit without waiting for any return message from +the server. This UDP-like behavior will avoid the server deadlock when +sending short XPAInfo messages. + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/sman/xpa4.index b/doc/sman/xpa4.index new file mode 100644 index 0000000..7c5a98a Binary files /dev/null and b/doc/sman/xpa4.index differ diff --git a/doc/sman/xpa4.index.prop b/doc/sman/xpa4.index.prop new file mode 100644 index 0000000..0d0dd69 Binary files /dev/null and b/doc/sman/xpa4.index.prop differ diff --git a/doc/sman/xpa4.index.version b/doc/sman/xpa4.index.version new file mode 100644 index 0000000..accb620 --- /dev/null +++ b/doc/sman/xpa4.index.version @@ -0,0 +1,2 @@ +SMAN_DATA_VERSION 1.2 +VERSION 1.01 diff --git a/doc/sman/xpa8.index b/doc/sman/xpa8.index new file mode 100644 index 0000000..e9f998c Binary files /dev/null and b/doc/sman/xpa8.index differ diff --git a/doc/sman/xpa8.index.prop b/doc/sman/xpa8.index.prop new file mode 100644 index 0000000..54b3108 Binary files /dev/null and b/doc/sman/xpa8.index.prop differ diff --git a/doc/sman/xpa8.index.version b/doc/sman/xpa8.index.version new file mode 100644 index 0000000..accb620 --- /dev/null +++ b/doc/sman/xpa8.index.version @@ -0,0 +1,2 @@ +SMAN_DATA_VERSION 1.2 +VERSION 1.01 diff --git a/doc/tcl.html b/doc/tcl.html new file mode 100644 index 0000000..8feb46a --- /dev/null +++ b/doc/tcl.html @@ -0,0 +1,249 @@ + + + +XPA/Tcl Interface + + + + +

XPATcl: the XPA Interface to the Tcl/Tk Environment

+ + +

Summary

+ +

+Tcl/Tk programs can act as XPA clients and/or servers using the Tcl +interface to XPA that is contained in the libtclxpa.so shared object. + +

Server Routines

+ +
+  set xpa [xpanew class name help sproc sdata smode rproc rdata rmode]
+  xpafree xpa
+  set xpa [xpanew class name help iproc idata imode]
+  set xpa [xpacmdnew class name]
+  xpacmdadd xpa name help sproc sdata smode rproc rdata rmode
+  xpacmddel xpa cmd
+  set val [xparec xpa option]
+    options: name, class, method, cmdfd, datafd, cmdchan, datachan
+  xpasetbuf xpa buf len
+  xpaerror xpa message
+  xpamessage xpa message
+
+ +

Client Routines

+ +
+  set xpa [xpaopen mode]
+  xpaclose xpa
+  set got [xpaget xpa template paramlist mode bufs lens names errs n]
+  set got [xpaget xpa template paramlist mode chans names errs n]
+  set got [xpaset xpa template paramlist mode buf len names errs n]
+  set got [xpasetfd xpa template paramlist mode chan names errs n]
+  set got [xpainfo xpa template paramlist mode names errs n]
+  # NB: 2.1 calling sequence change
+  # set got [xpaaccess template type] (2.0.5)
+  set got [xpaaccess xpa template paramlist mode names errs n]
+  set got [xpanslookup template type classes names methods]
+
+ + +

Description

+

+You can call XPANew(), XPACmdNew(), or XPAInfoNew() within a C +routine to add C-based XPA server callbacks to a TCL/Tk program that +uses a Tcl/Tk event loop (either vwait() or the Tk event loop); +Such a program does not need or want to use the XPA event loop. +Therefore, in order to add XPA access points to the Tcl/Tk loop, the +following routine should be called beforehand: +

+  int XPATclAddInput(XPA xpa);
+
+

+Normally, the xpa argument is NULL, meaning that all current XPA +access points are registered with the event loop. However, if a +single XPA access point is to be added (i.e., after the event loop is +started) then the handle of that XPA access point can be passed to +this routine. + +

+The significance of the XPA/TCL interface goes beyond the support for +using XPA inside C code. The interface allows you to write XPA +servers and to make calls to the XPA client interface within the Tcl +environment using the Tcl language directly. The XPA/Tcl +interface can be loaded using the following package command: +

+  package require tclxpa 2.0
+
+Alternatively, you can load the shared object (called libtclxpa.so ) directly: +
+  load .../libtclxpa.so tclxpa
+
+

+Once the tclxpa package is loaded, you can use Tcl versions of XPA +routines to define XPA servers or make client XPA calls. The +interface for these routines is designed to match the Unix XPA +interface as nearly as possible. Please refer to +XPA Servers +and +XPA Clients +for general information about these routines. + +

+The file test.tcl in the XPA source directory gives examples for using the +XPA/Tcl interface. + +

+The following notes describe the minor differences between the interfaces. + +

XPANew

+
+
+  set xpa [xpanew class name help sproc sdata smode rproc rdata rmode]
+
+
+

+rproc and sproc routines are routines. The calling sequence of the +rproc routine is identical to its C counterpart: +

+  proc rec_cb { xpa client_data paramlist buf len } { ... }
+
+

+The sproc routine, however is slightly different from its C counterpart +because of the difficulty of passing data back from the callback to C: +

+  proc sendcb { xpa client_data paramlist } { ... }
+
+

+Note that the C-based server's char **buf and int *len arguments are +missing from the Tcl callback. This is because we did not know how to +fill buf with data and pass it back to the C routines for communication +with the client. Instead, the Tcl server callback uses the following +routine to set buf and len: +

+  xpasetbuf xpa buf len
+
+where: +
+  arg   	explanation
+  ------	-----------
+  xpa		the first argument of the server callback
+  buf		the data to be returned to the client
+  len		data length in bytes, (if absent, use length of the buf object)
+
+

+When this routine is called, a copy of buf is saved for transmission to +the client. + +

+The fact that buf is duplicated means that TCL server writers might wish to +perform the I/O directly within the callback, rather than have XPA do it +automatically at the end of the routine. To do this, set: +

+  fillbuf=false
+
+

+in the xpanew smode and then perform I/O through the Tcl channel +obtained from: +

+  set dchan [xparec $xpa datachan]
+
+

+where: +

+  arg   	explanation
+  ------	-----------
+  xpa		the first argument of the server callback
+  datachan	literal string "datachan" that returns the data channel
+  len		data length in bytes, (if absent, use length of the buf object)
+
+

+ +NB: datachan and cmdchan are not available under Windows. It is +necessary to use the "raw" equivalents: datafd and cmdfd. + + +

+The same considerations apply to the rproc for receive servers: a copy +of the incoming data is generated to pass to the receive callback. This +copy again can be avoided by using "fillbuf=false" in the rmode and then +reading the incoming data from datachan. + +

+The send and receive callback routines can use the xpaerror and xpamessage +routines to send errors and messages back to the client. If you also +want tcl itself to field an error condition, use the standard return call: +

+  return ?-code c? ?-errorinfo i? ?-errorcode ec? string
+
+

+See the Tcl man page for more info. + +

XPARec

+

+The Tcl xparec procedure supplies server routines with access to information +that is available via macros in the C interface: +

+  set val [xparec xpa <option>]
+
+

+where option is: name, class, method, cmdfd, datafd, cmdchan, +datachan. Note that two additional identifiers, cmdchan and datachan, +have been added to to provide Tcl channels corresponding to datafd and +cmdfd. (These latter might still be retrieved in Tcl and passed back +to a C routines.) An additional option called "version" can be used to +determine the XPA version used to build the Tcl interface. Note that +the standard options require a valid XPA handle, but "version" does +not (since it simply reports the value of the XPA_VERSION definition +in the XPA source include file). + +

+ +NB: datachan and cmdchan are not available under Windows. It is +necessary to use the "raw" equivalents: datafd and cmdfd. + +

+  macro 	explanation
+  ------	-----------
+  class		class of this xpa
+  name		name of this xpa
+  method	method string (inet or local connect info)
+  cmdchan	Tcl channel of command socket
+  datachan	Tcl channel of data socket
+  cmdfd		fd of command socket
+  datafd	fd of data socket
+  sendian	endian-ness of server ("little" or "big")
+  cendian	endian-ness of client ("little" or "big"
+  version	XPA version used to build this code
+
+ +

+Under Windows, the Tcl event handler cannot automatically sense when an +XPA socket is ready for IO (i.e. Tcl_CreateFileHandler() is not available +under Windows). The Windows Tcl event handler therefore must be awakened +occasionally for check for XPA events. This is done using the standard +Tcl_SetMaxBlockTime() call. The time parameter is defined in tclloop.c +and is currently set to 1000 microseconds (1/1000 of a second). + +

+The version option can be used to differentiate between source code versions. +It was created to support legacy Tcl code that needs to maintain the 2.0.5 +calling sequence for xpaaccess. You can use a version test such as: +

+  if [catch { xparec "" version } version] {
+    puts "pre-2.1.0e"
+  } else {
+    puts [split $version .]
+  }
+
+
+
+
+
+
+

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/template.html b/doc/template.html new file mode 100644 index 0000000..6a9a0d0 --- /dev/null +++ b/doc/template.html @@ -0,0 +1,112 @@ + + + +Access Point Names and Templates + + + + +

XPATemplate: Access Point Names and Templates

+ +

Summary

+

+XPA access points are composed of two parts: a general class and a +specific name. Both parts accept template characters so that you +can send/retrieve data to/from multiple servers at one time. + + +

Description

+

+When XPA servers call +XPANew(), +or +XPACmdNew() +to define XPA access points, they specify a string identifier composed of a +class and a name. When clients communicate with XPA access points, +they specify which access points to communicate with using +an identifier of the form: +

+  class:name
+
+All registered XPA access points that match the specified identifier +will be available for communication (subject to access control rules, +etc.) + +

+As of XPA 2.1.5, the length of both the class and name designations are +limited to 1024 characters. + +

+The XPA class:name identifier actually is a template: it accepts wild +cards in its syntax, so a single specifier can match more than one XPA +access point. (Note that the class is optional and defaults to "*".) +The allowed syntax for clients to specify the class:name template is +of the form shown below. (Note that "*" is used to denote a generic +wild card, but other wild cards characters are supported, as described +below). +

+  template   	explanation
+  --------	-----------
+  class:name	exact match of class and name
+  name		match any class with this name
+  *:name	match any class with this name
+  class:*	match any name of this class
+  *:*		match any access point
+
+

+In general, the following wild-cards can be applied to class and name: +

+  wildcard	explanation
+  --------	-----------
+  ?		match any character, but there must be one
+  *		match anything, or nothing
+  [...]		match an inclusive set
+
+

+Although the class:name template normally is used to refer to XPA +access points, these also can be specified using their individual +socket identifiers. For inet sockets, the socket identifier is +ip:port, where ip can be the DNS-registered name, +the ASCII IP number (e.g. 123.45.67.890) or the hex IP number +(e.g. 838f3a60). For unix sockets, the identifier is the socket file +name. These socket identifiers are displayed as the fourth argument +in the xpans display of registered access points. For example, +consider the ds9 program started using inet sockets. The xpans name +server will register something like this: +

+  csh> xpaget xpans
+  DS9 ds9 gs saord.harvard.edu:3236 eric
+
+You can access ds9 using ip:3236 in any of the three forms: +
+  csh> xpaget saord:3236 file
+  /home/eric/data/snr.ev
+
+  csh> xpaget 123.45.67.890:3236 file
+  /home/eric/data/snr.ev
+
+  csh> xpaget 838f3a60:3236 file
+  /home/eric/data/snr.ev
+
+In the case of unix sockets, the socket identifier is a file: +
+  csh> xpaget xpans
+  DS9 ds9 gs /tmp/.xpa/DS9_ds9.2631 eric
+
+  csh> xpaget /tmp/.xpa/DS9_ds9.2631 file
+  /home/eric/data/snr.ev 
+
+This feature can be useful in distinguishing between multiple +instances of a program that all have the same class:name designation. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + + diff --git a/doc/users.html b/doc/users.html new file mode 100644 index 0000000..a849442 --- /dev/null +++ b/doc/users.html @@ -0,0 +1,67 @@ + + + +Distinguishing Users + + + + +

XPAUsers: Distinguishing Users

+ + +

Summary

+

+XPA normally distinguishes between users on a given host, but it is possible +to send data to access points belonging to other users. + + +

Description

+

+A single XPA name service typically serves all users on a given +machine. Two users can register the same XPA access points on the +same machine without conflict, because the user's username is +registered with each access point and, by default, programs such as +xpaget and xpaset only process access points of the appropriate user. +For example: +

+  XPA xpa1 gs 838e2f67:1262 eric
+  XPA xpa2 gs 838e2f67:1266 eric
+  XPA xpa1 gs 838e2f67:2523 john
+  XPA xpa2 gs 838e2f67:2527 john
+
+Here the users "eric" and "john" both have registered the access +points xpa1 and xpa2. When either "john" or "eric" retrieves +information from xpa1, they will process only the access point +registered in their user name. + +

+If you want to access another user's XPA access points on a single +machine, use the -u [user] option on xpaset, xpaget, etc. For example, +if eric executes: +

+  xpaget -u john xpa1
+
+he will access John's xpa1 access point.Use "*" to access all users +on a given machine: +
+  xpaget -u "*" xpa1
+
+Note that the XPA Environment Variable +XPA_NSUSERS can be used to specify the default list of users to +process: +
+  setenv XPA_NSUSERS "eric,john"
+
+will cause access points from both "eric" and "john" to be processed +by default. + + + + + +

+Go to XPA Help Index + +

Last updated: September 10, 2003
+ + diff --git a/doc/xpa.pdf b/doc/xpa.pdf new file mode 100644 index 0000000..e2c4855 Binary files /dev/null and b/doc/xpa.pdf differ diff --git a/doc/xpa.ps b/doc/xpa.ps new file mode 100644 index 0000000..21d4910 --- /dev/null +++ b/doc/xpa.ps @@ -0,0 +1,5294 @@ +%!PS +%%Title: The XPA Help Facility +%%Creator: html2ps version 1.0 beta5 +%%EndComments +save +2000 dict begin +/d {bind def} bind def +/D {def} d +/t true D +/f false D +/FL [/Times-Roman +/Times-Italic +/Times-Bold +/Times-BoldItalic +/Courier +/Courier-Oblique +/Courier-Bold +/Courier-BoldOblique +/Helvetica +/Helvetica-Oblique +/Helvetica-Bold +/Helvetica-BoldOblique] D +/WF t D +/WI 0 D +/F 1 D +/IW 471 F div D +/IL 621 F div D +/PS 791 D +/EF [0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 2 2] D +/EZ [11 9 19 17 15 13 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 8 8] D +/Ey [0 0 2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] D +/EG [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1] D +/Tm [1 1 0.8 0.8 0.8 0.8 0.8 0.8 0 0 0 0 0 0 0.5 1 1 1 1 0 0 1.3 0 0] D +/Bm [1 1 0.5 0.5 0.5 0.5 0.5 0.5 0 0 0 0 0 0 0.5 1 1 1 1 0 0 1 0 0] D +/Lm [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 2 0 0 2 0 0 0] D +/Rm [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0] D +/EU [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0] D +/NO t D +/YY [[{()}1][{()}0][{()}2]] D +/ZZ [[{()}1][{()}0][{()}2]] D +/Ts EZ 0 get D +/TU f D +/Xp t D +/AU t D +/SN 0 D +/Cf f D +/Tp f D +/Fe f D +/TI 1 Ts mul D +/Fm 14 D +/xL 71 D +/xR 71 D +/yL 706 D +/yR 706 D +/Wl 471 F div D +/Wr 471 F div D +/hL 621 F div D +/hR 621 F div D +/FE {newpath Fm neg Fm M CP BB IW Fm add Fm L IW Fm add IL Fm add neg L CP BB + Fm neg IL Fm add neg L closepath} D +/LA {PM 0 eq{/IW Wl D /IL hL D}{/IW Wr D /IL hR D}ie /W IW D /LL W D /LS W D + TU PM 0 eq and{IW 56 F div add SA{Sf div}if 0 translate} + {PM 0 eq{xL yL}{xR yR}ie translate F SA{Sf mul}if dup scale + CS CF FS Cf{CA CL get VC}if /Bb f D}ie 0 0 M + TF not Tc or {Cf{gsave SA{1 Sf div dup scale}if Cb VC FE fill grestore}if}if}D +/Pi 0 Ts mul D +/SG [0.8 1 1] D +/Ab 15 D +/J 0 D +/Tc t D +/NH 6 D +/Nf f D +/Pa f D +/LH 1.2 D +/XR f D +/Xr {/pN E D ( [p ) WB pN WB (] )WB} D +/Db [16#FF 16#FF 16#FF] D +/Dt [16#00 16#00 16#00] D +/eA f D +/Fi f D +/bT f D +/Lc t D +/Dl [16#00 16#00 16#00] D +/LX f D +/Br 0.25 D +/IA ([IMAGE]) D +/DS {/PF f D()WB NL NP()pop RC ZF} D +/Gb f D +/Mb t D +/Hc [16#00 16#00 16#00] D +/Bl 3 D +/MI -15.2 D +/DX (DRAFT) D +/Di 0 D +/Tt 113.385826771654 D +/Th {()2 Al()BR ( + ) 0 1 -1 H()4 FZ Ti ES()EH ( + ) 0 2 -1 H() ME 0 get join EH()Ea()BR()} D +/tH {()0 1 -1 H (Table of Contents) EH()} D +/FD 2 D +/Dy 2 D +/cD [16#F0 16#F0 16#F0] D +/FW 0.6 D +/FU [16#00 16#00 16#00] D +/ET {/RM f D /A0 0 D /PN SN D /OU t D /Ou t D /W IW D /LL W D D1 + Ms not TP and{Ip}if /TF f D} D +[{true statusdict/setduplexmode get exec} stopped cleartomark +%-- End of variable part -- +/MySymbol 10 dict dup begin + /FontType 3 D /FontMatrix [.001 0 0 .001 0 0 ] D /FontBBox [25 -10 600 600] D + /Encoding 256 array D 0 1 255{Encoding exch /.notdef put}for + Encoding (e) 0 get /euro put + /Metrics 2 dict D Metrics begin + /.notdef 0 D + /euro 651 D + end + /BBox 2 dict D BBox begin + /.notdef [0 0 0 0] D + /euro [25 -10 600 600] D + end + /CharacterDefs 2 dict D CharacterDefs begin + /.notdef {} D + /euro{newpath 114 600 moveto 631 600 lineto 464 200 lineto 573 200 lineto + 573 0 lineto -94 0 lineto 31 300 lineto -10 300 lineto closepath clip + 50 setlinewidth newpath 656 300 moveto 381 300 275 0 360 arc stroke + -19 350 moveto 600 0 rlineto -19 250 moveto 600 0 rlineto stroke}d + end + /BuildChar{0 begin + /char E D /fontdict E D /charname fontdict /Encoding get char get D + fontdict begin + Metrics charname get 0 BBox charname get aload pop setcachedevice + CharacterDefs charname get exec + end + end}D + /BuildChar load 0 3 dict put /UniqueID 1 D +end +definefont pop + +/Cd {aload length 2 idiv dup dict begin {D} repeat currentdict end} D +/EX {EC cvx exec} D +/DU {} d +/BB {pop pop}d +/ie {ifelse} d +/E {exch} d +/M {moveto} d +/R {rmoveto} d +/L {lineto} d +/RL {rlineto} d +/CP {currentpoint} d +/SW {stringwidth} d +/GI {getinterval} d +/PI {putinterval} d +/Sg {setgray} d +/LW {setlinewidth} d +/S {dup () ne OU and{0 Co R AT 3 eq LB and HF not and A1 0 ne A2 0 ne or and + {A2 0 32 A1 0 6 -1 roll awidthshow}{show}ie 0 Co neg R}{pop}ie + OU PH 3 eq or{/Ms t D}if} D +/U {OU{gsave CP currentfont /FontInfo get /UnderlinePosition get + 0 E currentfont /FontMatrix get dtransform E pop add newpath M dup SW pop + CJ 0 RL stroke grestore}if} D +/B {OU Br 0 gt and{CP Ts neg Ts .33 mul R gsave 0 Sg + CP newpath Ts Br mul 0 360 arc closepath UI 2 mod 0 eq{stroke}{fill}ie + grestore M CP E Ts Br 1 add mul sub E BB /Ms t D}if}D +/NP {Ms TP not or PA and OU and{TP{OR}if f1{mF k2 /mF E D /YC 0 D}if + TP TU not PM 0 eq or and{showpage}if DU Ip TE not{LA}if 0.6 LW + /CI 0 D /TP t D /Hs f D /hl 6 D /Hv 6 D /HI hi D /Ms f D}if Bs XO BO M} D +/Np {LE sub CP E pop gt PL 0 eq and{NP}if}D +/Ip {/PN PN 1 add D /Pn RM{1}{4}ie PN Ns D /PM PN SN sub 2 mod D} D +/GP {E dup 3 -1 roll get PN 1 add 2 mod get dup type /integertype eq + {get 0 get}{E pop}ie}d +/Fc {dup 2 GP exec SW pop /S1 E D dup 1 GP exec SW pop /S2 E D 0 GP exec SW + pop /S3 E D S1 0 gt{S2 2 mul S1 add S3 2 mul S1 add 2 copy lt{E}if pop}{0}ie + S2 S3 add 2 copy lt{E}if pop IW .9 mul div dup 1 gt{1 E div}{pop 1}ie}D +/OR {Df{Sd}if tp not{gsave SA{1 Sf div dup scale}if Fe{Cf{FU VC}if FW LW + 1 setlinejoin FE stroke}if /YO {60 F div dup 40 gt{pop 40}if}D /cs CS D + /cf CF D /CF 0 D /pf PF D /PF f D /Fn FN D /At AT D /AT 0 D /FN EF Hf 1 add + get D Fz Fs FS ZZ Fc Fz mul Fs FS EU Hf 1 add get dup type /arraytype eq + Cf and{VC}{pop 0 Sg}ie IW IL neg YO sub M ZZ 1 GP exec dup SW pop neg 0 R Sh + 0 IL neg YO sub M ZZ 0 GP exec Sh ZZ 2 GP exec dup SW pop IW E sub 2 div + IL neg YO sub M Sh Fz Fs FS NO{/AW IW Pn SW pop sub D AW 2 div IL neg YO sub + S1 0 gt S2 AW .45 mul gt or S3 AW .45 mul gt or{Fz 2 mul sub}if M Pn Sh}if + EU Hf get dup type /arraytype eq Cf and{VC}{pop 0 Sg}ie YY Fc /FN EF Hf get D + Hz mul HS FS IW YO M YY 1 GP exec dup SW pop neg 0 R Sh 0 YO M YY 0 GP exec Sh + YY 2 GP exec dup SW pop IW E sub 2 div YO M Sh /FN Fn D /AT At D t Pb XO SZ + SL get neg R /PF pf D grestore /CF 0 D cs cf FS}if}D +/Sh {dup () ne{CP Hz 4 div sub BB show CP CS add BB}{pop}ie}D +/Pb {/OU E D /Ou OU D /PB t D 0 0 M Ba{/Sa save D /BP t D /Fl t D RC /PL 0 D + /PH 0 D /W IW D /LE IL .7 mul D /EO 0 D SI ZF /YA 0 D /BO 0 D /C1 () D + BA 0 Ts neg R Bb{Xl Yl Xh Yh}if Bb CP Sa restore M + {/Yh E D /Xh E D /Yl E D /Xl E D}if /Fl t D}if + BL /OU t D /HM f D /Ou t D /PB f D} D +/Bs {/BP Ba not D}D +/reencodeISO { + dup dup findfont dup length dict begin{1 index /FID ne{D}{pop pop}ie}forall + /Encoding ISOLatin1Encoding D currentdict end definefont} D +/ISOLatin1Encoding [ +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright +/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash +/zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon +/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N +/O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright +/asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m +/n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef +/.notdef/space/exclamdown/cent/sterling/currency/yen/brokenbar +/section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot +/hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior +/acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine +/guillemotright/onequarter/onehalf/threequarters/questiondown +/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla +/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex +/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis +/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute +/Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis +/aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave +/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex +/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis +/yacute/thorn/ydieresis +] D +[128/backslash 129/parenleft 130/parenright 141/circumflex 142/tilde +143/perthousand 144/dagger 145/daggerdbl 146/Ydieresis 147/scaron 148/Scaron +149/oe 150/OE 151/guilsinglleft 152/guilsinglright 153/quotesinglbase +154/quotedblbase 155/quotedblleft 156/quotedblright 157/endash 158/emdash +159/trademark] +aload length 2 idiv 1 1 3 -1 roll{pop ISOLatin1Encoding 3 1 roll put}for +/colorimage where{pop}{ + /colorimage { + pop pop /Pr E D {/Cv Pr D /Gr Cv length 3 idiv string D 0 1 Gr length 1 sub + {Gr E dup /i E 3 mul D Cv i get 0.299 mul Cv i 1 add get 0.587 mul add + Cv i 2 add get 0.114 mul add cvi put}for Gr} image} D +}ie +/pdfmark where{pop}{userdict /pdfmark /cleartomark load put}ie +WF{FL{reencodeISO D}forall}{4 1 FL length 1 sub{FL E get reencodeISO D}for}ie +/Symbol dup dup findfont dup length dict begin + {1 index /FID ne{D}{pop pop}ie}forall /Encoding [Encoding aload pop] + dup 128 /therefore put D currentdict end definefont D + +/SF {/CS E D SZ SL CS put FO SL FN put /YI CS LH neg mul D dup ST cvs ( ) join + CS ST cvs join C1 E join ( NF ) join /C1 E D CS NF /Wf WF FN 0 gt or D + /BW Wf{( ) SW pop}{0}ie D}D +/NF {/cS E D /cF E D cF 0 ge{FL cF get}{cF -1 eq{/Symbol}{/MySymbol}ie}ie + findfont cS scalefont setfont} D +/FS {CF or /CF E D FR SL CF put CF CF 0 ge{FN 4 mul add}if E SF} D +/PC {SH /BP f D fin not GL not and{NL}if /HM t D /LL LS D} D +/BS {/TX E D Wf{/fin f D /CW 0 D /LK 0 D /SC 0 D + /RT TX D {RT ( ) search{/NW E D pop /RT E D /WH NW SW pop D CW WH add LL gt + {TX SC LK SC sub 1 sub NN GI GL{SH cF cS OC + 2 copy cS ne E cF ne or{NF}{pop pop}ie}{PC /CW WH BW add D}ie + /SC LK D} + {GL{JC}if + /CW CW WH add BW add D /HM t D}ie /GL f D /Ph f D + /LK LK NW length 1 add add D}{pop exit}ie}loop + /fin t D TX SC LK SC sub GI SH RT () ne{GL not{CC}if}if + /LC TX length D /WH RT SW pop D CW WH add Hy{HC SW pop add}if LL gt + {RT GL{SH cF cS OC 2 copy cS ne E cF ne or{NF}{pop pop}ie + Hy{/Ph t D}if /LL LS D}{NL /LL LS D SH}ie} + {RT PC Hy{CC}if /Ph Ph Hy or D}ie RT () ne{/GL t D /HM t D}if} + {TX SW pop LL le{TX SH}{/NW () D 0 2 TX length 1 sub + {/CW E D TX 0 CW GI dup SW pop LL gt{pop NW SH /HM t D NL/LL W XO sub MR sub D + /CW CW 2 sub NN D /TX TX CW TX length CW sub GI D TX BS exit} + {/NW E D}ie}for}ie}ie /HM t D}D +/CC {C0 length 0 gt{JC}if /C0 [C1 L1 YA YB Mf NS NB TB AF Bw] D + /C1 () D /L0 L1 D /YA 0 D /YB 0 D /Mf 0 D /NS 0 D /NB 0 D}D +/JC {C0 aload length 0 gt{pop pop pop NB add /NB E D NS add /NS E D + dup Mf gt{/Mf E D}{pop}ie dup YB gt{/YB E D}{pop}ie + dup YA gt{/YA E D}{pop}ie pop C1 join /C1 E D /C0 [] D}if}D +/OC {C0 length 0 gt{C1 L1 L0 sub YA YB Mf NS NB TB AF Bw GL C0 aload pop + /Bw E D /AF E D /TB E D /NB E D /NS E D /Mf E D /YB E D /YA E D /C0 [] D + /L1 E D /C1 E D Ph{HC SH}if NL /GL E D /Bw E D /AF E D /TB E D /NB E D /NS E D + /Mf E D /YB E D /YA E D /L1 E D /LL W L1 sub XO sub MR sub WH sub D /CW 0 D + C1 E join /C1 E D}if}D +/BT {/LB t D dup length string copy RS dup dup () ne E ( ) ne and + {/CI 0 D /LS LL D /LL W L1 sub XO sub MR sub D BS} + {dup ( ) eq{/GL f D}if dup () eq L1 0 eq or{pop}{SH /BP f D /Ph f D}ie}ie + /LB f D} D +/BL {CP E pop XO E M} D +/NL {JC /GL f D /SK W XO sub MR sub L1 sub TB{Bw add}if D + /YA LF{Mf HM Fl not and PF or{LH mul}if}{0 /LF t D}ie YA 2 copy lt{E}if pop D + C1 () ne{/FB YB Mf SA{Sf mul}if 4 div 2 copy lt{E}if pop D}if Fl{/Ya YA D}if + CP E pop YA sub YB sub LE neg lt Fl not and PB not and{NP}if NT TL BL + OU PF not and PB or{/RE L1 TB{Bw sub}if + W XO sub MR sub div YA YB add LE BO add div 2 copy lt{E}if pop D + RE 1 gt{BL 1 RE div dup scale}if}if + AT 2 le{SK AT mul 2 div YA neg R}if + AT 3 eq{0 YA neg R TB{/NB NB 1 sub D /NS NS 1 sub D}if /NB NB 1 sub NN D + /A3 NS 6 mul NB add D NS NB add 0 eq + {/A1 0 D /A2 0 D} + {NS 0 eq{/A1 SK NB div dup J gt{pop 0}if D /A2 0 D}{J A3 mul SK lt + {/A1 J D /A2 SK J NB mul sub NS div dup Ab gt{/A1 0 D pop 0}if D} + {/A1 SK A3 div D /A2 A1 6 mul D}ie}ie}ie /A1 A1 NN D /A2 A2 NN D}if + AT 4 eq{0 YA neg R PH 2 le{PD 0 lt{/PD L1 D}if PD M1 gt{/M1 PD D}if + L1 PD sub M2 gt{/M2 L1 PD sub D}if}{DV ID 1 sub get 0 ge{Lo 0 R}if}ie}if + F0 cF ne Cs cS ne or{F0 Cs NF}if + /ms Ms D /Ms f D CP FB sub + C1 cvx exec XO EO sub L1 add TB{BW sub}if dup LM gt{/LM E D}{pop}ie + PH 0 eq PH 4 eq or Ms and{HF not{/PO t D /AH t D}if + BB CP YA add E AT 3 eq LB and{A1 sub}if TB{BW sub}if E BB} + {pop pop}ie Ms HM PH 3 eq and or{/BP f D /Fl f D}if + /Lo 0 D /L1 0 D /F0 cF D /Cs cS D BP not{0 YB NN neg R}if + OU f1 and mF not and{k2 /f1 f D}if + OU PF not and PB or{RE 1 gt{RE dup scale}if}if /Ms ms Ms or D + /C1 AF{(Cp )}{()}ie D /YA 0 D /YB 0 D BL + AT 4 eq LB not and PH 3 ge and + {ID DV length lt{DV ID get dup 0 ge{DO E sub /Lo E D /L1 Lo D}{pop}ie + /ID ID 1 add D}if}if /T t D CD{/LN LN 1 add D PD}if + /PD -1 D /NS 0 D /NB 0 D /TB f D /Ph f D /Mf 0 D /HM f D} D +/RS {/TM E D /CN 0 D TM{10 eq{TM CN ( ) PI}if /CN CN 1 add D}forall + /CN 0 D /BK HM EN and{0}{1}ie D TM + {dup 32 ne{TM CN 3 2 roll put /CN CN 1 add D /BK 0 D} + {pop BK 0 eq{TM CN 32 put /CN CN 1 add D}if /BK 1 D}ie}forall + TM 0 CN GI dup dup () ne E ( ) ne and + {dup CN 1 sub get 32 eq{/EN f D}{/EN t D}ie}if} D +/join {2 copy length E length add string dup 4 2 roll 2 index 0 3 index + PI E length E PI}d +/WR {(\n) search{dup () ne BP not or + {Li 4 le CP E pop YI Li mul add LE add 0 lt and PL 0 eq and{NP}if + SH NL pop /Li Li 1 sub D WR}{pop pop WR}ie}{SH}ie /CI 0 D /BP f D} D +/SH {dup dup () ne E ( ) ne and PF or CS Mf gt and{/Mf CS D}if + T not Wf and{( ) E join /T t D}if dup BP{/MF CS D}if + AT 3 eq{2 copy length dup 0 gt{/NB E NB add D + {( ) search{/NS NS 1 add D pop pop}{pop exit}ie}loop}{pop pop}ie}if + CD PD 0 lt and{dup DC search{SW pop /PD E L1 add D pop pop}{pop}ie}if + 0 Np dup SW pop L1 add /L1 E D dup () ne + {C1 (\() join E join (\)) join AU AF and UF or Wf and{( U ) join}if + sF{( s ) join}if ( S ) join + /C1 E D dup length 1 sub get 32 eq /TB E D /Bw BW D}{pop pop}ie} D +/BG {AI LG BC add add 0 eq} D +/ON {OU{Ty AR AI NN get dup 1 add Ln Ns Ty 2 mod 0 eq{(. )}{(\) )}ie join + dup SW pop neg 0 R CP E 0 lt{0 E M}{pop}ie CP BB show /Ms t D}if} D +/Ln {AR AI 3 -1 roll put}D +/SP {dup CI lt BP not and{dup CI sub 0 E R /CI E D}{pop}ie} D +/BN {PF{WR /HM f D}{BT NL}ie} D +/NN {dup 0 lt{pop 0}if} D +/h {(h) HI ST cvs join cvx exec dup 1 get E Nf{0 get E join}{pop}ie} D +/H {/fn FN D /Hi E 1 add D 1 sub /HL E D /H2 HL 2 add D /GS EZ H2 get D + E Tm H2 get GS mul BE dup 0 gt{1 sub}{pop EG H2 get dup 0 lt{pop AT}if}ie NA + WW Np /SL SL 1 add D /FN EF H2 get D GS Ey H2 get FS + EU H2 get Sc Hs not HL Hl lt and Hs HL hl lt and or Hi 0 eq or + {/HI Hi D /Hs t D /hl HL D /Hv HL D}if HL Hl lt{/hi Hi D}if + Nf HI 0 gt and{(h) Hi ST cvs join cvx exec 0 get WB}if + /HF t D /AH f D /PO f D} D +/EH {Bm H2 get GS mul BE OA /SL SL 1 sub NN D /CF 0 D /FN fn D + SZ SL get FR SL get FS /HF f D /GS Ts D ()Ec} D +/P {E PF{WR}{PO{EP}{BN}ie Ts 4 mul Np AE not{Tm 0 get Ts mul neg SP}if + dup 0 ge AH and{Pi Pd}if}ie 1 sub dup 0 lt{pop AV AL get}if /AT E D /PO t D} D +/EP {PF{WR}{BN Ts 4 mul Np}ie AE not{Bm 0 get Ts mul neg SP}if + /AT AV AL get D /PO f D} D +/BE {E PO{EP}{BN}ie Ts 4 mul Np neg SP} D +/HR {/Aw W EO sub D /RW E dup 0 gt{Aw mul}{neg}ie dup Aw gt{pop Aw}if D /RZ E D + E BN Ts neg SP 1 sub 2 div Aw RW sub mul EO add CP E pop M PF{0 Ps neg R}if + 0 Np OU{gsave RZ LW Cf{Hc VC}{0 Sg}ie CP BB RW 0 RL CP BB stroke grestore}if + /CI 0 D /BP f D PF not{Ts neg SP}if /Ms t D} D +/AD {I NL EG 14 get dup 0 lt{pop AT}if NA /AE t D Tm 14 get Ts mul neg SP + Cf{EU 14 get dup -1 eq{pop CA CL get}if Sc}if} D +/DA {BN ()ES OA /AE f D ()Ec Bm 14 get Ts mul neg SP} D +/PR {/MW E D /Li E D Tm 1 get Ps mul BE 0 NA /FN Fp D /PF t D SI /SL SL 1 add D + /CF 0 D Ps CS mul Ts div MW WC mul CS mul Ts div dup LL gt PL 0 eq and + {LL div div}{pop}ie Ey 1 get FS CP E pop LE add YI neg div cvi dup Li lt + AH and{4 lt YI Li mul 5 mul LE add 0 gt or PL 0 eq and{NP}if}{pop}ie + EU 1 get Sc /GS Ps D}D +/RP {WR NL () /PF f D SI /FN 0 D ES Bm 1 get Ps mul neg SP OA /GS Ts D} D +/SI {/XO Lm 15 get BC NN mul Lm 16 get AI UI sub NN mul add + Lm 17 get UI NN mul add Lm 20 get LG NN mul add Ts mul + PF{Lm 1 get Ps mul add}if EO add D + /MR Rm 15 get BC NN mul Rm 16 get AI UI sub NN mul add + Rm 17 get UI NN mul add Rm 20 get LG NN mul add Ts mul + PF{Rm 1 get Ps mul add}if D /LL W XO sub MR sub D} D +/DT {/cC E D BN /LG LG 1 sub D SI /LG LG 1 add D WW 2 div Np BL} D +/DD {WB Cc 0 eq cC 0 eq and L1 0 eq or Lm 20 get Ts mul L1 sub TB{BW add}if + Ts 2 div lt or NL /LF E D SI BL /cC 0 D} D +/DL {Dc LG Cc put /Cc E D BG{Tm 18 get Ts mul BE}{BN}ie /LG LG 1 add D BL} D +/LD {BN LG 0 gt{/LG LG 1 sub D}if /Cc Dc LG get D SI + BG{()Bm 18 get Ts mul BE}if BL} D +/UL {BG{Tm 17 get Ts mul BE}{BN}ie NR AI NN 0 put /UI UI 1 add D + /AI AI 1 add D SI BL} D +/LU {BN /UI UI 1 sub D /AI AI 1 sub D SI BG{()Bm 17 get Ts mul BE}if BL} D +/OL {E BG{Tm 16 get Ts mul BE}{BN}ie TR AI NN Ty put /Ty E D NR AI NN 1 put + /AI AI 1 add D SI BL 1 Ln} D +/LO {BN /AI AI 1 sub D /Ty TR AI get D SI BG{()Bm 16 get Ts mul BE}if BL} D +/LI {E BN -1 SP /BP f D /CI 0 D 0 Np NR AI 1 sub NN get 1 eq + {dup dup 0 gt E 4 le and{/Ty E D}{pop}ie + /L1 L1 Ty AR AI NN get Ns SW pop XO sub dup 0 lt{pop 0}if add D ( ON )} + {pop ( B )}ie C1 E join /C1 E D CS Mf gt{/Mf CS D}if BL} D +/BQ {Tm 15 get Ts mul BE /BC BC 1 add D SI BL} D +/QB {Bm 15 get Ts mul BE /BC BC 1 sub D SI BL} D +/Al {E EP 1 sub dup 0 lt{pop AV AL get}if NA} D +/Ea {EP OA} D +/WB {PF{WR}{BT}ie} D +/F1 {WB /FN 0 D CS 0 FS} D +/F2 {WB /FN WI D CS 0 FS} D +/HY {/Hy t D WB /Hy f D} D +/YH {WB} D +/A {/LT E D LT 1 eq{/RN E D}if /Lh E D WB /C1 C1 ( Cp ) join D + Lc AF not and{Cl Sc}if /AF t D} D +/EA {Lc AF and{Ec}{WB}ie TL Pa AF and Lh 0 ne and + {( \() Lh join (\)) join /AF f D WB}if /AF f D} D +/TL {C1 ( Tl ) apa /C1 E D} d +/apa {AF OU and Lh 0 ne LT 1 eq or and{LT 1 eq{RN ( /) E ST cvs join} + {(\() Lh join (\)) join}ie E join join}{pop}ie} d +/Cp {/Xc CP /Yc E D D} D +/SS {Cf{dup 0 ge{EU E get dup -1 eq{pop CA CL get}if}{pop CA CL get}ie Sc} + {pop}ie SZ SL get /SL SL 1 add D} D +/I {WB 8 SS 1 FS} D +/EM {WB 8 SS /CF CF 1 xor D 0 FS} D +/BD {WB 9 SS 2 FS} D +/TT {WB 10 SS /FN Fp D 0 FS} D +/KB {WB 11 SS /FN Fp D 2 FS} D +/CT {WB 12 SS 1 FS} D +/SM {WB 13 SS /FN Fp D 0 FS} D +/Q {/QL QL 1 add D QO QL 2 mod get La get join WB} D +/EQ {QC QL 2 mod get La get join WB /QL QL 1 sub D} D +/RO {WB -1 SS /CF 0 D 0 FS} D +/SY {WB -1 SS -1 FS} D +/MY {WB -1 SS -2 FS} D +/ES {WB /SL SL 1 sub NN D /CF 0 D /FN FO SL get D SZ SL get FR SL get FS ()Ec}D +/FZ {3 sub 1.2 E exp GS mul E WB TL /C1 C1 ( Cp ) join D /SL SL 1 add D 0 FS} D +/Ef {WB TL ()ES /C1 C1 ( Cp ) join D} D +/BZ {dup /Bf E D FZ}D +/Sc {dup -1 ne Cf and{/CL CL 1 add D dup 0 eq{pop [0 0 0]}if + dup CA E CL E put VS ( VC ) join C1 E join /C1 E D}{pop}ie} D +/Ec {WB Cf{/CL CL 1 sub NN D CA CL get VS ( VC ) join C1 E join /C1 E D}if} D +/VS {dup type /arraytype eq{([) E {ST cvs join ( ) join}forall (]) join}if} D +/VC {{255 div}forall setrgbcolor} D +/Sl {dup type /integertype ne{Ds}if /La E D WB}d +/UN {WB /UF t D} D +/NU {WB /UF f D} D +/SE {WB /sF t D} D +/XE {WB /sF f D} D +/sM {/C1 C1 ( k1 ) join D}d +/eM {/C1 C1 ( k2 ) join D}d +/k1 {/YC CP E pop Ts add D /mF t D /f1 t D}d +/k2 {gsave 3 LW -9 CP E pop Ts 0.2 mul sub M -9 YC L stroke grestore /mF f D}d +/Ac {/AC E D WB}d +/Ca {eA{( \()join AC join(\) )join}if WB}d +/s {OU{gsave 0 CS .25 mul R dup SW pop CJ 0 RL stroke grestore}if}D +/CJ {AT 3 eq LB and{E dup dup length 1 sub A1 mul E + {( ) search{pop pop E A2 add E}{pop exit}ie}loop 3 -1 roll add + W CP pop sub 2 copy gt{E}if pop}if}D +/So {/Co E D} D +/SO {C1 Yo ST cvs join ( So ) join /C1 E D (j) SW pop 2 div Pd} D +/Se {E WB CS E div Pd}D +/Pd {dup type /stringtype eq{SW pop}if dup /L1 E L1 add D + ST cvs ( 0 R ) join C1 E join /C1 E D} D +/Sp {0.35 CO} D +/Sb {-0.2 CO} D +/CO {OV Io Yo put /Yo E CS mul Yo add D /Io Io 1 add D -1.5 Io mul 3 add FZ SO + CS Yo add dup YA gt{/YA E D}{pop}ie + Yo neg dup YB gt{/YB E D}{pop}ie} D +/Es {ES /Io Io 1 sub NN D /Yo OV Io get D SO} D +/SB {/N2 0 D 0 1 NI{/N E D{IX N2 get 0 lt{/N2 N2 1 add D}{exit}ie}loop + /K WS N get FC N get mul D /NY AY N2 get D /BV NY array D + 0 1 NY 1 sub{/TM K string D currentfile TM readhexstring pop pop BV E TM put} + for BM N BV put /N2 N2 1 add D}for} D +/IC [{/MA E D /MB 0 D}{2 div /MA E D /MB MA D}{/MB E CS sub D /MA CS D} + {pop /MA YS AB mul D /MB 1 AB sub YS mul D}{pop /MA 0 D /MB 0 D}] D +/IP {BV N get /N N 1 add D} D +/II {/K E D IX K get 0 lt{/EC E D}if /TY E D + TY 4 eq{/Y E D /X E D}if TY 3 eq{/AB E D}if + /XW AX K get D /YW AY K get D /IS SG IT K get get D /XS XW IS mul D + /YS YW IS mul D YS IC TY get exec /MA MA Fl not{3 add}if D} D +/IM {II /ty TY D /xs XS D /ys YS D /ya YA D /yb YB D /ma MA D /mb MB D /k K D + /ec EC D /BP f D /CI 0 D WB TL L1 xs add dup XO add MR add W gt + {pop /ma ma Fl{3 add}if D NL /YA ma D /YB mb D /YS ys D /L1 xs D} + {/L1 E D ma YA gt{/YA ma D}if mb YB gt{/YB mb D}if}ie /TB f D + OU{CP E pop YS sub LE neg lt Fl not and PB not and{NP /YA ma D /YB mb D}if + /BP f D ty ST cvs ( ) join IX k get 0 lt{(\() join ec join (\) ) join}if + k ST cvs join ty 3 eq{AB ST cvs ( ) join E join}if + ty 4 eq{X ST cvs ( ) join Y ST cvs join ( ) join E join}if C1 E join + ( DI ) join FP 2 eq FP 1 eq AF and or{( FM ) join}if + ( Il Cp ) apa /C1 E D /EN f D}if /HM t D /T f D} D +/DI {II /Xc CP /Yc E D D /YN YW neg D /HM t D /CI 0 D /K2 IX K get D gsave + TY 4 eq{OX X IS mul add OY FY add YS sub Y IS mul sub} + {/FY YS D CP MB sub 2 copy /OY E D /OX E D}ie + translate K2 0 ge{/DP AZ K2 get D /BV BM K2 get D XS YS scale /N 0 D XW YW DP + [XW 0 0 YN 0 YW] {IP} FC K2 get 1 eq{image}{f 3 colorimage}ie} + {EX}ie grestore XS 0 R /Ms t D} D +/FM {gsave 0 Sg CP MB sub translate XS neg 0 M 0 YS RL XS 0 RL 0 YS neg RL + XS neg 0 RL stroke grestore} D +/NA {/AT E D /AL AL 1 add D AV AL AT put} D +/OA {AL 0 gt{/AL AL 1 sub D /AT AV AL get D}if} D +/D1 {/BR {CP E pop E BN Mb{CP E pop eq{0 YI R}if}{pop}ie} D + /Sn {OU{C1 E ST cvs join ( Ld ) join /C1 E D}{pop}ie} D} D +/D1 {/BR {BN} D /Sn {OU {C1 E ST cvs join ( Ld ) join /C1 E D} {pop} ie} D} D +/TC {/TF t D /ML 0 D HN{SW pop dup ML gt{/ML E D}{pop}ie}forall NP /RM RM not D + RC /OU Tc D Ep /PN 0 D Ms not TP and{Ip}if /W IW ML sub Ts sub D + /A0 0 D TH{/BR {( ) join BT} D /Sn {pop} D /Au () D}if} D +/TN {0 eq{E EA PF HF or not XR and{HN E get Xr}{pop}ie} + {OU{Tn 0 ge{() BN}if /Tn E D}{pop}ie WB}ie} D +/NT {OU LB not and Tn 0 ge and{PL 0 eq{Ms not{CS CF FS}if CP dup + /y E YA sub D W 9 sub CS -1.8 mul XO L1 add 2 add{y M (.) show}for + HN Tn get dup SW pop IW E sub y M show CP BB M}if /Tn -1 D}if} D +/Ld {/DN E D HN DN Pn put [/View [/XYZ -4 Fl{PS}{CP YA add US E pop}ie null] + /Dest DN ST cvs cvn /DEST pdfmark} D +/C {ND 1 eq{1 sub}if TI mul /XO E D NL Nf not{pop()}if 0 3 -1 roll 1 A} D +/OP {BP not{NP}if PN 2 mod 0 eq{/Ms t D NP}if}D +/Ep {Xp PN 2 mod 0 eq and OU and{/Pn (-) D showpage /PM 1 D LA}if}D +/Dg [73 86 88 76 67 68 77] D +/Rd [0 [1 1 0][2 1 0][3 1 0][2 1 1][1 1 1][2 2 1][3 3 1][4 4 1][2 1 2]] D +/Ns {/m E D /c E 32 mul D /j m 1000 idiv D /p j 12 add string D + c 96 le m 0 gt and{c 32 le {/i 0 D /d 77 D /l 100 D /m m j 1000 mul sub D + j -1 1 {pop p i d c add put /i i 1 add D}for + 4 -2 0 {/j E D /n m l idiv D /m m n l mul sub D /d Dg j get D + n 0 gt {/x Rd n get D x 0 get -1 1 {pop p i d c add put /i i 1 add D}for + p i x 1 get sub Dg x 2 get j add get c add put}if /l l 10 idiv D + }for p 0 i GI} + {/i ST length 1 sub D m {1 sub dup 0 ge{dup 26 mod c add 1 add + ST i 3 -1 roll put 26 idiv dup 0 eq{pop exit}if}if /i i 1 sub D}loop + ST i ST length i sub GI}ie} + {m p cvs}ie} D +/US {matrix currentmatrix matrix defaultmatrix matrix invertmatrix + matrix concatmatrix transform} D +/GB {Gb{US}if}D +/Tl {/Rn E D Xc CP pop ne{ + [/Rect [Xc 1 sub Yc cS 0.25 mul sub GB CP E 1 add E cS 0.85 mul add GB] + /Subtype /Link /Border [0 0 Cf Lc and LX and AU or{0}{1}ie] Rn type + /nametype eq {/Dest Rn}{/Action [/Subtype /URI /URI Rn] Cd}ie + /ANN pdfmark}if} D +/Il {/Rn E D [/Rect [Xc Yc GB Xc XS add Yc YS add GB] /Subtype /Link + /Border [0 0 0] Rn type /nametype eq{/Dest Rn} + {/Action [/Subtype /URI /URI Rn] Cd}ie /ANN pdfmark} D +/XP {[{/Z Bz 2 div D Z 0 R Z Z RL Z neg Z RL Z neg Z neg RL Z Z neg RL + Fi cH 1 eq and{fill}if} {Bz 0 RL 0 Bz RL Bz neg 0 RL 0 Bz neg RL + Fi cH 1 eq and{fill}if} {0 -5 R Bz 0 RL 0 21 RL Bz neg 0 RL 0 -21 RL}]} D +/MS {/Sm E D WB}D +/O {BN()Sm BX} D +/O {BN()0 Sm BX} D +/BX {/Bt E D Bt 2 lt{/Ch E D CS 0.8 mul}{11 mul}ie W XO sub MR sub + 2 copy gt{E}if pop /HZ E D Bt 2 eq{Fi not{pop()}if ( )E join /Ft E D TT + /PF t D /MW 1 D /Li 1 D /Fw Ft SW pop D Fw HZ gt{/HZ Fw 8 add D}if + HZ ST cvs( )join}{WB Ch ST cvs( )join}ie L1 HZ add XO add MR add W gt{NL}if + Bt 2 eq{Ft ES Fw neg HM{CS sub}if Pd}if Bt ST cvs join( Bx )join + Bt 2 eq HM and{CS Pd}if C1 E join /C1 E D /L1 L1 HZ add D /T f D + ( ) Pd /PF f D Bt 2 lt{YA CS .8 mul lt{/YA CS .8 mul D}if} + {YB 5 lt{/YB 5 D}if YA 21 lt{/YA 21 D}if}ie /CI 0 D} D +/Bx {dup 2 eq{E /Bz E D}{E /cH E D /Bz CS .8 mul D}ie + OU {gsave 0 Sg XP E get exec stroke grestore}{pop}ie Bz 0 R /Ms t D}D +/SD {FD 4 mul Dy add DZ NF newpath 0 0 M DX t charpath pathbbox + 3 -1 roll sub /DY E D E dup /X1 E D sub WM mul WX DY mul add WM DG mul E div + /DF E D /DR WX DF mul DY mul WM div 2 div D} d +/Sd {gsave 0 IL Di mul neg translate IL IW atan Di 0 eq{neg}if rotate + FD 4 mul Dy add DZ NF DR X1 sub DY 2 div neg M cD VC DX show grestore} d +/Pt {/tp t D Tp{NP /Pn (TP) D 0 Tt neg R Th BN NP Ep ET RC ZF}if /tp f D} D +/RC {/AI 0 D /LG 0 D /BC 0 D /UI 0 D /PF f D /Cc 0 D /cC 0 D /Dc 10 array D + /NR [0 1 9{pop 0}for] D /La Ds D /AR 10 array D /TR 10 array D /AV 30 array D + SI /AL -1 D /AT A0 D AT NA /OV 9 array D /Yo 0 D /Co 0 D /Io 0 D /Hy f D + /Ph f D /CL -1 D Ct Sc}D +/ZF {/FR [0 1 30{pop 0}for] D /SZ [0 1 30{pop 0}for] D /FO [0 1 30{pop 0}for] D + /SL 0 D /CF 0 D /FN 0 D 0 Ts SF}D +/QO [[(\234)(\233)(\253\240)(\232)(\273)(\253)][(')(`)(\253\240)(\231)(\273)(\253)]] D +/QC [[(\234)(\234)(\240\273)(\233)(\253)(\273)][(')(')(\240\273)(`)(\253)(\273)]] D +/Hf EF length 2 sub D +/Hz EZ Hf get D +/HS Ey Hf get D +/Fz EZ Hf 1 add get D +/Fs Ey Hf 1 add get D +/LE IL D +/Ps EZ 1 get D +/Fp EF 1 get D +/XO 0 D +/YI 0 D +/CI 0 D +/FP 0 D +/WW Ts 7 mul D +/Mf 0 D +/YA 0 D +/YB 0 D +/Cs Ts D +/GS Ts D +/F0 0 D +/NS 0 D +/NB 0 D +/N 0 D +/C0 [] D +/C1 () D +/Lo 0 D +/L1 0 D +/LM 0 D +/PH 0 D +/EC 0 D +/Lh 0 D +/LT 0 D +/CH 1 string D +/ST 16 string D +/CA 9 array D +/HC (\255) D +/HM f D +/PF f D +/EN f D +/TB f D +/UF f D +/sF f D +/AE f D +/AF f D +/BP t D +/CD f D +/PA t D +/GL f D +/T t D +/HF f D +/AH f D +/SA f D +/PB f D +/f1 f D +/mF f D +/OX 0 D +/OY 0 D +/FY 0 D +/EO 0 D +/FB 0 D +/PL 0 D +/Bw 0 D +/PD -1 D +/TP f D +/tp f D +/TH f D +/Ty 4 D +/Tn -1 D +/Fl t D +/LB t D +/PM 1 D +/Ms f D +/Ba f D +/Bb f D +/Hl 3 D +/hl 6 D +/Hv 6 D +/Hs f D +/HI 0 D +/hi 0 D +/PO t D +/TE f D +/LF t D +/BO 0 D +/Sm 1 D +/Bf 3 D +/A1 0 D +/A2 0 D +/Ds 1 D +/QL -1 D +/Cb Db D +/Ct Dt D +/Cl Dl D +[/Creator (html2ps version 1.0 beta5) /Author () /Keywords () /Subject () + /Title (The XPA Help Facility) /DOCINFO pdfmark +/ND 22 D +/HN [(1) (1) (1) (3) (5) (8) (10) (14) (15) (16) (15) (16) (17) (19) (22) (25) +(26) (29) (30) (30) (31) (32) (32) (33) (34) (34) (35) (37) (38) (46) (46) +(39) (40) (42) (43) (44) (47) (48) (50) (51) (55) (61) (63) (75) (76) (77) +(80) (1) (1) (1) (2) (1) (??) (??) (1) (1) (1) (2) (3) (3) (3) (3) (4) (5) +(5) (5) (5) (7) (8) (8) (8) (8) (9) (10) (10) (10) (10) (10) (11) (12) (13) +(14) (14) (14) (14) (14) (15) (15) (15) (16) (16) (17) (18) (19) (19) (19) +(19) (20) (21) (22) (22) (22) (24) (25) (25) (33) (25) (25) (25) (25) (26) +(29) (30) (30) (31) (32) (32) (33) (33) (34) (34) (35) (36) (37) (37) (37) +(37) (37) (38) (38) (38) (38) (38) (38) (39) (40) (42) (43) (44) (46) (46) +(47) (48) (49) (50) (50) (50) (50) (50) (51) (53) (51) (51) (51) (51) (51) +(52) (53) (54) (55) (55) (55) (55) (60) (61) (61) (61) (61) (62) (63) (63) +(63) (63) (63) (63) (64) (64) (64) (65) (65) (66) (67) (67) (67) (68) (68) +(68) (68) (69) (69) (69) (70) (70) (70) (70) (70) (71) (71) (71) (71) (72) +(72) (73) (73) (73) (74) (74) (74) (74) (75) (75) (75) (75) (75) (76) (76) +(76) (76) (76) (77) (77) (77) (77) (79) (80) (80) (80) (80) (80)] D +/h0 [()(Table of Contents)] D +/h1 [(0.1\240\240)(XPA: Public Access to Data and Algorithms)] D +/h2 [(0.2\240\240)(Summary)] D +/h3 [(0.3\240\240)(Description)] D +/h4 [(0.3.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h5 [(0.4\240\240)(XPAIntro: Introduction to the XPA Messaging System)] D +/h6 [(0.5\240\240)(Summary)] D +/h7 [(0.6\240\240)(Description)] D +/h8 [(0.6.0.0.1\240\240)(Last updated: March 10, 2007)] D +/h9 [(0.7\240\240)(XPATemplate: Access Point Names and Templates)] D +/h10 [(0.8\240\240)(Summary)] D +/h11 [(0.9\240\240)(Description)] D +/h12 [(0.9.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h13 [(0.10\240\240)(XPACommon: Getting Common Information About Access Points)] D +/h14 [(0.11\240\240)(Summary)] D +/h15 [(0.12\240\240)(Description)] D +/h16 [(0.12.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h17 [(0.13\240\240)(XPAMethod: XPA Communication Methods)] D +/h18 [(0.14\240\240)(Summary)] D +/h19 [(0.15\240\240)(Description)] D +/h20 [(0.15.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h21 [(0.16\240\240)(XPAInet: XPA Communication Between Hosts)] D +/h22 [(0.17\240\240)(Summary)] D +/h23 [(0.18\240\240)(Description)] D +/h24 [(0.19\240\240)(Manual Registration)] D +/h25 [(0.20\240\240)(Remote Registration)] D +/h26 [(0.21\240\240)(XPANS Proxy Registration)] D +/h27 [(0.21.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h28 [(0.22\240\240)(XPAUsers: Distinguishing Users)] D +/h29 [(0.23\240\240)(Summary)] D +/h30 [(0.24\240\240)(Description)] D +/h31 [(0.24.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h32 [(0.25\240\240)(XPA Programs)] D +/h33 [(0.26\240\240)(Summary)] D +/h34 [(0.27\240\240)(xpaset: send data to one or more XPA servers)] D +/h35 [(0.28\240\240)(xpaget: retrieve data from one or more XPA servers)] D +/h36 [(0.29\240\240)(xpainfo: send short message to one or more XPA servers)] D +/h37 [(0.30\240\240)(xpaaccess: see if template matches registered XPA access points)] D +/h38 [(0.30.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h39 [(0.31\240\240)(xpamb: the XPA Message Bus)] D +/h40 [(0.32\240\240)(Summary)] D +/h41 [(0.33\240\240)(Description)] D +/h42 [(0.34\240\240)(Options)] D +/h43 [(0.34.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h44 [(0.35\240\240)(xpans: the XPA Name Server)] D +/h45 [(0.36\240\240)(Summary)] D +/h46 [(0.36.0.0.1\240\240)(Last updated: January 24, 2005)] D +/h47 [(0.37\240\240)(XPAServer: The XPA Server-side Programming Interface)] D +/h48 [(0.38\240\240)(Summary)] D +/h49 [(0.39\240\240)(Introduction to XPA Server Programming)] D +/h50 [(0.40\240\240)(Introduction)] D +/h51 [(0.41\240\240)(XPANew: create a new XPA access point)] D +/h52 [(0.42\240\240)(XPACmdNew: create a new XPA public access point for commands)] D +/h53 [(0.43\240\240)(XPACmdAdd: add a command to an XPA command public access point)] D +/h54 [(0.44\240\240)(XPACmdDel: remove a command from an XPA command public access point)] D +/h55 [(0.45\240\240)(XPAInfoNew: define an XPA info public access point)] D +/h56 [(0.46\240\240)(XPAFree: remove an XPA public access point)] D +/h57 [(0.47\240\240)(XPAMainLoop: optional main loop for XPA)] D +/h58 [(0.48\240\240)(XPAPoll: execute existing XPA requests)] D +/h59 [(0.49\240\240)(XPAAtExit: install exit handler)] D +/h60 [(0.50\240\240)(XPACleanup: release reserved XPA memory)] D +/h61 [(0.51\240\240)(XPA Server Callback Macros)] D +/h62 [(0.52\240\240)(XPA Race Conditions)] D +/h63 [(0.52.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h64 [(0.53\240\240)(Xpaoom: What happens when XPA runs out of memory?)] D +/h65 [(0.54\240\240)(Summary)] D +/h66 [(0.55\240\240)(Description)] D +/h67 [(0.55.0.0.1\240\240)(Last updated: April 7, 2009)] D +/h68 [(0.56\240\240)(XPAClient: The XPA Client-side Programming Interface)] D +/h69 [(0.57\240\240)(Summary)] D +/h70 [(0.58\240\240)(Introduction to XPA Client Programming)] D +/h71 [(0.59\240\240)(Introduction)] D +/h72 [(0.60\240\240)(XPAGet: retrieve data from one or more XPA servers)] D +/h73 [(0.61\240\240)(XPASet: send data to one or more XPA servers)] D +/h74 [(0.62\240\240)(XPAInfo: send short message to one or more XPA servers)] D +/h75 [(0.63\240\240)(XPAGetFd: retrieve data from one or more XPA servers and write to files)] D +/h76 [(0.64\240\240)(XPASetFd: send data from stdin to one or more XPA servers)] D +/h77 [(0.65\240\240)(XPAOpen: allocate a persistent client handle)] D +/h78 [(0.66\240\240)(XPAClose: close a persistent XPA client handle)] D +/h79 [(0.67\240\240)(XPANSLookup: lookup registered XPA access points)] D +/h80 [(0.68\240\240)(XPAAccess: return XPA access points matching template \(XPA 2.1 and above\))] D +/h81 [(0.68.0.0.1\240\240)(Last updated: March 10, 2007)] D +/h82 [(0.69\240\240)(XPAXt: the XPA Interface to Xt \(X Windows\))] D +/h83 [(0.70\240\240)(Summary)] D +/h84 [(0.71\240\240)(Description)] D +/h85 [(0.71.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h86 [(0.72\240\240)(XPATcl: the XPA Interface to the Tcl/Tk Environment)] D +/h87 [(0.73\240\240)(Summary)] D +/h88 [(0.74\240\240)(Server Routines)] D +/h89 [(0.75\240\240)(Client Routines)] D +/h90 [(0.76\240\240)(Description)] D +/h91 [(0.77\240\240)(XPANew)] D +/h92 [(0.78\240\240)(XPARec)] D +/h93 [(0.78.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h94 [(0.79\240\240)(XPAEnv: Environment Variables for XPA Messaging)] D +/h95 [(0.80\240\240)(Summary)] D +/h96 [(0.81\240\240)(Description)] D +/h97 [(0.81.0.0.1\240\240)(Last updated: December 23, 2009)] D +/h98 [(0.82\240\240)(XPAAcl: Access Control for XPA Messaging)] D +/h99 [(0.83\240\240)(Summary)] D +/h100 [(0.84\240\240)(Description)] D +/h101 [(0.84.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h102 [(0.85\240\240)(XPA ChangeLog)] D +/h103 [(0.86\240\240)(Public Release 2.1.15 \(July 23, 2013\))] D +/h104 [(0.87\240\240)(Public Release 2.1.14 \(June 7, 2012\))] D +/h105 [(0.88\240\240)(Public Release 2.1.13 \(April 14, 2011\))] D +/h106 [(0.89\240\240)(Public Release 2.1.12 \(January 26, 2010\))] D +/h107 [(0.90\240\240)(Public Release 2.1.11 \(December 7, 2009\))] D +/h108 [(0.91\240\240)(Public Release 2.1.10 \(September 1, 2009\))] D +/h109 [(0.92\240\240)(Internal Release 2.1.9)] D +/h110 [(0.93\240\240)(Public Release 2.1.8 \(1 November 2007\))] D +/h111 [(0.94\240\240)(Patch Release 2.1.7b[1,2] \(Feb 22, 2006; March 8, 2007\))] D +/h112 [(0.95\240\240)(Patch Release 2.1.6 \(4 May 2005\))] D +/h113 [(0.96\240\240)(Patch Release 2.1.5 \(12 January 2004\))] D +/h114 [(0.97\240\240)(Patch Release 2.1.4 \(24 March 2003\))] D +/h115 [(0.98\240\240)(Patch Release 2.1.3 \(26 September 2002\))] D +/h116 [(0.99\240\240)(Patch Release 2.1.2 \(18 July 2002\))] D +/h117 [(0.100\240\240)(Patch Release 2.1.1 \(20 June 2002\))] D +/h118 [(0.101\240\240)(Public Release 2.1.0 \(22 April 2002\))] D +/h119 [(0.102\240\240)(Pre-Release 2.1.0e \(2 April 2002\))] D +/h120 [(0.103\240\240)(Pre-Release 2.1.0e \(1 April 2002\))] D +/h121 [(0.104\240\240)(Pre-Release 2.1.0e \(25 March 2002\))] D +/h122 [(0.105\240\240)(Pre-Release 2.1.0e \(19 March 2002\))] D +/h123 [(0.106\240\240)(Pre-Release 2.1.0e \(14 February 2002\))] D +/h124 [(0.107\240\240)(Pre-Release 2.1.0e \(11 February 2002\))] D +/h125 [(0.108\240\240)(Beta Release 2.1.0b10 \(31 January 2002\))] D +/h126 [(0.109\240\240)(Beta Release 2.1.0b9 \(26 January 2002\))] D +/h127 [(0.110\240\240)(Beta Release 2.1.0b8 \(4 January 2002\))] D +/h128 [(0.111\240\240)(Beta Release 2.1.0b7 \(21 December 2001\))] D +/h129 [(0.112\240\240)(Beta Release 2.1.0b6 \(29 October 2001\))] D +/h130 [(0.113\240\240)(Beta Release 2.1.0b5 \(22 October 2001\))] D +/h131 [(0.114\240\240)(Beta Release 2.1.0b4 \(24 September 2001\))] D +/h132 [(0.115\240\240)(Beta Release 2.1.0b3 \(6 September 2001\))] D +/h133 [(0.116\240\240)(Beta Release 2.1.0b2 \(17 August 2001\))] D +/h134 [(0.117\240\240)(Beta Release 2.1.0b1 \(6 August 2001\))] D +/h135 [(0.118\240\240)(Patch Release 2.0.5 \(10 November 2000\))] D +/h136 [(0.119\240\240)(Patch Release 2.0.4 \(20 September 2000\))] D +/h137 [(0.120\240\240)(Patch Release 2.0.3 \(15 June 2000\))] D +/h138 [(0.121\240\240)(Patch Release 2.0.2 \(9 September 1999\))] D +/h139 [(0.122\240\240)(Patch Release 2.0.1 \(6 August 1999\))] D +/h140 [(0.123\240\240)(Public Release 2.0 \(27 May 1999\))] D +/h141 [(0.123.0.0.1\240\240)(Last updated: 22 April 2002)] D +/h142 [(0.124\240\240)(XPACode: Where to Find Example/Test Code)] D +/h143 [(0.125\240\240)(Summary)] D +/h144 [(0.126\240\240)(Description)] D +/h145 [(0.126.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h146 [(0.127\240\240)(XPA Changes: Changes For Users from XPA 1.0 and 2.0)] D +/h147 [(0.128\240\240)(Summary)] D +/h148 [(0.129\240\240)(Description)] D +/h149 [(0.129.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h150 [(0.130\240\240)(XPAConvert: Converting the XPA API to 2.0)] D +/h151 [(0.131\240\240)(Summary)] D +/h152 [(0.132\240\240)(Description)] D +/h153 [(0.132.0.0.1\240\240)(Last updated: September 10, 2003)] D +/h154 [(0.133\240\240)(XPAName: What does XPA stand for?)] D +/h155 [(0.134\240\240)(Summary)] D +/h156 [(0.135\240\240)(Description)] D +/h157 [(0.135.0.0.1\240\240)(Last updated: September 10, 2003)] D +/Hr [-47 47 48 49 -50 -50 50 -54 54 55 56 -57 -57 57 -59 59 60 61 -62 -62 +62 -64 64 65 66 -67 -67 67 -69 69 70 71 -72 -72 72 -74 74 75 76 77 78 79 +-80 -80 80 -82 82 83 84 -85 -85 85 -86 86 87 88 89 90 91 -92 -92 92 -94 +94 95 96 97 -98 -98 98 -100 100 101 -102 -102 102 -106 106 107 108 109 110 +111 112 113 114 115 116 117 118 119 120 121 -122 -122 122 -124 124 125 126 +-127 -127 127 -130 130 131 132 133 134 135 136 137 138 139 140 141 142 -143 +-143 143 -145 145 146 147 -148 -148 148 -151 151 152 153 154 155 156 157 +-158 -158 158 -160 160 161 162 -163 -163 163 -165 165 166 167 -168 -168 +168 -169 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 +185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 +203 204 205 206 207 -208 -208 208 -210 210 211 212 -213 -213 213 -215 215 +216 217 -218 -218 218 -220 220 221 222 -223 -223 223 -225 225 226 227 -228 +-228 228]D +/HV [1 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 3 +4 5 1 2 2 2 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 2 2 2 3 4 5 1 2 2 2 2 3 4 +5 1 2 2 3 4 5 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 +2 2 2 2 2 2 2 2 2 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 2 2 2 2 3 4 5 1 2 2 +2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 +2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 3 4 5 1 2 2 2 +3 4 5 1 2 2 2 3 4 5]D +/Cn [3 0 0 1 1 1 0 3 0 0 1 1 1 0 3 0 0 1 1 1 0 3 0 0 1 1 1 0 3 0 0 1 1 +1 0 6 0 0 0 0 0 1 1 1 0 3 0 0 1 1 1 0 6 0 0 0 0 0 1 1 1 0 4 0 0 0 1 1 1 +0 2 0 1 1 1 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 3 0 0 1 1 1 0 13 +0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 3 0 0 1 1 1 0 7 0 0 0 0 0 0 1 1 1 0 3 0 +0 1 1 1 0 3 0 0 1 1 1 0 39 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 3 0 0 1 1 1 0 3 0 0 1 1 1 0 3 0 0 +1 1 1 0 3 0 0 1 1 1 0]D +Hr length 0 gt{[/PageMode /UseOutlines /DOCVIEW pdfmark}if +/Hn 1 D +0 1 Hr length 1 sub{ + /Bn E D [Cn Bn get dup 0 gt{/Count E HV Bn get Bl ge{neg}if}{pop}ie + /Dest Hr Bn get dup abs ST cvs cvn E 0 ge{(h)Hn ST cvs join cvx exec + dup 1 get E Nf{0 get E join}{pop}ie /Hn Hn 1 add D}{()}ie + /Title E dup length 255 gt{0 255 getinterval}if /OUT pdfmark}for +ZF /FN Fp D Ps 0 FS /WC Wf{( )}{}ie SW pop D +ET RC ZF +/Df f D +/R1 (http://hea-www.harvard.edu/RD/xpa/changelog.html) D +/Ba f D /BO 0 D Bs +/UR (help.html) D +/Ti (The XPA Help Facility) D +/Au () D +/Df f D +/ME [()] D + TC + +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc + +/Ba f D /BO 0 D Bs +/UR (help.html) D +/Ti (The XPA Help Facility) D +/Au () D +/Df f D +/ME [()] D + TC + +NP RC ZF +()1 Sl()WB 0 Sn( + + +)0 2 0 H(XPA:)WB 47 Sn()WB 1 Sn( Public Access to Data and Algorithms)EA()EH( + + +)0 2 1 H(Summary)WB 48 Sn()EH( +This document is the Table of Contents for XPA. + + +)0 2 2 H(Description)WB 49 Sn()EH( +)0 P(The XPA messaging system provides seamless communication between many +kinds of Unix programs, including X programs and Tcl/Tk programs. It +also provides an easy way for users to communicate with XPA-enabled +programs by executing XPA client commands in the shell or by utilizing +such commands in scripts. Because XPA works both at the programming +level and the shell level, it is a powerful tool for unifying any +analysis environment: users and programmers have great flexibility in +choosing the best level or levels at which to access XPA services, and +client access can be extended or modified easily at any time. + +)0 P(A program becomes an XPA-enabled server by defining named points of +public access through which data and commands can be exchanged with +other client programs \201and users\202. Using standard TCP sockets as a +transport mechanism, XPA supports both single-point and broadcast +messaging to and from these servers. It supports direct communication +between clients and servers, or indirect communication via an +intermediate message bus emulation program. Host-based access control +is implemented, as is as the ability to communicate with XPA servers +across a network. + +)0 P(XPA implements a layered interface that is designed to be useful both +to software developers and to users. The interface consists of a +library of XPA client and server routines for use in C/C++ programs and +a suite of high-level user programs built on top of these libraries. +Using the XPA library, access points can be added to Tcl/Tk programs, +Xt programs, or to Unix programs that use the XPA event loop or any +event loop based on select\201\202. Client access subroutines can be added +to any Tcl/Tk, Xt, or Unix program. Client access also is supported at +the command line via a suite of high-level programs. + +)0 P(Choose from the following topics: + +)UL( +)-1 LI()0 2 1 A(Introduction to XPA)2 1 TN TL()Ec /AF f D( + +)-1 LI()0 3 1 A(Access Point Names and Templates)3 1 TN TL()Ec /AF f D( + +)-1 LI()0 4 1 A(Getting Common Information About Access Points)4 1 TN TL()Ec /AF f D( + +)-1 LI()0 5 1 A(Communication Methods)5 1 TN TL()Ec /AF f D( + +)-1 LI()0 6 1 A(Communication Between Hosts)6 1 TN TL()Ec /AF f D( + +)-1 LI()0 7 1 A(Distinguishing Users)7 1 TN TL()Ec /AF f D( + + +)-1 LI()0 8 1 A(XPA User Programs)8 1 TN TL()Ec /AF f D( +)UL()-1 LI()0 9 1 A(xpaget: get data and info)9 1 TN TL()Ec /AF f D( + +)-1 LI()0 10 1 A(xpaset: send data and info)10 1 TN TL()Ec /AF f D( + +)-1 LI()0 11 1 A(xpainfo: send info alert)11 1 TN TL()Ec /AF f D( + +)-1 LI()0 12 1 A(xpaaccess: get access point info)12 1 TN TL()Ec /AF f D( + +)-1 LI()0 13 1 A(xpamb: message bus emulation)13 1 TN TL()Ec /AF f D( + +)-1 LI()0 14 1 A(xpans: the XPA name server)14 1 TN TL()Ec /AF f D( +)LU( + +)-1 LI()0 15 1 A(XPA Server Routines)15 1 TN TL()Ec /AF f D( +)UL()-1 LI()0 16 1 A(XPANew: define a new access point)16 1 TN TL()Ec /AF f D( + +)-1 LI()0 17 1 A(XPACmdNew: define a new command access point)17 1 TN TL()Ec /AF f D( + +)-1 LI()0 18 1 A(XPACmdAdd: add a command)18 1 TN TL()Ec /AF f D( + +)-1 LI()0 19 1 A(XPACmdDel: delete a command)19 1 TN TL()Ec /AF f D( + +)-1 LI()0 20 1 A(XPAInfoNew: define an info access point)20 1 TN TL()Ec /AF f D( + +)-1 LI()0 21 1 A(XPAFree: free an access point)21 1 TN TL()Ec /AF f D( + +)-1 LI()0 22 1 A(XPAMainLoop: event loop for select server)22 1 TN TL()Ec /AF f D( + +)-1 LI()0 23 1 A(XPAPoll: poll for XPA events)23 1 TN TL()Ec /AF f D( + +)-1 LI()0 24 1 A(XPACleanup: release reserved XPA memory)24 1 TN TL()Ec /AF f D( + +)-1 LI()0 25 1 A(XPA Server Macros: accessing structure internals)25 1 TN TL()Ec /AF f D( + +)-1 LI()0 26 1 A(XPA Race Conditions: how to avoid them)26 1 TN TL()Ec /AF f D( + +)-1 LI()0 27 1 A(XPA Out of Memory \201OOM\202 errors)27 1 TN TL()Ec /AF f D( +)LU( + +)-1 LI()0 28 1 A(XPA Client Routines)28 1 TN TL()Ec /AF f D( +)UL()-1 LI()0 29 1 A(XPAOpen: open a persistent client connection)29 1 TN TL()Ec /AF f D( + +)-1 LI()0 30 1 A(XPAClose: close persistent client connection)30 1 TN TL()Ec /AF f D( + +)-1 LI()0 31 1 A(XPAGet: get data)31 1 TN TL()Ec /AF f D( + +)-1 LI()0 32 1 A(XPASet: send data or commands)32 1 TN TL()Ec /AF f D( + +)-1 LI()0 33 1 A(XPAInfo: send an info alert)33 1 TN TL()Ec /AF f D( + +)-1 LI()0 34 1 A(XPAGetFd: get data and write to an fd)34 1 TN TL()Ec /AF f D( + +)-1 LI()0 35 1 A(XPASetFd: read data from and fd and send)35 1 TN TL()Ec /AF f D( + +)-1 LI()0 36 1 A(XPANSLookup: look up an access point)36 1 TN TL()Ec /AF f D( + +)-1 LI()0 37 1 A(XPAAccess: get access info)37 1 TN TL()Ec /AF f D( + +)-1 LI()0 38 1 A(The XPA/Xt Interface: Xt interface to XPA)38 1 TN TL()Ec /AF f D( + +)-1 LI()0 39 1 A(The XPA/Tcl Interface: Tcl interface to XPA)39 1 TN TL()Ec /AF f D( +)LU( + +)-1 LI( Tailoring the XPA Environment +)UL()-1 LI()0 40 1 A(Environment Variables)40 1 TN TL()Ec /AF f D( + +)-1 LI()0 41 1 A(Access Control)41 1 TN TL()Ec /AF f D( +)LU( + +)-1 LI( Miscellaneous +)UL( +)-1 LI()0 42 1 A(XPA ChangeLog)42 1 TN TL()Ec /AF f D( + +)-1 LI()0 43 1 A(Where to Find Example/Test Code)43 1 TN TL()Ec /AF f D( +)-1 LI()0 44 1 A(User Changes Between XPA 1.0 and 2.0)44 1 TN TL()Ec /AF f D( +)-1 LI()0 45 1 A(API Changes Between XPA 1.0 and 2.0)45 1 TN TL()Ec /AF f D( +)-1 LI()0 46 1 A(What Does XPA Stand For, Anyway?)46 1 TN TL()Ec /AF f D()LU( +)LU( + + + +)0 5 3 H(Last)WB 50 Sn( updated: September 10, 2003)EH( +)WB NL NP Ep ET /Tc f D +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (intro.html) D +/Ti (Introduction to XPA) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 2 Sn( + + +)0 2 4 H(XPAIntro:)WB 54 Sn()WB 51 Sn( Introduction to the XPA Messaging System)EA()EH( + + +)0 2 5 H(Summary)WB 55 Sn()EH( +)0 P(A brief introduction to the XPA messaging system, which provides +seamless communication between all kinds of Unix event-driven +programs, including X programs, Tcl/Tk programs, and Perl programs. + + +)0 2 6 H(Description)WB 56 Sn()EH( +)0 P(The XPA messaging system provides seamless communication between all +kinds of Unix programs, including X programs, Tcl/Tk programs, and +Perl programs. It also provides an easy way for users to communicate +with these XPA-enabled programs by executing XPA client commands in +the shell or by utilizing such commands in scripts. Because XPA works +both at the programming level and the shell level, it is a powerful +tool for unifying any analysis environment: users and programmers have +great flexibility in choosing the best level or levels at which to +access XPA services, and client access can be extended or modified +easily at any time. + +)0 P(A program becomes an XPA-enabled server by defining named points of +public access through which data and commands can be exchanged with +other client programs \201and users\202. Using standard TCP sockets as +a transport mechanism, XPA supports both single-point and broadcast +messaging to and from these servers. It supports direct communication +between clients and servers, or indirect communication via an +intermediate message bus emulation program. Host-based access control +is implemented, as is as the ability to communicate with XPA servers +across a network. + +)0 P(XPA implements a layered interface that is designed to be useful both +to software developers and to users. The interface consists of a +library of XPA client and server routines for use in programs and a +suite of high-level user programs built on top of these libraries. +Using the XPA library, access points can be added to +)0 52 1 A(Tcl/Tk)52 0 TN TL()Ec /AF f D( +programs, +)0 53 1 A(Xt)53 0 TN TL()Ec /AF f D( +programs, or to Unix programs that use the XPA event loop or any +event loop based on select\201\202. Client access subroutines can be added +to any Tcl/Tk or Unix program. Client access also is supported at the +command line via a suite of high-level programs. + +)0 P(The major components of the XPA layered interface are: +)UL()-1 LI(A set of XPA server routines, centered on +)0 16 1 A(XPANew\201\202,)16 0 TN TL()Ec /AF f D( +which are used by XPA server programs to tag public access points with +string identifiers and to register send and receive callbacks for +these access points. + +)-1 LI(A set of XPA client routines, centered on the +)0 32 1 A(XPASet\201\202)32 0 TN TL()Ec /AF f D( +and +)0 31 1 A(XPAGet\201\202,)31 0 TN TL()Ec /AF f D( +which are used by external client applications to exchange data and +commands with an XPA server. + +)-1 LI(High-level programs, centered on +)0 10 1 A(xpaset)10 0 TN TL()Ec /AF f D( +and +)0 9 1 A(xpaget,)9 0 TN TL()Ec /AF f D( +which allow data +and information to be exchanged with XPA server programs from the +command line and from scripts. These programs have the command syntax: +) 2 35 PR( [data] | xpaset [qualifiers ...] + xpaget [qualifiers ...])RP( +)-1 LI(An XPA name server program, +)0 14 1 A(xpans,)14 0 TN TL()Ec /AF f D( +through which XPA access point names are +registered by servers and distributed to clients.)LU( + +)0 P(Defining an XPA access point is easy: a server application calls +)0 16 1 A(XPANew\201\202,)16 0 TN TL()Ec /AF f D( +)0 17 1 A(XPACmdNew\201\202,)17 0 TN TL()Ec /AF f D( +or the experimental +)0 20 1 A(XPAInfoNew\201\202)20 0 TN TL()Ec /AF f D( +routine to +create a named public access point. An XPA service can specify "send" +and "receive" callback procedures \201or an "info" procedure in the case +of XPAInfoNew\201\202\202 to be executed by the program when an external +process either sends data or commands to this access point or requests +data or information from this access point. Either of the callbacks +can be omitted, so that a particular access point can be specified as +read-only, read-write, or write-only. Application-specific client +data can be associated with these callbacks. Having defined one or +more public access points in this way, an XPA server program enters +its usual event loop \201or uses the standard XPA event loop\202. + +)0 P(Clients communicate with these XPA public access points +using programs such as +)0 9 1 A(xpaget)9 0 TN TL()Ec /AF f D(, +)0 10 1 A(xpaset)10 0 TN TL()Ec /AF f D(, and +)0 11 1 A(xpainfo)11 0 TN TL()Ec /AF f D( +\201at the command line\202, +or routines such as +)0 31 1 A(XPAGet\201\202,)31 0 TN TL()Ec /AF f D( +)0 32 1 A(XPASet\201\202,)32 0 TN TL()Ec /AF f D( +and +)0 33 1 A(XPAInfo\201\202)33 0 TN TL()Ec /AF f D( +within a program. Both methods require specification of the name of +the access point. The xpaget program returns data or other +information from an XPA server to its standard output, while the +xpaset program sends data or commands from its standard input to an +XPA application. The corresponding API routines set/get data to/from +memory, returning error messages and other info as needed. If a +)0 3 1 A(template)3 0 TN TL()Ec /AF f D( +is used to specify the access point name \201e.g., "ds9*"\202, then +communication will take place with all servers matching that template. + +)0 P(Please note that XPA currently is not thread-safe. All XPA calls must be +in the same thread. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 7 H(Last)WB 57 Sn( updated: March 10, 2007)EH( + +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (template.html) D +/Ti (Access Point Names and Templates) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 3 Sn( + + +)0 2 8 H(XPATemplate:)WB 59 Sn()WB 58 Sn( Access Point Names and Templates)EA()EH( + +)0 2 9 H(Summary)WB 60 Sn()EH( +)0 P(XPA access points are composed of two parts: a general class and a +specific name. Both parts accept template characters so that you +can send/retrieve data to/from multiple servers at one time. + + +)0 2 10 H(Description)WB 61 Sn()EH( +)0 P(When XPA servers call +)0 16 1 A(XPANew\201\202,)16 0 TN TL()Ec /AF f D( +or +)0 17 1 A(XPACmdNew\201\202)17 0 TN TL()Ec /AF f D( +to define XPA access points, they specify a string identifier composed of a +class and a name. When clients communicate with XPA access points, +they specify which access points to communicate with using +an identifier of the form: +) 1 12 PR( class:name)RP( +All registered XPA access points that match the specified identifier +will be available for communication \201subject to access control rules, +etc.\202 + +)0 P(As of XPA 2.1.5, the length of both the class and name designations are +limited to 1024 characters. + +)0 P(The XPA class:name identifier actually is a template: it accepts wild +cards in its syntax, so a single specifier can match more than one XPA +access point. \201Note that the class is optional and defaults to "*".\202 +The allowed syntax for clients to specify the class:name template is +of the form shown below. \201Note that "*" is used to denote a generic +wild card, but other wild cards characters are supported, as described +below\202. +) 7 46 PR( template explanation + -------- ----------- + class:name exact match of class and name + name match any class with this name + *:name match any class with this name + class:* match any name of this class + *:* match any access point)RP( +)0 P(In general, the following wild-cards can be applied to class and name: +) 5 58 PR( wildcard explanation + -------- ----------- + ? match any character, but there must be one + * match anything, or nothing + [...] match an inclusive set)RP( +)0 P(Although the class:name template normally is used to refer to XPA +access points, these also can be specified using their individual +socket identifiers. For inet sockets, the socket identifier is +)BD(ip:port)ES(, where ip can be the DNS-registered name, +the ASCII IP number \201e.g. 123.45.67.890\202 or the hex IP number +\201e.g. 838f3a60\202. For unix sockets, the identifier is the )BD(socket file +name)ES(. These socket identifiers are displayed as the fourth argument +in the xpans display of registered access points. For example, +consider the ds9 program started using inet sockets. The xpans name +server will register something like this: +) 2 40 PR( csh> xpaget xpans + DS9 ds9 gs saord.harvard.edu:3236 eric)RP( +You can access ds9 using ip:3236 in any of the three forms: +) 8 37 PR( csh> xpaget saord:3236 file + /home/eric/data/snr.ev + + csh> xpaget 123.45.67.890:3236 file + /home/eric/data/snr.ev + + csh> xpaget 838f3a60:3236 file + /home/eric/data/snr.ev)RP( +In the case of unix sockets, the socket identifier is a file: +) 5 41 PR( csh> xpaget xpans + DS9 ds9 gs /tmp/.xpa/DS9_ds9.2631 eric + + csh> xpaget /tmp/.xpa/DS9_ds9.2631 file + /home/eric/data/snr.ev)RP( +This feature can be useful in distinguishing between multiple +instances of a program that all have the same class:name designation. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 11 H(Last)WB 62 Sn( updated: September 10, 2003)EH( + +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (info.html) D +/Ti (Getting Common Information About Access Points) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 4 Sn( + + +)0 2 12 H(XPACommon:)WB 64 Sn()WB 63 Sn( Getting Common Information About Access Points)EA()EH( + + +)0 2 13 H(Summary)WB 65 Sn()EH( +)0 P(There are various kinds of generic information you can retrieve about +an XPA access point by using the xpaget command. + + +)0 2 14 H(Description)WB 66 Sn()EH( +)0 P(You can find out which XPA access points have been registered with +the currently running +)0 14 1 A(XPA name server)14 0 TN TL()Ec /AF f D( +by executing the +)0 9 1 A(xpaget)9 0 TN TL()Ec /AF f D( +command to retrieve info from the XPA name server: +) 1 14 PR( xpaget xpans)RP( +If, for example, the +)0 43 1 A(stest)43 0 TN TL()Ec /AF f D( test server program +is running, the following XPA access points will be returned \201the specifics +of the returned info will vary for different machines and users\202: +) 4 33 PR( XPA xpa gs 838e2f67:1262 eric + XPA xpa1 gs 838e2f67:1266 eric + XPA c_xpa gs 838e2f67:1267 eric + XPA i_xpa i 838e2f67:1268 eric)RP( +Note that access to this information is subject to the usual +)0 41 1 A(XPA Access Control)41 0 TN TL()Ec /AF f D( restrictions. + +)0 P(Each XPA access point supports a number of reserved sub-commands that provide +access to different kinds of information, e.g. the access control for +that access point. These sub-commands can be executed by using +)0 10 1 A(xpaset)10 0 TN TL()Ec /AF f D( +or +)0 9 1 A(xpaget)9 0 TN TL()Ec /AF f D( +at the command line, or +)0 31 1 A(XPAGet\201\202)31 0 TN TL()Ec /AF f D( +or +)0 32 1 A(XPASet\201\202)32 0 TN TL()Ec /AF f D( +in programs, e.g: +) 5 30 PR( xpaget ds9 -acl + xpaget ds9 -help + xpaget ds9 env FOO + + xpaset -p ds9 env FOO foofoo)RP( +With the exception of )BD(-help)ES( and )BD(-version)ES(, reserved +sub-commands are available only on the machine on which the XPA server +itself is running. + +The following reserved sub-commands are defined for all access points: +)0 DL( +)0 P()0 DT()BD(-acl)ES( get \201set\202 the access control list [options: host type acl, for set] +)DD( +The 'xpaset' option allows you to add a new acl for a given host, or change +the acl for an existing host. See +)0 41 1 A(XPA Access Control)41 0 TN TL()Ec /AF f D( +for more information. +This access point is available only on the server machine. + +)0 P()0 DT()BD(-env)ES( get \201set\202 an environment variable [options: name \201value, for set\202] +)DD(The 'xpaget' option will return the value of the named environment +variable. The 'xpaset' option will set the value of the names +variable to the specified value. +This access point is available only on the server machine. +\201Please be advised that we have had problems setting environment +variables in static Tcl/Tk programs such as ds9 running under Linux.\202 + +)0 P()0 DT( )BD(-clipboard)ES( set\201get\202 information on a named clipboard +)DD( Clients can store ASCII state information on any number of named +clipboards. Clipboards of the same name created by clients on +different machines are kept separate. The syntax for creating a +clipboard is: +) 2 65 PR( [data] | xpaset [server] -clipboard add|append [clipboard_name] + xpaset -p [server] -clipboard delete [clipboard_name])RP( +Use "add" to create a new clipboard or replace the contents of an existing +one. Use "append" to append to an existing clipboard. +)0 P(Information on a named clipboard is retrieved using: +) 1 45 PR( xpaget [server] -clipboard [clipboard_name])RP( +)0 P()0 DT()BD(-exec)ES( set: execute commands from buffer [options: none] +)DD(If -exec is specified in the paramlist of an 'xpaset' call, then further +sub-commands will be retrieved from the data buffer. + +)0 P()0 DT()BD(-help)ES( get: return help string for this XPA or sub-command [options: name \201for sub-commands\202] +)DD(Each XPA access point and each XPA sub-command can have a help string +associated with it that is specified when the access point is defined. +The -help option will return this help string. For XPA access points +that contain user-defined sub-commands, you can get the help string +for a particular sub-command by specifying its name, or else get the +help strings for all sub-commands if not name is specified. + +)0 P()0 DT()BD(-ltimeout)ES( get \201set\202 the long timeout value [options: seconds|reset] +)DD(The 'xpaget' option will return the value of the long timeout \201in seconds\202. +The 'xpaset' option will set the value of the long timeout. If "reset" is +specified, then the timeout value will be reset to the default value. + +)0 P()0 DT()BD(-nsconnect)ES( set: re-establish name server connection to all XPA's [options: none] +)DD(If the +)0 14 1 A(XPA Name Server \201xpans\202)14 0 TN TL()Ec /AF f D( +process has terminated unexpectedly and then re-started, this +sub-command can be used to re-establish the connection. You use it by +sending the command to the [name:port] or [file] of the access point +instead of to the XPA name \201since the latter requires the xpans +connection!\202: +) 1 36 PR( xpaset -p 838e2f67:1268 -nsconnect)RP( +See )0 14 1 A(xpans)14 0 TN TL()Ec /AF f D( for more information. + +)0 P()0 DT()BD(-nsdisconnect)ES( set: break name server connection to all XPA's [options: none] +)DD(This sub-command will terminate the connection to the +)0 14 1 A(XPA Name Server \201xpans\202)14 0 TN TL()Ec /AF f D(, thereby making +all access points inaccessible except through their underlying [name:port] +or [file] identifiers. I forget why we added it, it seems pretty useless. + +)0 P()0 DT()BD(-stimeout)ES( get \201set\202 the short timeout value [options: seconds|reset] +)DD(The 'xpaget' option will return the value of the short timeout \201in seconds\202. +The 'xpaset' option will set the value of the short timeout. If "reset" is +specified, then the timeout value will be reset to the default value. + +)0 P()0 DT()BD(-remote)ES( set: register xpa with remote server [options: host[:port] [acl]] [-proxy] +)DD(This sub-command will register the XPA access point with the XPA name +server \201xpans\202 on the specified host \201which must already be running\202. +The specified host also is given access control to the access point, +using the specified acl or the default acl of "+" \201meaning the remote +host can xpaset, xpaget, xpainfo or xpaaccess\202. If the acl is +specified as "-", then the access point is unregistered. +See )0 6 1 A(Communication Between Machines)6 0 TN TL()Ec /AF f D( +for more information on how this sub-command is used. + +)0 P()0 DT()BD(-version)ES( get: return XPA version string [options: none] +)DD(The version refers to the version of XPA used to define this access point +\201currently something like 2.0\202. +)LD( + +)0 P(You can add your own reserved commands to all XPA access points by using the +)0 18 1 A(XPACmdAdd\201\202)18 0 TN TL()Ec /AF f D( +routine, passing the XPA handle returned by )EM(XPA XPAGetReserved\201void\202)ES( +as the first argument. Note again that these will only be available on the +machine where the XPA service is running. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 15 H(Last)WB 67 Sn( updated: September 10, 2003)EH( +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (method.html) D +/Ti (XPA Communication Methods) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 5 Sn( + + +)0 2 16 H(XPAMethod:)WB 69 Sn()WB 68 Sn( )EA(XPA Communication Methods)EH( + + +)0 2 17 H(Summary)WB 70 Sn()EH( +)0 P(XPA supports both inet and unix \201local\202 socket communication. + + +)0 2 18 H(Description)WB 71 Sn()EH( +)0 P(XPA uses sockets for communication between processes. It supports +three methods of socket communication: inet, localhost, and unix. In +general, the same method should be employed for all XPA processes in a +session and the global environment variable XPA_METHOD should be used +to set up the desired method. By default, the preferred method is +"inet", which is appropriate for most users. You can set up a +different method by typing something like: +) 3 70 PR( setenv XPA_METHOD local # unix csh + XPA_METHOD=local; export XPA_METHOD # unix sh, bash, windows/cygwin + set XPA_METHOD=localhost # dos/windows)RP( +The options for XPA_METHOD are: )BD(inet)ES(, )BD(unix)ES( \201or +)BD(local)ES(\202, and )BD(localhost)ES(. On Unix machines, this +environment setup command can be placed in your shell init file +\201.cshrc, .profile, .bashrc, etc.\202 On Windows platforms, it can be +placed in your AUTOEXEC.BAT file \201I think!\202. + +)0 P(By default, )BD(inet)ES( sockets are used by XPA. These are the standard +Internet sockets that are used by programs such as Netscape, +ftp. etc. Inet sockets utilize the IP address of the given machine and +a \201usually random\202 port number to communicate between processes on the +same machine or between different machines on the Internet. \201Note that +XPA has an )0 41 1 A(Access Control)41 0 TN TL()Ec /AF f D( mechanism to +prevent unauthorized access of XPA access points by other computers on +the Net\202. For users connected to the Internet, this usually is the +appropriate communication method. For more information about setting +up XPA communication between machines, see +)0 6 1 A(Communication Between Machines)6 0 TN TL()Ec /AF f D(. + +)0 P(In you are using XPA on a machine without an Internet connection, then +inet sockets are not appropriate. In fact, an XPA process often will +hang for many seconds while waiting for a response from the Domain +Name Service \201DNS\202 when using inet sockets. Instead of inet sockets, +users on Unix platforms can also use )BD(unix)ES( sockets \201also known +as local sockets\202. These sockets are based on the local file system +and do not make use of the DNS. They generally are considered to be +faster than inet sockets, but they are not implemented under +Windows. Use local sockets as a first resort if you are on a Unix +machine that is not connected to the Internet. + +)0 P(Users not connected to the Internet also can use )BD(localhost)ES( +sockets. These are also inet-type sockets but the IP address used for +the local machine is the )BD(localhost)ES( address, 0x7F000001, instead +of the real IP of the machine. Depending on how sockets are set up for +a given platform, communication with the DNS usually is not required in +this case \201though of course, XPA cannot interact with other machines\202. +The localhost method will generally work on both Unix and Windows +platforms, but whether the DNS is required or not is subject to +individual configurations. + +)0 P(A final warning/reminder: if your XPA-enabled server hangs at startup +time and your XPA_METHOD is )BD(inet)ES(, the problem probably is +related to an incorrect Internet configuration. This can be confirmed +by using the )BD(unix)ES( method or \201usually\202 the )BD(localhost)ES( +method. You can use these alternate methods if other hosts do not need +access to the XPA server. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 19 H(Last)WB 72 Sn( updated: September 10, 2003)EH( +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (inet.html) D +/Ti (XPA Communication Between Hosts) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 6 Sn( + + +)0 2 20 H(XPAInet:)WB 74 Sn()WB 73 Sn( XPA Communication Between Hosts)EA()EH( + + +)0 2 21 H(Summary)WB 75 Sn()EH( +XPA uses standard inet sockets to support communication between two or +more host computers. + + +)0 2 22 H(Description)WB 76 Sn()EH( +)0 P(When the )0 5 1 A(Communication Method)5 0 TN TL()Ec /AF f D( is set to +)BD(inet)ES( \201as it is by default\202, XPA can be used to communicate +between different computers on the Internet. INET sockets utilize the +IP address of the given machine and a \201usually random\202 port number to +communicate between processes on the same machine or between different +machines on the Internet. These standard Internet sockets are also +used by programs such as Netscape, ftp. etc. + +)0 P(XPA supports a host-based )0 41 1 A(Access Control)41 0 TN TL()Ec /AF f D( mechanism +to prevent unauthorized access of XPA access points by other computers +on the Net. By default, only the machine on which the XPA server is +running can access XPA services. Therefore, setting up communication +between a local XPA server machine and a remote client machine +requires a two-part registration process: + +)UL()-1 LI( the XPA service on the local machine must be made known to the +remote machine +)-1 LI( the remote machine must be given permission to access the local +XPA service)LU( + +Three methods by which this remote registration can be accomplished +are described below. + +)0 2 23 H(Manual)WB 77 Sn( Registration)EH( + +The first method is the most basic and does not require the remote +client to have xpans running. To use it, the local server simply +gives a remote client machine access to one or more XPA access points +using xpaset and the )BD(-acl)ES( sub-command. For example, +consider the XPA test program "stest" running on a local machine. By +default the access control for the access point named "xpa" is +restricted to that machine: +) 3 25 PR( [sh]$ xpaget xpa -acl + *:* 123.456.78.910 gisa + *:* localhost gisa)RP( +Using xpaset and the )BD(-acl)ES( sub-command, a remote client +machine can be given permission to perform xpaget, xpaset, xpaaccess, +or xpainfo operations. For example, to allow the xpaget operation, the +following command can be issued on the local machine: +) 1 45 PR( [sh]$ xpaset -p xpa -acl "remote_machine g")RP( +This results in the following access permissions on the local machine: +) 4 26 PR( [sh]$ xpaget xpa -acl + XPA:xpa 234.567.89.012 g + *:* 123.456.78.910 gisa + *:* localhost gisa)RP( + +The remote client can now use the local server's xpans name server to +establish communication with the local XPA service. This can be done +on a call-by-call basis using the )BD(-i)ES( switch on xpaset, xpaget, etc: +) 6 43 PR( [sh]$ xpaget -i "local_machine:12345" xpa + class: XPA + name: xpa + method: 88877766:2778 + sendian: little + cendian: big)RP( +Alternatively, the XPA_NSINET variable on the remote machine can be +set to point directly to xpans on the local machine, removing +the need to override this value each time an XPA program is run: +) 7 42 PR( [csh]$ setenv XPA_NSINET 'karapet:$port' + [csh]$ xpaget xpa + class: XPA + name: xpa + method: 88877766:2778 + sendian: little + cendian: big)RP( +Here, '$port' means to use the default XPA name service port \20114285\202. +not a port environment variable. + +)0 P(Access permission for remote client machines can be stored in a file +on the local machine pointed to by the )BD(XPA_ACLFILE)ES( environment +variable or using the )BD(XPA_DEFACL)ES( environment variable. See )0 41 1 A(XPA Access Control)41 0 TN TL()Ec /AF f D( for more information. + +)0 2 24 H(Remote)WB 78 Sn( Registration)EH( + +If xpans is running on the remote client machine, then a local xpaset +command can be used with the )BD(-remote)ES( sub-command to +register the local XPA service in the remote name service, while at +the same time giving the remote machine permission to access the local +service. For example, assume again that "stest" is running on the +local machine and that xpans is also running on the remote machine. +To register access of this local xpa on the remote machine, use +the xpaset and the )BD(-remote)ES( sub-command: +) 1 56 PR( [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' +)RP( +To register the local xpa access point on the remote machine with xpaget +access only, execute: +) 1 56 PR( [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g)RP( +Once the remote registration command is executed, the remote client +machine will have an entry such as the following in its own xpans name +service: +) 2 31 PR( [csh]$ xpaget xpans + XPA xpa gs 88877766:2839 eric)RP( +The xpa access point can now be utilized on the remote machine without +further setup: +) 6 23 PR( [csh]$ xpaget xpa + class: XPA + name: xpa + method: 838e2f68:2839 + sendian: little + cendian: big)RP( +To unregister remote access from the local machine, use the same +command but with a '-' argument: +) 1 54 PR( [sh]$ xpaset -p xpa -remote 'remote_machine:$port' -)RP( +The benefit of using remote registration is that communication with +remote access points can be mixed with that of other access points +on the remote machine. Using )0 3 1 A(Access Point +Names and Templates)3 0 TN TL()Ec /AF f D(, one XPA command can be used to send or +receive messages to the remote and local services. + +)0 2 25 H(XPANS)WB 79 Sn( Proxy Registration)EH( + +The two methods described above are useful when the local and remote +machines are able to communicate freely to one another. This would be +the case on most Local Area Networks \201LANs\202 where all machines are +behind the same firewall and there is no port blocking between +machines on the same LAN. The situation is more complicated when the +XPA server is behind a firewall, where outgoing connections are +allowed, but incoming port blocking is implemented to prevent machines +outside the firewall from connecting to machines inside the +firewall. Such incoming port blocking will prevent xpaset and xpaget +from connecting to an XPA server inside a firewall. + +)0 P(To allow locally fire-walled XPA services to register with remote +machines, we have implemented a proxy service within the xpans name +server. To register remote proxy service, xpaset and the +)BD(-remote)ES( sub-command is again used, but with an additional +)BD(-proxy)ES( argument added to the end of the command: +) 1 63 PR( [sh]$ ./xpaset -p xpa -remote 'remote_machine:$port' g -proxy)RP( +Once a remote proxy registration command is executed, the remote +machine will have an entry such as the following in its own xpans name +service: +) 2 32 PR( [csh]$ xpaget xpans + XPA xpa gs @88877766:2839 eric)RP( +The '@' sign in the name service entry indicates that xpans proxy +processing is being used for this access point. Other than that, from +the user's point of view, there is no difference in how this XPA +access point is contacted using XPA programs \201xpaset, xpaget, etc.\202 or +libraries: +) 6 23 PR( [csh]$ xpaget xpa + class: XPA + name: xpa + method: 88877766:3053 + sendian: little + cendian: big)RP( +)0 P(Of course, the underlying processing of the XPA requests is very much +different when xpans proxy is involved. Instead of an XPA program such +contacting the XPA service directly, it contacts the local xpans. +Acting as a proxy server, xpans communicates with the XPA service +using the command channel established at registration time. Commands +\201including establishing a new data channel\202 are sent between xpans and +the XPA service to set up a new message transfer, and then data is fed +to/from the xpa request, through xpans, from/to the XPA service. In +this way, it can be arranged so that connections between the +fire-walled XPA service and the remote client are always initiated by +the XPA service itself. Thus, incoming connections that would be +blocked by the firewall are avoided. Note that there is a performance +penalty for using the xpans/proxy service. Aside from extra overhead +to set up proxy communication, all data must be sent through the +intermediate proxy process. + +)0 P(The xpans proxy scheme requires that the remote client allow the local +XPA server machine to connect to the remote xpans/proxy server. If the +remote client machine also is behind a port-blocking firewall, such +connections will be disallowed. In this case, the only solution is to +open up some ports on the remote client machine to allow incoming +connections to xpans/proxy. Two ports must be opened \201for command and +data channel connections\202. By default, these two ports are 14285 and +14287. The port numbers can be changed using the )BD(XPA_NSINET)ES( +environment variable. This variable takes the form: +) 1 49 PR( setenv XPA_NSINET machine:port1[,port2[,port3]])RP( +where port1 is the main connecting port, port2 is the XPA access port, +and port3 is the secondary data connecting port. The second and third +ports are optional and default to port1+1 and port1+2, respectively. +It is port1 and port3 that must be left open for incoming connections. + +)0 P(For example, to change the port assignments so that xpans listens +for registration commands on port 12345 and data commands on port 28573: +) 1 32 PR( setenv XPA_NSINET myhost:12345)RP( +Alternatively, all three ports can be assigned explicitly: +) 1 43 PR( setenv XPA_NSINET remote:12345,3000,12346)RP( +In this case 12345 and 12346 should be open for incoming connections. +The XPA access port \201which need not be open to the outside +world\202 is set to 3000. + +)0 P(Finally, note that we currently have no mechanism to cope with +Internet proxy servers \201such as SOCKS servers\202. If an XPA service is +running on a machine that cannot connect directly to outside machines, +but goes through a proxy server instead, there currently is no way to +register that XPA service with a remote machine. We hope to implement +support for SOCKS proxy in a future release. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 26 H(Last)WB 80 Sn( updated: September 10, 2003)EH( +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (users.html) D +/Ti (Distinguishing Users) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 7 Sn( + + +)0 2 27 H(XPAUsers:)WB 82 Sn()WB 81 Sn( Distinguishing Users)EA()EH( + + +)0 2 28 H(Summary)WB 83 Sn()EH( +)0 P(XPA normally distinguishes between users on a given host, but it is possible +to send data to access points belonging to other users. + + +)0 2 29 H(Description)WB 84 Sn()EH( +)0 P(A single XPA name service typically serves all users on a given +machine. Two users can register the same XPA access points on the +same machine without conflict, because the user's username is +registered with each access point and, by default, programs such as +xpaget and xpaset only process access points of the appropriate user. +For example: +) 4 32 PR( XPA xpa1 gs 838e2f67:1262 eric + XPA xpa2 gs 838e2f67:1266 eric + XPA xpa1 gs 838e2f67:2523 john + XPA xpa2 gs 838e2f67:2527 john)RP( +Here the users "eric" and "john" both have registered the access +points xpa1 and xpa2. When either "john" or "eric" retrieves +information from xpa1, they will process only the access point +registered in their user name. + +)0 P(If you want to access another user's XPA access points on a single +machine, use the -u [user] option on xpaset, xpaget, etc. For example, +if eric executes: +) 1 21 PR( xpaget -u john xpa1)RP( +he will access John's xpa1 access point.Use "*" to access all users +on a given machine: +) 1 20 PR( xpaget -u "*" xpa1)RP( +Note that the )0 40 1 A(XPA Environment Variable)40 0 TN TL()Ec /AF f D( +XPA_NSUSERS can be used to specify the default list of users to +process: +) 1 32 PR( setenv XPA_NSUSERS "eric,john")RP( +will cause access points from both "eric" and "john" to be processed +by default. + + + + + +)0 P()0 0 1 A(Go to XPA Help Index)0 0 TN TL()Ec /AF f D( + +)0 5 30 H(Last)WB 85 Sn( updated: September 10, 2003)EH( +)WB NL +/Cb Db D /Ct [16#00 16#00 16#00] D /Cl [16#00 16#00 16#00] D /CL -1 D Ct Sc +DS +/Ba f D /BO 0 D Bs +/UR (programs.html) D +/Ti (XPA Programs) D +/Au () D +/Df f D +/ME [()] D + +0 BO R +()1 Sl()WB 8 Sn( +)0 2 31 H(XPA)WB 86 Sn( Programs)EH( + +)0 2 32 H(Summary)WB 87 Sn()EH( + +)0 P(Use the XPA programs to send/receive data to/from XPA servers from the +command line or from scripts. + +)0 P() 7 116 PR( | xpaset [-h] [-i nsinet] [-m method] [-n] [-p] [-s] [-t sval,lval] [-u users] [-v]