From 69d6b16e477b9b6f5895d0e10b3bc1db150eaad0 Mon Sep 17 00:00:00 2001 From: Scott Alfter Date: Wed, 28 Jun 2023 22:10:24 -0700 Subject: [PATCH] initial commit from tarball retrieved from the Internet Archive: https://web.archive.org/web/20021127142540/http://www.lprng.com/DISTRIB/UNIXTOOLS/lp_server/lp_server-1.1.6.tgz --- CHANGES | 14 + COPYING | 339 +++ Copyright | 23 + INSTALL | 170 ++ LICENSE | 24 + Makefile.in | 152 ++ README | 16 + UPDATE | 10 + VERSION | 1 + acconfig.h | 359 ++++ config.guess | 693 +++++++ config.h.in | 570 ++++++ config.sub | 927 +++++++++ configure | 5215 +++++++++++++++++++++++++++++++++++++++++++++++ configure.in | 759 +++++++ install-sh | 238 +++ man/Makefile.in | 49 + man/lp_server.8 | 138 ++ man/lp_server.n | 138 ++ src/Makefile.in | 95 + src/common.h | 67 + src/log.c | 400 ++++ src/lp_server.c | 307 +++ src/portable.h | 761 +++++++ src/snprintf.c | 277 +++ src/stty.c | 1002 +++++++++ src/version.h | 1 + 27 files changed, 12745 insertions(+) create mode 100644 CHANGES create mode 100644 COPYING create mode 100644 Copyright create mode 100644 INSTALL create mode 100644 LICENSE create mode 100644 Makefile.in create mode 100644 README create mode 100644 UPDATE create mode 100644 VERSION create mode 100644 acconfig.h create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100755 install-sh create mode 100644 man/Makefile.in create mode 100644 man/lp_server.8 create mode 100644 man/lp_server.n create mode 100644 src/Makefile.in create mode 100644 src/common.h create mode 100644 src/log.c create mode 100644 src/lp_server.c create mode 100644 src/portable.h create mode 100644 src/snprintf.c create mode 100644 src/stty.c create mode 100644 src/version.h diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..eead92f --- /dev/null +++ b/CHANGES @@ -0,0 +1,14 @@ +Version 1.1.6 Mon Sep 17 16:52:46 PDT 2001 + - fixed up nonblocking open, changed to blocking + read/write after open. + - fixed up the SO_REUSE + - fixed make files for Gmake and FreeBSD Make + +Version 1.1.3 Sun Mar 29 16:55:23 PST 1998 + Makefile modified for BSD compatibility + Fixed configure.in + +Version 1.1.2 + Bug Fixes: + Minor fumbling with IO, using select() + (Patches by: Chris O'Regan" ) diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Copyright b/Copyright new file mode 100644 index 0000000..ed6cd6f --- /dev/null +++ b/Copyright @@ -0,0 +1,23 @@ + *************************************************************************** + * LPRng - An Extended Print Spooler System + * + * Copyright 1988-1997 Patrick Powell, San Diego, CA + * papowell@sdsu.edu + * See LICENSE for conditions of use. + * + *************************************************************************** + * MODULE: LICENSE + * PURPOSE: terms and conditions + * Copyright,v 1.1 1997/05/30 18:53:30 papowell Exp + ************************************************************************** + +Use and distribution of this software is covered by the GNU COPYING +license. Please refer to this for terms and conditions. + +This software incorporates code from other sources; see the file +Copyright.c in this distribution for general copyright information. +Individual source files have their copyrights as well, where +applicable. + +Patrick Powell +Mon Jul 10 07:01:54 PDT 1995 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..e7d3814 --- /dev/null +++ b/INSTALL @@ -0,0 +1,170 @@ +LPRng Installation +(Based on the AUTOCONF configuration facility) +============================================= + + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. In the same directory as these instructions, execute + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. This will create the executables + in the source directory. + + 3. Change to the TESTINSTALL directory and run make again. This will + up a test version of the software. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source 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'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Using a Different Build Directory +================================= + + You can compile the package in a different directory from the one +containing the source code. Doing so allows you to compile it on more +than one kind of computer at the same time. To do this, you must use a +version of `make' that supports the `VPATH' variable, such as GNU +`make'. `cd' to the directory where you want the object files and +executables to go and run the `configure' script. `configure' +automatically checks for the source code in the directory that +`configure' is in and in `..'. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + 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' + 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. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ce16de3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ + *************************************************************************** + * LPRng - An Extended Print Spooler System + * + * Copyright 1988-1995 Patrick Powell, San Diego State University + * papowell@sdsu.edu + * See LICENSE for conditions of use. + * + *************************************************************************** + * MODULE: LICENSE + * PURPOSE: terms and conditions + * LICENSE,v 1.1 1997/05/30 18:53:30 papowell Exp + ************************************************************************** + + +Use and distribution of this software is covered by the GNU COPYING +license. Please refer to this for terms and conditions. + +This software incorporates code from other sources; see the file +copyright.c in this distribution for general copyright information. +Individual source files have their copyrights as well, where +applicable. + +Patrick Powell +Mon Jul 10 07:01:54 PDT 1995 diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..7068db8 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,152 @@ +########################################################################### +# LPRng - An Extended Print Spooler System +# +# Copyright 1988-1995 Patrick Powell, San Diego State University +# papowell@sdsu.edu +# See LICENSE for conditions of use. +# +########################################################################### +# MODULE: Makefile.in +# PURPOSE: top level Makefile for LPD Software +# $Id: Makefile.in,v 1.4 1998/03/30 00:05:05 papowell Exp papowell $ +########################################################################## + +SRC=@srcdir@ +@SET_MAKE@ + +#============================================================================= +# List the directories you want to generate: +# DIRS for all, clean, etc. +# ALLDIRS for other such as documentation +#============================================================================= + +DIRS= src man +ALLDIRS= $(DIRS) +TARGET=monitor ifhp + +# define default target +MAKETARGET=all + +all: $(DIRS) + +.PHONY: all clean install tar ci cifiles DIRS $(ALLDIRS) warn +#force phony target to be made + +$(ALLDIRS): + cd $@; $(MAKE) $(MAKETARGET) + +############################################################################### + +install: + $(MAKE) MAKETARGET=$@ $(DIRS) + +############################################################################### + +ci: cifiles + if test ! -d RCS ; then mkdir RCS; fi; + $(MAKE) MAKETARGET=$@ $(ALLDIRS) + +CI= +CO=-kv + +cifiles: newmake + if test ! -d RCS ; then mkdir RCS; fi; + checkin() { \ + rcs -l $$1 ; \ + ci $(CI) -mUpdate -t-Initial $$1; \ + co $(CO) $$1; \ + }; \ + for i in *; do \ + if test -f "$$i" ; then \ + case "$$i" in \ + config.h.in ) checkin $$i;; \ + config.* ) ;; \ + * ) checkin $$i ;; \ + esac; \ + fi; \ + done; + +newmake: + for i in Makefile.in */Makefile.in ; do \ + d=`dirname $$i`; b=`basename $$i .in`; c=$${d}/$${b}.bsd.in; \ + sed -e '/^#GNU/,/^#/d' -e 's/^#BSD.//' -e 's/$$^/$$>/' \ + -e 's/^if /.if /' -e 's/^endif/.endif/' $$i >/tmp/Makefile.bsd.in; \ + rm -f $$c; cp /tmp/Makefile.bsd.in $$c;\ + done + + +############################################################################### + +clean: + -rm -f *.o core $(TARGET) + $(MAKE) MAKETARGET=$@ $(DIRS) + +realclean distclean: clean + $(MAKE) MAKETARGET=distclean $(DIRS) + -rm -f Makefile Makefile.bsd \ + config.cache config.h config.log config.status + +############################################################################### + +shar: + DIR=`pwd | sed 's,.*/,,' `; \ + if [ ! -f /tmp/$${DIR}.tgz ]; then \ + echo You must make TAR file first; \ + exit 1; \ + fi; \ + cd ..; tar ztf /tmp/$${DIR}.tgz | sed -e '/\/$$/d' | \ + shar -S -n $${DIR} -a -s papowell@sdsu.edu \ + -c -o /tmp/$${DIR}-Part -L100 + +dist: clean + echo RCS >/tmp/L_X + echo Makefile >>/tmp/L_X + echo Makefile.bsd >>/tmp/L_X + echo core >>/tmp/L_X + echo '?' >>/tmp/L_X + echo '*.o' >>/tmp/L_X + echo '*.a' >>/tmp/L_X + echo '*.sh' >>/tmp/L_X + for i in $(TARGET) Makefile config.cache config.h config.log config.status; \ + do echo \*/$$i >>/tmp/L_X; done + cat /tmp/L_X + DIR=`pwd | sed 's,.*/,,' `; \ + cd ..; \ + tar zXcfv /tmp/L_X $${DIR}.tgz $${DIR}; \ + md5 $${DIR}.tgz |pgp -fast > $$DIR.tgz.md5 + +cifast: + find . -type f -newer VERSION -print \ + | sed \ + -e '/core$$/d' \ + -e '/RCS/d' \ + -e '/\.o$$/d' \ + -e '/.*liblpr.a$$/d' \ + -e '/.*checkpc$$/d' \ + -e '/.*lpr$$/d' \ + -e '/.*lpd$$/d' \ + -e '/.*lpq$$/d' \ + -e '/.*lprm$$/d' \ + -e '/.*lpc$$/d' \ + -e '/.*lpbanner$$/d' \ + -e '/.*lpf$$/d' \ + -e '/.*lpraccnt$$/d' \ + >/tmp/list + echo README >>/tmp/list + cat /tmp/list + checkin() { \ + rcs -l $$1 ; \ + ci $(CI) -mUpdate -t-Initial $$1; \ + co $(CO) $$1; \ + }; \ + for i in ` cat /tmp/list `; do \ + checkin $$i; \ + done; + +update: + for i in src/version.h VERSION; do \ + chmod +w $$i; \ + done; + pwd | sed -n -e 's,.*/,,' -e 's,.*,#define VERSION "&",p' > src/version.h + pwd | sed -n -e 's,.*/,,' -e 's,.*,VERSION &,p' > VERSION + (cd man; $(MAKE) update) diff --git a/README b/README new file mode 100644 index 0000000..ddd2ed8 --- /dev/null +++ b/README @@ -0,0 +1,16 @@ + README for lp_server + =================== + + Fri May 30 09:40:17 PDT 1997 + +This program allows you to 'export' a printer on your local host +to be used by an LPRng spooler. It is basically simulating an +HP JetDirect interface, which opens a connection on port 9100 +and simply dumps input to the PostScript Engine. + +lp_server [-n port] [-t stty_options] [-d device] + + -n port - listen (bind) to this port for incoming connections + -d device - the device to open + -t stty_options - a list of stty options, similar (i.e.- identical) + to those used by other filters supplied with LPRng. diff --git a/UPDATE b/UPDATE new file mode 100644 index 0000000..f376696 --- /dev/null +++ b/UPDATE @@ -0,0 +1,10 @@ +#!/bin/sh +DIR=`pwd | sed -e 's,.*/,,'` +PREFIX=`echo $DIR | sed -e 's,-.*,,'` +TAIL=`echo $DIR | sed -e 's,^[^-]*-,,'` +LAST=`echo $TAIL | sed -e 's,^.*\.,,'` +BEFORE=`echo $TAIL | sed -e 's,\.[0-9]*$,.,'` +INCR=`expr $LAST "+" 1` +NEW=$PREFIX-$BEFORE$INCR +cd ..; mv $DIR $NEW; rm -f $PREFIX; +ln -s $NEW $PREFIX diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..444a5d6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +VERSION lp_server-1.1.6 diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 0000000..a029057 --- /dev/null +++ b/acconfig.h @@ -0,0 +1,359 @@ +/* acconfig.h + This file is in the public domain. + + Descriptive text for the C preprocessor macros that + the distributed Autoconf macros can define. + No software package will use all of them; autoheader copies the ones + your configure.in uses into your configuration header file templates. + + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). Although this order + can split up related entries, it makes it easier to check whether + a given entry is in the file. + + Leave the following blank line there!! Autoheader needs it. */ + + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if using ARCHITECTURE */ +#undef ARCHITECTURE + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define if type char is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +#undef __CHAR_UNSIGNED__ +#endif + +/* Define if the closedir function returns void instead of int. */ +#undef CLOSEDIR_VOID + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define for DGUX with . */ +#undef DGUX + +/* Define if you have . */ +#undef DIRENT + +/* Define to the type of elements in the array set by `getgroups'. + Usually this is either `int' or `gid_t'. */ +#undef GETGROUPS_T + +/* Define if the `getloadavg' function needs to be run setuid or setgid. */ +#undef GETLOADAVG_PRIVILEGED + +/* Define if the `getpgrp' function takes no argument. */ +#undef GETPGRP_VOID + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have a broken TIOCEXCL (IRIX 5) */ +#undef HAVE_BROKEN_TIOCEXCL + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if contains a declaration for extern int errno */ +#undef HAVE_ERRNO_DECL + +/* Define if you do not have gethostname() defined */ +#undef HAVE_GETHOSTNAME_DEF + +/* Define if your system has its own `getloadavg' function. */ +#undef HAVE_GETLOADAVG + +/* Define if you have the getmntent function. */ +#undef HAVE_GETMNTENT + +/* Define if you have to use getpgrp(0) to get process group */ +#undef HAVE_GETPGRP_0 + +/* Define if you have innetgr() defined in include file */ +#undef HAVE_INNETGR_DEF + +/* Define if the `long double' type works. */ +#undef HAVE_LONG_DOUBLE + +/* Define if you support file names longer than 14 characters. */ +#undef HAVE_LONG_FILE_NAMES + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define if you have a openlog prototype. */ +#undef HAVE_OPENLOG_DEF + +/* Define if system calls automatically restart after interruption + by a signal. */ +#undef HAVE_RESTARTABLE_SYSCALLS + +/* Define if you have to use setpgrp(0,0) to set process group */ +#undef HAVE_SETPGRP_0 + +/* Define if you do have setproctitle() defined */ +#undef HAVE_SETPROCTITLE_DEF + +/* Define if your struct stat has st_blksize. */ +#undef HAVE_ST_BLKSIZE + +/* Define if your struct stat has st_blocks. */ +#undef HAVE_ST_BLOCKS + +/* Define if you have the strcoll function and it is properly defined. */ +#undef HAVE_STRCOLL + +/* Define if your struct stat has st_rdev. */ +#undef HAVE_ST_RDEV + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if we have a BSD-ish struct exec in */ +#undef HAVE_STRUCT_EXEC + +/* Define if sys_errlist has the error strings. */ +#undef HAVE_SYS_ERRLIST + +/* Define if sys_errlist is defined. */ +#undef HAVE_SYS_ERRLIST_DEF + +/* Define if sys_nerr has number of err strings. */ +#undef HAVE_SYS_NERR + +/* Define if sys_nerr has definition. */ +#undef HAVE_SYS_NERR_DEF + +/* Define if sys_siglist has the signal strings. */ +#undef HAVE_SYS_SIGLIST + +/* Define if _sys_siglist has the signal strings. */ +#undef HAVE__SYS_SIGLIST + +/* Define if sys_siglist is defined in unistd.h include file */ +#undef HAVE_SYS_SIGLIST_DEF + +/* Define if sys_siglist has the signal strings. */ +#undef HAVE__SYS_SIGLIST_DEF + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if tgetstr() has definition */ +#undef HAVE_TGETSTR_DEF + +/* Define if your struct tm has tm_zone. */ +#undef HAVE_TM_ZONE + +/* Define if you don't have tm_zone but do have the external array + tzname. */ +#undef HAVE_TZNAME + +/* Use the "union wait" union to get process status from wait3/waitpid */ +#undef HAVE_UNION_WAIT + +/* Define if you have . */ +#undef HAVE_UNISTD_H + +/* Define if utime(file, NULL) sets file's timestamp to the present. */ +#undef HAVE_UTIME_NULL + +/* Define if you have . */ +#undef HAVE_VFORK_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define if you have the wait3 system call. */ +#undef HAVE_WAIT3 + +/* HP/UX */ +#undef HPUX + +/* HP/UX source */ +#undef _HPUX_SOURCE + +/* Define if the struct in6_addr is defined */ +#undef IN6_ADDR + +/* Define if the LINUX struct in_addr6 is defined */ +#undef IN_ADDR6 + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if int is 16 bits instead of 32. */ +#undef INT_16_BITS + +/* Define if long int is 64 bits. */ +#undef LONG_64_BITS + +/* Define if major, minor, and makedev are declared in . */ +#undef MAJOR_IN_MKDEV + +/* Define if major, minor, and makedev are declared in . */ +#undef MAJOR_IN_SYSMACROS + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + + +/* Define if you don't have , but have . */ +#undef NDIR + +/* Define if you have , and doesn't declare the + mem* functions. */ +#undef NEED_MEMORY_H + +/* Define if your struct nlist has an n_un member. */ +#undef NLIST_NAME_UNION + +/* Define if you have . */ +#undef NLIST_STRUCT + +/* Define if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define if the setvbuf function takes the buffering type as its second + argument and the buffer pointer as the third, as on System V + before release 3. */ +#undef SETVBUF_REVERSED + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define on SUN Solaris */ +#undef SOLARIS + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you have struct stat with st_mtime_nsec */ +#undef ST_MTIME_NSEC + +/* Define on SunOS */ +#undef SUNOS + +/* Define on System V Release 4. */ +#undef SVR4 + +/* Define if you don't have , but have . */ +#undef SYSDIR + +/* Define if you don't have , but have . */ +#undef SYSNDIR + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define if your declares struct tm. */ +#undef TM_IN_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define for Encore UMAX. */ +#undef UMAX + +/* Define for Encore UMAX 4.3 that has + instead of . */ +#undef UMAX4_3 + +/* Define if we are to use the old sgttyb structure and . */ +#undef USE_SGTTYB + +/* Use the statfs structure to find out free space */ +#undef USE_STATFS + +/* Define how to get file system space */ +#undef USE_STATFS_TYPE + +/* Use the statvfs structure to find out free space */ +#undef USE_STATVFS + +/* Define how to change serial line */ +#undef USE_STTY + +/* Use the statfs() func with f_bfree member to find out free space */ +#undef USE_SVR3_STATFS + +/* Define if we are to use the termio structure and TCGETA. */ +#undef USE_TERMIO + +/* Define if we are to use the termios structure and TCGETS. */ +#undef USE_TERMIOS + +/* Use the statfs() func with fs_data member to find out free space */ +#undef USE_ULTRIX_STATFS + +/* Define if you do not have , index, bzero, etc.. */ +#undef USG + +/* Define vfork as fork if vfork does not work. */ +#undef vfork + +/* Define if the closedir function returns void instead of int. */ +#undef VOID_CLOSEDIR + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define if lex declares yytext as a char * by default, not a char[]. */ +#undef YYTEXT_POINTER + + +/* Leave that blank line there!! Autoheader needs it. + If you're adding to this file, keep in mind: + The entries are in sort -df order: alphabetical, case insensitive, + ignoring punctuation (such as underscores). */ diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..e9e4455 --- /dev/null +++ b/config.guess @@ -0,0 +1,693 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + alpha:OSF1:*:*) + # 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 alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'` + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-cbm-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-atari-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-sun-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-apple-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >dummy.c + int main (argc, argv) int argc; char **argv; { + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + ${CC-cc} dummy.c -o dummy \ + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${TARGET_BINARY_INTERFACE}x = x ] ; then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[3478]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; + 9000/8?? ) HP_ARCH=hppa1.0 ;; + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp3[0-9][05]:OpenBSD:*:*) + echo m68k-hp-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo i386-pc-cygwin32 + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin32 + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. + ld_help_string=`ld --help 2>&1` + if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then + echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then + echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then + echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then + echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 + elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then + echo "powerpc-unknown-linux-gnu" ; exit 0 + elif test "${UNAME_MACHINE}" = "alpha" ; then + echo alpha-unknown-linux-gnu ; exit 0 + elif test "${UNAME_MACHINE}" = "sparc" ; then + echo sparc-unknown-linux-gnu ; exit 0 + else + # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us + # useful --help. Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout. + test ! -d /usr/lib/ldscripts/. \ + && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + # Determine whether the default compiler is a.out or elf + cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 + rm -f dummy.c dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 +rm -f dummy.c dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..12efee6 --- /dev/null +++ b/config.h.in @@ -0,0 +1,570 @@ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have . */ +#undef HAVE_VFORK_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define on System V Release 4. */ +#undef SVR4 + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define vfork as fork if vfork does not work. */ +#undef vfork + +/* Define if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define if using ARCHITECTURE */ +#undef ARCHITECTURE + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + + +/* Define if you have a broken TIOCEXCL (IRIX 5) */ +#undef HAVE_BROKEN_TIOCEXCL + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if contains a declaration for extern int errno */ +#undef HAVE_ERRNO_DECL + +/* Define if you do not have gethostname() defined */ +#undef HAVE_GETHOSTNAME_DEF + +/* Define if you have to use getpgrp(0) to get process group */ +#undef HAVE_GETPGRP_0 + +/* Define if you have innetgr() defined in include file */ +#undef HAVE_INNETGR_DEF + +/* Define if you have a openlog prototype. */ +#undef HAVE_OPENLOG_DEF + +/* Define if you have to use setpgrp(0,0) to set process group */ +#undef HAVE_SETPGRP_0 + +/* Define if you do have setproctitle() defined */ +#undef HAVE_SETPROCTITLE_DEF + +/* Define if we have a BSD-ish struct exec in */ +#undef HAVE_STRUCT_EXEC + +/* Define if sys_errlist has the error strings. */ +#undef HAVE_SYS_ERRLIST + +/* Define if sys_errlist is defined. */ +#undef HAVE_SYS_ERRLIST_DEF + +/* Define if sys_nerr has number of err strings. */ +#undef HAVE_SYS_NERR + +/* Define if sys_nerr has definition. */ +#undef HAVE_SYS_NERR_DEF + +/* Define if sys_siglist has the signal strings. */ +#undef HAVE_SYS_SIGLIST + +/* Define if sys_siglist is defined in unistd.h include file */ +#undef HAVE_SYS_SIGLIST_DEF + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if tgetstr() has definition */ +#undef HAVE_TGETSTR_DEF + +/* Use the "union wait" union to get process status from wait3/waitpid */ +#undef HAVE_UNION_WAIT + +/* Define if you have . */ +#undef HAVE_VFORK_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* HP/UX */ +#undef HPUX + +/* HP/UX source */ +#undef _HPUX_SOURCE + +/* Define if the struct in6_addr is defined */ +#undef IN6_ADDR + +/* Define if the LINUX struct in_addr6 is defined */ +#undef IN_ADDR6 + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define to `int' if doesn't define. */ +#undef pid_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* Define on SUN Solaris */ +#undef SOLARIS + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you have struct stat with st_mtime_nsec */ +#undef ST_MTIME_NSEC + +/* Define on SunOS */ +#undef SUNOS + +/* Define on System V Release 4. */ +#undef SVR4 + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Define to `int' if doesn't define. */ +#undef uid_t + +/* Define if we are to use the old sgttyb structure and . */ +#undef USE_SGTTYB + +/* Define how to get file system space */ +#undef USE_STATFS_TYPE + +/* Define how to change serial line */ +#undef USE_STTY + +/* Define if we are to use the termio structure and TCGETA. */ +#undef USE_TERMIO + +/* Define if we are to use the termios structure and TCGETS. */ +#undef USE_TERMIOS + +/* Define vfork as fork if vfork does not work. */ +#undef vfork + +/* Define if you have the cfsetispeed function. */ +#undef HAVE_CFSETISPEED + +/* Define if you have the fcntl function. */ +#undef HAVE_FCNTL + +/* Define if you have the flock function. */ +#undef HAVE_FLOCK + +/* Define if you have the getdtablesize function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the gethostbyname2 function. */ +#undef HAVE_GETHOSTBYNAME2 + +/* Define if you have the gethostname function. */ +#undef HAVE_GETHOSTNAME + +/* Define if you have the getrlimit function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the inet_aton function. */ +#undef HAVE_INET_ATON + +/* Define if you have the inet_ntop function. */ +#undef HAVE_INET_NTOP + +/* Define if you have the inet_pton function. */ +#undef HAVE_INET_PTON + +/* Define if you have the innetgr function. */ +#undef HAVE_INNETGR + +/* Define if you have the killpg function. */ +#undef HAVE_KILLPG + +/* Define if you have the lockf function. */ +#undef HAVE_LOCKF + +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the mktemp function. */ +#undef HAVE_MKTEMP + +/* Define if you have the openlog function. */ +#undef HAVE_OPENLOG + +/* Define if you have the seteuid function. */ +#undef HAVE_SETEUID + +/* Define if you have the setpgid function. */ +#undef HAVE_SETPGID + +/* Define if you have the setproctitle function. */ +#undef HAVE_SETPROCTITLE + +/* Define if you have the setresuid function. */ +#undef HAVE_SETRESUID + +/* Define if you have the setreuid function. */ +#undef HAVE_SETREUID + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the sigprocmask function. */ +#undef HAVE_SIGPROCMASK + +/* Define if you have the sigsetjmp function. */ +#undef HAVE_SIGSETJMP + +/* Define if you have the socketpair function. */ +#undef HAVE_SOCKETPAIR + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the strncasecmp function. */ +#undef HAVE_STRNCASECMP + +/* Define if you have the sysinfo function. */ +#undef HAVE_SYSINFO + +/* Define if you have the tcflush function. */ +#undef HAVE_TCFLUSH + +/* Define if you have the tcsetattr function. */ +#undef HAVE_TCSETATTR + +/* Define if you have the uname function. */ +#undef HAVE_UNAME + +/* Define if you have the wait3 function. */ +#undef HAVE_WAIT3 + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the header file. */ +#undef HAVE_A_OUT_H + +/* Define if you have the header file. */ +#undef HAVE_A_OUT_H + +/* Define if you have the header file. */ +#undef HAVE_AOUTHDR_H + +/* Define if you have the header file. */ +#undef HAVE_AR_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define if you have the header file. */ +#undef HAVE_ARPA_NAMESER_H + +/* Define if you have the header file. */ +#undef HAVE_ASSERT_H + +/* Define if you have the header file. */ +#undef HAVE_COM_ERR_H + +/* Define if you have the header file. */ +#undef HAVE_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define if you have the header file. */ +#undef HAVE_CURSES_H + +/* Define if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the header file. */ +#undef HAVE_EXECHDR_H + +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_FILEHDR_H + +/* Define if you have the header file. */ +#undef HAVE_GRP_H + +/* Define if you have the header file. */ +#undef HAVE_KRB5_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_MACHINE_VMPARAM_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define if you have the header file. */ +#undef HAVE_NLIST_H + +/* Define if you have the header file. */ +#undef HAVE_PWD_H + +/* Define if you have the header file. */ +#undef HAVE_RELOC_H + +/* Define if you have the header file. */ +#undef HAVE_RESOLV_H + +/* Define if you have the header file. */ +#undef HAVE_SETJMP_H + +/* Define if you have the header file. */ +#undef HAVE_SGS_H + +/* Define if you have the header file. */ +#undef HAVE_SGTTY_H + +/* Define if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define if you have the header file. */ +#undef HAVE_STAB_H + +/* Define if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_DIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_EXEC_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_EXECHDR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FCNTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_LOADER_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_NDIR_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PSTAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STATFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SYSTEMINFO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TERMIO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TTOLD_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TTYCOM_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_UTSNAME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the header file. */ +#undef HAVE_SYSLOG_H + +/* Define if you have the header file. */ +#undef HAVE_TERM_H + +/* Define if you have the header file. */ +#undef HAVE_TERMCAP_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIO_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_UTSNAME_H + +/* Define if you have the header file. */ +#undef HAVE_VARARGS_H + +/* Define if you have the header file. */ +#undef HAVE_VMPARAM_H diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..0432524 --- /dev/null +++ b/config.sub @@ -0,0 +1,927 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \ + | arme[lb] | pyramid \ + | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ + | alpha | we32k | ns16k | clipper | i370 | sh \ + | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \ + | pdp11 | mips64el | mips64orion | mips64orionel \ + | sparc | sparclet | sparclite | sparc64) + basic_machine=$basic_machine-unknown + ;; + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[3456]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \ + | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ + | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ + | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ + | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* | f301-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigados) + basic_machine=m68k-cbm + os=-amigados + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[3456]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[3456]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[3456]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[3456]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + np1) + basic_machine=np1-gould + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5) + basic_machine=i586-intel + ;; + pentiumpro | p6) + basic_machine=i686-intel + ;; + pentium-* | p5-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + k5) + # We don't have specific support for AMD's K5 yet, so just call it a Pentium + basic_machine=i586-amd + ;; + nexen) + # We don't have specific support for Nexgen yet, so just call it a Pentium + basic_machine=i586-nexgen + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + mips) + basic_machine=mips-mips + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -unixware* | svr4*) + os=-sysv4 + ;; + -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* \ + | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -linux-gnu* | -uxpv*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -xenix) + os=-xenix + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-ibm) + os=-aix + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigados + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -hpux*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/configure b/configure new file mode 100755 index 0000000..e17febb --- /dev/null +++ b/configure @@ -0,0 +1,5215 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_default_prefix=/usr/local + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +ac_aux_dir= +for ac_dir in . $srcdir/.; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in . $srcdir/." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:573: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:594: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:612: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + + + + + + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:647: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:677: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:728: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:760: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 771 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:802: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:807: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:835: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + + +if test $ac_cv_prog_gcc = yes; then +cat >conftest.c </dev/null 2>&1; then + gcc -v + echo "WARNING: gcc -O (version 2.4.5 and below) produces incorrect code" + echo " for lpd.c and other large routines." + CFLAGS="`echo ${CFLAGS} | sed s/-O//`" + fi; + CFLAGS="${CFLAGS} -Wall" + echo "using CFLAGS=${CFLAGS}" +fi; + +echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:884: checking for POSIXized ISC" >&5 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$ac_t""yes" 1>&6 + ISC=yes # If later tests want to check for ISC. + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$ac_t""no" 1>&6 + ISC= +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:905: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:926: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:986: checking for minix/config.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + MINIX=yes +else + echo "$ac_t""no" 1>&6 +MINIX= +fi + +if test "$MINIX" = yes; then + cat >> confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + cat >> confdefs.h <<\EOF +#define _POSIX_1_SOURCE 2 +EOF + + cat >> confdefs.h <<\EOF +#define _MINIX 1 +EOF + +fi + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1034: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + + +version=`echo $target_os | sed -e 's/[^0-9][^0-9]*//' -e 's/\.//g'` +echo "Target is $target, arch $target_cpu, os $target_os, version $version" +cat >> confdefs.h <> confdefs.h <> confdefs.h <<\EOF +#define HAVE_BROKEN_TIOCEXCL 1 +EOF + + cat >> confdefs.h <<\EOF +#define SVR4 1 +EOF + + cat >> confdefs.h <> confdefs.h <> confdefs.h <<\EOF +#define SVR4 1 +EOF + + cat >> confdefs.h <> confdefs.h <<\EOF +#define _HPUX_SOURCE 1 +EOF + + CFLAGS="$CFLAGS -D_HPUX_SOURCE=1" + cat >> confdefs.h <> confdefs.h <&6 +echo "configure:1142: checking for setproctitle in -lutil" >&5 +ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lutil $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lutil" +else + echo "$ac_t""no" 1>&6 +fi + + + echo $ac_n "checking for getpwent in -lposix""... $ac_c" 1>&6 +echo "configure:1183: checking for getpwent in -lposix" >&5 +ac_lib_var=`echo posix'_'getpwent | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lposix" +else + echo "$ac_t""no" 1>&6 +fi + + + echo $ac_n "checking for socket in -lsocket_s""... $ac_c" 1>&6 +echo "configure:1224: checking for socket in -lsocket_s" >&5 +ac_lib_var=`echo socket_s'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket_s -lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lsocket_s"; have_socket=1 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$have_socket"; then + echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +echo "configure:1265: checking for socket in -lsocket" >&5 +ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket -lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lsocket" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + echo $ac_n "checking for gethostbyaddr in -lnsl_s""... $ac_c" 1>&6 +echo "configure:1307: checking for gethostbyaddr in -lnsl_s" >&5 +ac_lib_var=`echo nsl_s'_'gethostbyaddr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl_s $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnsl_s"; have_nsl=1 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$have_nsl"; then + echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6 +echo "configure:1348: checking for gethostbyaddr in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnsl" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + echo $ac_n "checking for gethostbyaddr in -lnet_s""... $ac_c" 1>&6 +echo "configure:1390: checking for gethostbyaddr in -lnet_s" >&5 +ac_lib_var=`echo net_s'_'gethostbyaddr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnet_s $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnet_s"; have_net=1 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$have_net"; then + echo $ac_n "checking for gethostbyaddr in -lnet""... $ac_c" 1>&6 +echo "configure:1431: checking for gethostbyaddr in -lnet" >&5 +ac_lib_var=`echo net'_'gethostbyaddr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnet $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnet" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 +echo "configure:1473: checking for getpwnam in -lsun" >&5 +ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsun $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lsun" +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for atoi in -lc_s""... $ac_c" 1>&6 +echo "configure:1513: checking for atoi in -lc_s" >&5 +ac_lib_var=`echo c_s'_'atoi | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lc_s $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lc_s" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1556: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:1610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking for inline""... $ac_c" 1>&6 +echo "configure:1631: checking for inline" >&5 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$ac_cv_c_inline" 1>&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <&6 +echo "configure:1672: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1685: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#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)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:1780: checking for $ac_hdr that defines DIR" >&5 +if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include <$ac_hdr> +int main() { +DIR *dirp = 0; +; return 0; } +EOF +if { (eval echo configure:1793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_dirent_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:1818: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldir $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -ldir" +else + echo "$ac_t""no" 1>&6 +fi + +else +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:1859: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lx $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lx" +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:1901: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1943: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1979: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:2001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <&6 +echo "configure:2020: checking for uid_t in sys/types.h" >&5 +if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uid_t" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_uid_t=yes +else + rm -rf conftest* + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_uid_t" 1>&6 +if test $ac_cv_type_uid_t = no; then + cat >> confdefs.h <<\EOF +#define uid_t int +EOF + + cat >> confdefs.h <<\EOF +#define gid_t int +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:2054: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:2087: checking for mode_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + +echo $ac_n "checking for off_t""... $ac_c" 1>&6 +echo "configure:2120: checking for off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes +else + rm -rf conftest* + ac_cv_type_off_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_off_t" 1>&6 +if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF +#define off_t long +EOF + +fi + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:2153: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + + + +for ac_hdr in sys/types.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2191: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in a.out.h a_out.h aouthdr.h ar.h arpa/inet.h arpa/nameser.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2231: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in assert.h com_err.h compat.h ctype.h curses.h dirent.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2271: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in errno.h exechdr.h fcntl.h filehdr.h grp.h krb5.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2311: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in limits.h locale.h machine/vmparam.h malloc.h memory.h ndir.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2351: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in netdb.h netinet/in.h nlist.h pwd.h reloc.h resolv.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2391: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in setjmp.h sgs.h sgtty.h signal.h stab.h stdarg.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2431: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in stdio.h stdlib.h string.h strings.h sys/dir.h sys/exec.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2471: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2481: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/exechdr.h sys/fcntl.h sys/file.h sys/ioctl.h sys/loader.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2511: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2521: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/mount.h sys/ndir.h sys/param.h sys/pstat.h sys/resource.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2551: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/select.h sys/socket.h sys/stat.h sys/statfs.h sys/statvfs.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2591: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/syslog.h sys/systeminfo.h sys/termio.h sys/time.h sys/ttold.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2631: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/ttycom.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2671: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in term.h termcap.h termio.h termios.h time.h unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2711: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in utsname.h varargs.h vmparam.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2751: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + + +for ac_func in cfsetispeed fcntl flock gethostbyname2 getdtablesize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2792: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in gethostname getrlimit inet_aton inet_ntop inet_pton +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2847: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in innetgr killpg lockf mkstemp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2902: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in mktemp openlog seteuid setpgid setproctitle +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2957: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in setresuid setreuid setsid sigaction +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3012: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in sigprocmask sigsetjmp socketpair strcasecmp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3067: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in strchr strdup strerror strncasecmp sysinfo +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3122: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in tcflush tcsetattr uname wait3 waitpid +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3177: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + +if test ! "$ac_cv_func_setreuid" = yes -a ! "$ac_cv_func_seteuid" = yes -a ! "$ac_cv_func_setresuid" = yes; then + echo "WARNING: missing setreuid(), seteuid(), and setresuid()" +fi + +ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 +echo "configure:3236: checking for vfork.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VFORK_H 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for working vfork""... $ac_c" 1>&6 +echo "configure:3271: checking for working vfork" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + echo $ac_n "checking for vfork""... $ac_c" 1>&6 +echo "configure:3277: checking for vfork" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vfork(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vfork) || defined (__stub___vfork) +choke me +#else +vfork(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vfork=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vfork=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +ac_cv_func_vfork_works=$ac_cv_func_vfork +else + cat > conftest.$ac_ext < +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_VFORK_H +#include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. + The compiler is told about this with #include , + but some compilers (e.g. gcc -O) don't grok . + Test for this by using a static variable whose address + is put into a register that is clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +#else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} +main() { + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. + This test uses lots of local variables, at least + as many local variables as main has allocated so far + including compiler temporaries. 4 locals are enough for + gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. + A buggy compiler should reuse the register of parent + for one of the local variables, since it will think that + parent can't possibly be used any more in this routine. + Assigning to the local variable will thus munge parent + in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), + vfork doesn't separate parent from child file descriptors. + If the child closes a descriptor before it execs or exits, + this munges the parent's descriptor as well. + Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + exit( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +EOF +if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_vfork_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_vfork_works=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 +if test $ac_cv_func_vfork_works = no; then + cat >> confdefs.h <<\EOF +#define vfork fork +EOF + +fi + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +echo "configure:3445: checking for vprintf" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vprintf(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vprintf) || defined (__stub___vprintf) +choke me +#else +vprintf(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +echo "configure:3497: checking for _doprnt" >&5 +if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +_doprnt(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + + + + +echo $ac_n "checking how to manipulate tty attributes""... $ac_c" 1>&6 +echo "configure:3553: checking how to manipulate tty attributes" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_term'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + +if test "$ac_cv_header_termios_h" = yes; then + ac_cv_struct_term=termios +fi +if test "$ac_cv_header_sys_termios_h" = yes; then + ac_cv_struct_term=termios +fi + +if test -z "$ac_cv_struct_term" ; then +cat > conftest.$ac_ext < +#endif +#ifdef HAVE_SYS_TERMIO_H +#include +#endif +int main() { +struct termio t;t.c_iflag = 0 +; return 0; } +EOF +if { (eval echo configure:3581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_term=termio +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi + +if test -z "$ac_cv_struct_term" ; then + cat > conftest.$ac_ext < +int main() { + + struct sgttyb s;s.sg_flags = 0 +; return 0; } +EOF +if { (eval echo configure:3601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_term=sgttyb +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi +if test -z "$ac_cv_struct_term" ; then + ac_cv_struct_term=UNDEFINED +fi + +fi + +echo "$ac_t""using $ac_cv_struct_term" 1>&6 + +if test "$ac_cv_struct_term" = "sgttyb"; then + cat >> confdefs.h <<\EOF +#define USE_SGTTYB 1 +EOF + + cat >> confdefs.h <<\EOF +#define USE_STTY SGTTYB +EOF + +fi +if test "$ac_cv_struct_term" = "termio"; then + cat >> confdefs.h <<\EOF +#define USE_TERMIO 1 +EOF + + cat >> confdefs.h <<\EOF +#define USE_STTY TERMIO +EOF + +fi +if test "$ac_cv_struct_term" = "termios"; then + cat >> confdefs.h <<\EOF +#define USE_TERMIOS 1 +EOF + + cat >> confdefs.h <<\EOF +#define USE_STTY TERMIOS +EOF + +fi + + +echo $ac_n "checking checking for struct exec""... $ac_c" 1>&6 +echo "configure:3651: checking checking for struct exec" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_exec'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +ac_cv_struct_exec=no +if test "$ac_cv_header_a_out_h" != no ; then + cat > conftest.$ac_ext < +#include +int main() { +struct exec b; b.a_text = 0 +; return 0; } +EOF +if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_exec=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_exec=no +fi +rm -f conftest* +fi + +fi + +echo "$ac_t""$ac_cv_struct_exec" 1>&6 +if test $ac_cv_struct_exec = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STRUCT_EXEC 1 +EOF + +fi + + +echo $ac_n "checking how to get filesystem free space""... $ac_c" 1>&6 +echo "configure:3692: checking how to get filesystem free space" >&5 + +if eval "test \"`echo '$''{'ac_cv_struct_fstype'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +fstype= + +if test "$ac_cv_func_statvfs" != no ; then #{ + cat > conftest.$ac_ext < +#include +#ifdef HAVE_SYS_STATVFS_H +# include +#endif +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_SYS_MOUNT_H +# include +#endif +#ifdef HAVE_SYS_VFS_H +# include +#endif +int main() { +struct statvfs s; statvfs ("/", &s); return(s.f_bavail+s.f_bsize) +; return 0; } +EOF +if { (eval echo configure:3724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + fstype=statvfs +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi #} + + +if test "$ac_cv_func_statfs" != no ; then #{ + if test -z "$fstype" ; then #{ + cat > conftest.$ac_ext < +#include +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_SYS_STATVFS_H +# include +#endif +#ifdef HAVE_SYS_MOUNT_H +# include +#endif +#ifdef HAVE_SYS_VFS_H +# include +#endif +int main() { +struct fs_data s; return(s.fd_bfree+s.fd_bsize) +; return 0; } +EOF +if { (eval echo configure:3760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + fstype=Ultrix-statfs +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + fi #} + + if test -z "$fstype" ; then #{ + cat > conftest.$ac_ext < +#include +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif +int main() { +struct statfs s; return(s.f_bavail+s.f_bsize) +; return 0; } +EOF +if { (eval echo configure:3790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + fstype=statfs +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + fi # } + + if test -z "$fstype" ; then # { + cat > conftest.$ac_ext < +#include +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif +int main() { +struct statfs s; return(s.f_bfree+s.f_bsize) +; return 0; } +EOF +if { (eval echo configure:3820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + fstype=SVR3-statfs +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + fi # } +fi # } + +if test -z "$fstype" ; then + echo "cannot find a valid statfs-like structure!" + fstype=UNKNOWN +fi + +ac_cv_struct_fstype=$fstype + + +fi + + +echo "$ac_t""using $ac_cv_struct_fstype" 1>&6 + +if test "$ac_cv_struct_fstype" = SVR3-statfs; then + cat >> confdefs.h <<\EOF +#define USE_STATFS_TYPE SVR3_STATFS +EOF + +fi +if test "$ac_cv_struct_fstype" = Ultrix-statfs; then + cat >> confdefs.h <<\EOF +#define USE_STATFS_TYPE ULTRIX_STATFS +EOF + +fi +if test "$ac_cv_struct_fstype" = statfs; then + cat >> confdefs.h <<\EOF +#define USE_STATFS_TYPE STATFS +EOF + +fi +if test "$ac_cv_struct_fstype" = statvfs; then + cat >> confdefs.h <<\EOF +#define USE_STATFS_TYPE STATVFS +EOF + +fi + +echo $ac_n "checking for errno declaration""... $ac_c" 1>&6 +echo "configure:3870: checking for errno declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_errno'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +printf("%d",errno); +; return 0; } +EOF +if { (eval echo configure:3883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_errno=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_errno=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_errno" 1>&6 +if test $ac_cv_decl_errno = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ERRNO_DECL 1 +EOF + +fi; + +echo $ac_n "checking for sys_nerr""... $ac_c" 1>&6 +echo "configure:3905: checking for sys_nerr" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_nerr'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_decl_sys_nerr=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_nerr=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_nerr" 1>&6 +if test $ac_cv_decl_sys_nerr = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_NERR 1 +EOF + +fi; + +echo $ac_n "checking for sys_nerr declaration""... $ac_c" 1>&6 +echo "configure:3939: checking for sys_nerr declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_nerr_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +printf("%d",sys_nerr); +; return 0; } +EOF +if { (eval echo configure:3958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_sys_nerr_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_nerr_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_nerr_def" 1>&6 +if test $ac_cv_decl_sys_nerr_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_NERR_DEF 1 +EOF + +fi + +echo $ac_n "checking for sys_errlist array""... $ac_c" 1>&6 +echo "configure:3980: checking for sys_errlist array" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_errlist'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_decl_sys_errlist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_errlist=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_errlist" 1>&6 +if test $ac_cv_decl_sys_errlist = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST 1 +EOF + +fi + +echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&6 +echo "configure:4015: checking for sys_errlist declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_errlist_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +printf("%s",sys_errlist[0]); +; return 0; } +EOF +if { (eval echo configure:4035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_sys_errlist_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_errlist_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_errlist_def" 1>&6 +if test $ac_cv_decl_sys_errlist_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_ERRLIST_DEF 1 +EOF + +fi + + +echo $ac_n "checking for setproctitle declaration""... $ac_c" 1>&6 +echo "configure:4058: checking for setproctitle declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_setproctitle_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +printf("%s",setproctitle); +; return 0; } +EOF +if { (eval echo configure:4078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_setproctitle_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_setproctitle_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_setproctitle_def" 1>&6 +if test $ac_cv_decl_setproctitle_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SETPROCTITLE_DEF 1 +EOF + +fi + + + +echo $ac_n "checking for sys_siglist array""... $ac_c" 1>&6 +echo "configure:4102: checking for sys_siglist array" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_decl_sys_siglist=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_siglist=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_siglist" 1>&6 +if test $ac_cv_decl_sys_siglist = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_SIGLIST 1 +EOF + +fi + +echo $ac_n "checking for sys_siglist declaration""... $ac_c" 1>&6 +echo "configure:4136: checking for sys_siglist declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_sys_siglist_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include +int main() { +printf("%s",sys_siglist[0]); +; return 0; } +EOF +if { (eval echo configure:4157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_sys_siglist_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_sys_siglist_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_sys_siglist_def" 1>&6 +if test $ac_cv_decl_sys_siglist_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_SIGLIST_DEF 1 +EOF + +fi + + + +echo $ac_n "checking for getprgp() or getpgrp(0) form""... $ac_c" 1>&6 +echo "configure:4181: checking for getprgp() or getpgrp(0) form" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getpgrp_0'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +int main() { +getpgrp(0); +; return 0; } +EOF +if { (eval echo configure:4196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_func_getpgrp_0=getpgrp_0 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_getpgrp_0=getpgrp +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_func_getpgrp_0" 1>&6 +if test "$ac_cv_func_getpgrp_0" = getpgrp_0; then +cat >> confdefs.h <<\EOF +#define HAVE_GETPGRP_0 0 +EOF + +else +cat >> confdefs.h <<\EOF +#define HAVE_GETPGRP_0 +EOF + +fi + + +echo $ac_n "checking for setprgp form""... $ac_c" 1>&6 +echo "configure:4224: checking for setprgp form" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setpgrp_0'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_UNISTD_H +# include +#endif + +int main() { +setpgrp(0,0); +; return 0; } +EOF +if { (eval echo configure:4243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_func_setpgrp_0=setpgrp_0 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_setpgrp_0=setpgrp +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_func_setpgrp_0" 1>&6 +if test $ac_cv_func_setpgrp_0 = setpgrp_0; then + cat >> confdefs.h <<\EOF +#define HAVE_SETPGRP_0 1 +EOF + +fi + + +echo $ac_n "checking for obsolete union wait compatibility""... $ac_c" 1>&6 +echo "configure:4266: checking for obsolete union wait compatibility" >&5 +if eval "test \"`echo '$''{'ac_cv_unionwait'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { +union wait x;WIFEXITED(x); +; return 0; } +EOF +if { (eval echo configure:4280: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_unionwait=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_unionwait=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_unionwait" 1>&6 +if test $ac_cv_unionwait = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_UNION_WAIT 1 +EOF + +fi + +echo $ac_n "checking for gethostname declaration""... $ac_c" 1>&6 +echo "configure:4302: checking for gethostname declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_gethostname_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +printf("%d",gethostname); +; return 0; } +EOF +if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_gethostname_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_gethostname_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_gethostname_def" 1>&6 +if test $ac_cv_decl_gethostname_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_GETHOSTNAME_DEF 1 +EOF + +fi + + +echo $ac_n "checking for tgetstr declaration""... $ac_c" 1>&6 +echo "configure:4346: checking for tgetstr declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_tgetstr_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERM_H +#include +#endif +int main() { +printf("%d",tgetstr); +; return 0; } +EOF +if { (eval echo configure:4370: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_tgetstr_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_tgetstr_def=no +fi +rm -f conftest* +if test $ac_cv_decl_tgetstr_def != yes; then + cat > conftest.$ac_ext < + #endif + #ifdef HAVE_STDLIB_H + #include + #endif + #ifdef HAVE_UNISTD_H + #include + #endif + #ifdef HAVE_CURSES_H + #include + #endif +int main() { +printf("%d",tgetstr); +; return 0; } +EOF +if { (eval echo configure:4401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_tgetstr_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_tgetstr_def=no +fi +rm -f conftest* +fi + +fi + +echo "$ac_t""$ac_cv_decl_tgetstr_def" 1>&6 +if test $ac_cv_decl_tgetstr_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_TGETSTR_DEF 1 +EOF + +fi + + +echo $ac_n "checking for innetgr declaration""... $ac_c" 1>&6 +echo "configure:4425: checking for innetgr declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_innetgr_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +int main() { +printf("%d",innetgr); +; return 0; } +EOF +if { (eval echo configure:4449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_innetgr_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_innetgr_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_innetgr_def" 1>&6 +if test $ac_cv_decl_innetgr_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_INNETGR_DEF 1 +EOF + +fi + + +echo $ac_n "checking for openlog declaration""... $ac_c" 1>&6 +echo "configure:4472: checking for openlog declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_openlog_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#endif +#ifdef HAVE_SYSLOG_H +#include +#endif +int main() { +printf("%d",openlog); +; return 0; } +EOF +if { (eval echo configure:4490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_openlog_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_openlog_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_openlog_def" 1>&6 +if test $ac_cv_decl_openlog_def = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_OPENLOG_DEF 1 +EOF + +fi + + +echo $ac_n "checking for struct in6_addr declaration""... $ac_c" 1>&6 +echo "configure:4513: checking for struct in6_addr declaration" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_in6_addr_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct in6_addr v; +; return 0; } +EOF +if { (eval echo configure:4528: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_in6_addr_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_in6_addr_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_in6_addr_def" 1>&6 +if test $ac_cv_decl_in6_addr_def = yes; then + cat >> confdefs.h <<\EOF +#define IN6_ADDR 1 +EOF + +fi + + +echo $ac_n "checking for struct in_addr6 declaration (LINUX)""... $ac_c" 1>&6 +echo "configure:4551: checking for struct in_addr6 declaration (LINUX)" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_in_addr6_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct in_addr6 v; +; return 0; } +EOF +if { (eval echo configure:4566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_in_addr6_def=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_decl_in_addr6_def=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_decl_in_addr6_def" 1>&6 +if test "$ac_cv_decl_in_addr6_def" = yes; then + cat >> confdefs.h <<\EOF +#define IN_ADDR6 1 +EOF + +fi + + + +echo $ac_n "checking for struct stat has mtimespec.ts_nsec or mtimespec.ts_nsec""... $ac_c" 1>&6 +echo "configure:4590: checking for struct stat has mtimespec.ts_nsec or mtimespec.ts_nsec" >&5 +if eval "test \"`echo '$''{'ac_cv_decl_st_mtime_nsec_def'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include +int main() { +struct stat statb; statb.st_mtimespec.ts_nsec; +; return 0; } +EOF +if { (eval echo configure:4607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_st_mtime_nsec_def=st_mtimespec.ts_nsec +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + +fi + + +if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{ +cat > conftest.$ac_ext < +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include +int main() { +struct stat statb; statb.st_mtime_nsec; +; return 0; } +EOF +if { (eval echo configure:4633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_st_mtime_nsec_def=st_mtime_nsec +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi #} + + +if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{ +cat > conftest.$ac_ext < +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include +int main() { +struct stat statb; statb.st_mtim.tv_nsec; +; return 0; } +EOF +if { (eval echo configure:4658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_decl_st_mtime_nsec_def=st_mtim.tv_nsec +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +fi #} + +if test -z "$ac_cv_decl_st_mtime_nsec_def"; then +ac_cv_decl_st_mtime_nsec_def=no +fi + +echo "$ac_t""$ac_cv_decl_st_mtime_nsec_def" 1>&6 +if test ! "$ac_cv_decl_st_mtime_nsec_def" = no; then + cat >> confdefs.h <&6 +echo "configure:4694: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Extract the first word of "auxman", so it can be a program name with args. +set dummy auxman; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:4749: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_INSTALL_MAN'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$INSTALL_MAN"; then + ac_cv_prog_INSTALL_MAN="$INSTALL_MAN" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_INSTALL_MAN="auxman" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_INSTALL_MAN" && ac_cv_prog_INSTALL_MAN="$INSTALL -m 644" +fi +fi +INSTALL_MAN="$ac_cv_prog_INSTALL_MAN" +if test -n "$INSTALL_MAN"; then + echo "$ac_t""$INSTALL_MAN" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:4780: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:4808: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +echo $ac_n "checking for shell""... $ac_c" 1>&6 +echo "configure:4836: checking for shell" >&5 +SHELL=/bin/sh +echo "$ac_t""using $SHELL (FORCED)" 1>&6 + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile src/Makefile man/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@INSTALL@%$INSTALL%g +s%@INSTALL_MAN@%$INSTALL_MAN%g +s%@CPP@%$CPP%g +s%@LDCC@%$LDCC%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@RANLIB@%$RANLIB%g +s%@SET_MAKE@%$SET_MAKE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + if test -n "$ac_given_INSTALL" ; then case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac ; fi + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #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. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..2f9649e --- /dev/null +++ b/configure.in @@ -0,0 +1,759 @@ +dnl process this file with GNU autoconf to produce a configure script. +dnl +dnl jmason 23 dec 94 -- fixed union wait and sys_errlist checks +dnl Patrick Powell Fri Jul 7 21:08:48 PDT 1995 +dnl configure.in,v 1.1 1997/05/30 18:53:33 papowell Exp +dnl Original version from PLP4.0 Release + +AC_INIT(Makefile.in) +AC_CONFIG_AUX_DIR(.) +AC_CANONICAL_SYSTEM +AC_CONFIG_HEADER(config.h) +AC_PREFIX_DEFAULT(/usr/local) +AC_SUBST(INSTALL) +AC_SUBST(INSTALL_MAN) +AC_SUBST(SHELL) +AC_SUBST(CPP) +AC_SUBST(CFLAGS) +AC_SUBST(LDCC) + + +dnl ---------------------------------------------------------------------------- +dnl ----------- C compiler checks ----------------------------------------- +AC_PROG_CC + +if test $ac_cv_prog_gcc = yes; then +cat >conftest.c </dev/null 2>&1; then + gcc -v + echo "WARNING: gcc -O (version 2.4.5 and below) produces incorrect code" + echo " for lpd.c and other large routines." + CFLAGS="`echo ${CFLAGS} | sed s/-O//`" + fi; + CFLAGS="${CFLAGS} -Wall" + echo "using CFLAGS=${CFLAGS}" +fi; + +dnl ---------------------------------------------------------------------------- +dnl ------------ OS Checks -------------------------------------------------- +AC_ISC_POSIX +AC_MINIX +AC_AIX + +changequote(, )dnl +version=`echo $target_os | sed -e 's/[^0-9][^0-9]*//' -e 's/\.//g'` +changequote([, ])dnl +echo "Target is $target, arch $target_cpu, os $target_os, version $version" +AC_DEFINE_UNQUOTED(ARCHITECTURE,"$target_cpu") + +LDCC="$CC" +checklibs= +case $target_os in + bsdi* ) + LDCC=shlicc + ;; + unicos* ) + checklibs=no + ;; + irix6* ) + checklibs=no + AC_DEFINE_UNQUOTED(IRIX,$version) + LIBS="$LIBS -lcurses" + ;; + irix5* ) + AC_DEFINE(HAVE_BROKEN_TIOCEXCL) + AC_DEFINE(SVR4) + AC_DEFINE_UNQUOTED(IRIX,$version) + LIBS="$LIBS -lcurses" + checklibs=no + ;; + irix* ) + AC_DEFINE_UNQUOTED(IRIX,$version) + LIBS="$LIBS -ltermcap" + checklibs=no + ;; + solaris* ) + AC_DEFINE(SVR4) + AC_DEFINE_UNQUOTED(SOLARIS,$version) + ;; + hpux* ) + AC_DEFINE(_HPUX_SOURCE) + CFLAGS="$CFLAGS -D_HPUX_SOURCE=1" + AC_DEFINE_UNQUOTED(HPUX,$version) + ;; + sunos* ) + AC_DEFINE_UNQUOTED(SUNOS,$version) + ;; +esac + +dnl if egrep _HPUX_SOURCE /usr/include/sys/types.h > /dev/null 2>&1 ; then +dnl # HP/UX support (kludgety kludge!) +dnl AC_DEFINE(_HPUX_SOURCE) +dnl CFLAGS="$CFLAGS -D_HPUX_SOURCE=1" +dnl fi + +dnl these must be before anything that links. + + +dnl check to see if we suppress probing for libraries +dnl this is done by using the checklibs variable + +if test -z "$checklibs"; then + + dnl BSDI uses this for setproctitle + AC_CHECK_LIB(util, setproctitle, [LIBS="$LIBS -lutil"]) + + dnl A/UX uses this... + AC_CHECK_LIB(posix, getpwent, [LIBS="$LIBS -lposix"]) + + dnl use old-style shared libs if we have 'em. + AC_CHECK_LIB(socket_s, socket, [LIBS="$LIBS -lsocket_s"; have_socket=1], ,-lnsl) + if test -z "$have_socket"; then + AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"], , -lnsl) + fi + + AC_CHECK_LIB(nsl_s, gethostbyaddr, [LIBS="$LIBS -lnsl_s"; have_nsl=1]) + if test -z "$have_nsl"; then + AC_CHECK_LIB(nsl, gethostbyaddr, [LIBS="$LIBS -lnsl"]) + fi + + AC_CHECK_LIB(net_s, gethostbyaddr, [LIBS="$LIBS -lnet_s"; have_net=1]) + if test -z "$have_net"; then + AC_CHECK_LIB(net, gethostbyaddr, [LIBS="$LIBS -lnet"]) + fi + + dnl IRIX 4 uses these... NIS calls, shared C lib + AC_CHECK_LIB(sun, getpwnam, [LIBS="$LIBS -lsun"]) + AC_CHECK_LIB(c_s, atoi, [LIBS="$LIBS -lc_s"]) + +fi +dnl **** end library checks + +AC_C_CONST +AC_C_INLINE + +AC_HEADER_STDC +AC_HEADER_DIRENT +AC_HEADER_SYS_WAIT +AC_HEADER_TIME + +dnl typedefs: +AC_TYPE_SIGNAL +AC_TYPE_UID_T +AC_TYPE_SIZE_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T + +dnl ---------------------------------------------------------------------------- +dnl headers: + +AC_CHECK_HEADERS(sys/types.h) +AC_CHECK_HEADERS(a.out.h a_out.h aouthdr.h ar.h arpa/inet.h arpa/nameser.h) +AC_CHECK_HEADERS(assert.h com_err.h compat.h ctype.h curses.h dirent.h) +AC_CHECK_HEADERS(errno.h exechdr.h fcntl.h filehdr.h grp.h krb5.h) +AC_CHECK_HEADERS(limits.h locale.h machine/vmparam.h malloc.h memory.h ndir.h) +AC_CHECK_HEADERS(netdb.h netinet/in.h nlist.h pwd.h reloc.h resolv.h) +AC_CHECK_HEADERS(setjmp.h sgs.h sgtty.h signal.h stab.h stdarg.h) +AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/dir.h sys/exec.h) +AC_CHECK_HEADERS(sys/exechdr.h sys/fcntl.h sys/file.h sys/ioctl.h sys/loader.h) +AC_CHECK_HEADERS(sys/mount.h sys/ndir.h sys/param.h sys/pstat.h sys/resource.h) +AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/stat.h sys/statfs.h sys/statvfs.h) +AC_CHECK_HEADERS(sys/syslog.h sys/systeminfo.h sys/termio.h sys/time.h sys/ttold.h) +AC_CHECK_HEADERS(sys/ttycom.h sys/utsname.h sys/vfs.h sys/wait.h syslog.h) +AC_CHECK_HEADERS(term.h termcap.h termio.h termios.h time.h unistd.h) +AC_CHECK_HEADERS(utsname.h varargs.h vmparam.h) + +dnl ---------------------------------------------------------------------------- +dnl function checks: + +AC_CHECK_FUNCS(cfsetispeed fcntl flock gethostbyname2 getdtablesize) +AC_CHECK_FUNCS(gethostname getrlimit inet_aton inet_ntop inet_pton) +AC_CHECK_FUNCS(innetgr killpg lockf mkstemp) +AC_CHECK_FUNCS(mktemp openlog seteuid setpgid setproctitle) +AC_CHECK_FUNCS(setresuid setreuid setsid sigaction) +AC_CHECK_FUNCS(sigprocmask sigsetjmp socketpair strcasecmp) +AC_CHECK_FUNCS(strchr strdup strerror strncasecmp sysinfo) +AC_CHECK_FUNCS(tcflush tcsetattr uname wait3 waitpid) + +if test ! "$ac_cv_func_setreuid" = yes -a ! "$ac_cv_func_seteuid" = yes -a ! "$ac_cv_func_setresuid" = yes; then + echo "WARNING: missing setreuid(), seteuid(), and setresuid()" +fi + +AC_FUNC_VFORK +AC_FUNC_VPRINTF + + +dnl ---------------------------------------------------------------------------- + +AC_MSG_CHECKING(how to manipulate tty attributes) +AC_CACHE_VAL(ac_cv_struct_term, +[ + +if test "$ac_cv_header_termios_h" = yes; then + ac_cv_struct_term=termios +fi +if test "$ac_cv_header_sys_termios_h" = yes; then + ac_cv_struct_term=termios +fi + +dnl test to see if we need to compile +if test -z "$ac_cv_struct_term" ; then +AC_TRY_COMPILE([ +#ifdef HAVE_TERMIO_H +#include +#endif +#ifdef HAVE_SYS_TERMIO_H +#include +#endif],[struct termio t;t.c_iflag = 0], +ac_cv_struct_term=termio) +fi + +dnl now you have determined if you have termio +if test -z "$ac_cv_struct_term" ; then + AC_TRY_COMPILE([#include ],[ + struct sgttyb s;s.sg_flags = 0], + ac_cv_struct_term=sgttyb) +fi +if test -z "$ac_cv_struct_term" ; then + ac_cv_struct_term=UNDEFINED +fi +]) +AC_MSG_RESULT(using $ac_cv_struct_term) + +if test "$ac_cv_struct_term" = "sgttyb"; then + AC_DEFINE(USE_SGTTYB) + AC_DEFINE(USE_STTY,SGTTYB) +fi +if test "$ac_cv_struct_term" = "termio"; then + AC_DEFINE(USE_TERMIO) + AC_DEFINE(USE_STTY,TERMIO) +fi +if test "$ac_cv_struct_term" = "termios"; then + AC_DEFINE(USE_TERMIOS) + AC_DEFINE(USE_STTY,TERMIOS) +fi + +dnl ---------------------------------------------------------------------------- + +AC_MSG_CHECKING(checking for struct exec) +AC_CACHE_VAL(ac_cv_struct_exec, +[ +ac_cv_struct_exec=no +if test "$ac_cv_header_a_out_h" != no ; then + AC_TRY_COMPILE([ +#include +#include ],[struct exec b; b.a_text = 0], + ac_cv_struct_exec=yes, ac_cv_struct_exec=no ) +fi +]) +AC_MSG_RESULT($ac_cv_struct_exec) +if test $ac_cv_struct_exec = yes; then + AC_DEFINE(HAVE_STRUCT_EXEC) +fi + +dnl ---------------------------------------------------------------------------- + +AC_MSG_CHECKING(how to get filesystem free space) + +AC_CACHE_VAL(ac_cv_struct_fstype, +[ +fstype= + +dnl do this check if statvfs is a valid function +if test "$ac_cv_func_statvfs" != no ; then #{ + AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_SYS_STATVFS_H +# include +#endif +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_SYS_MOUNT_H +# include +#endif +#ifdef HAVE_SYS_VFS_H +# include +#endif],[struct statvfs s; statvfs ("/", &s); return(s.f_bavail+s.f_bsize)], + fstype=statvfs) +fi #} + +dnl do these checks if statfs is a valid function + +if test "$ac_cv_func_statfs" != no ; then #{ + if test -z "$fstype" ; then #{ + AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_SYS_STATFS_H +# include +#endif + +#ifdef HAVE_SYS_STATVFS_H +# include +#endif +#ifdef HAVE_SYS_MOUNT_H +# include +#endif +#ifdef HAVE_SYS_VFS_H +# include +#endif],[struct fs_data s; return(s.fd_bfree+s.fd_bsize)], + fstype=Ultrix-statfs) + fi #} + + if test -z "$fstype" ; then #{ + AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif],[struct statfs s; return(s.f_bavail+s.f_bsize)], + fstype=statfs) + fi # } + + if test -z "$fstype" ; then # { + AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_SYS_STATFS_H +#include +#endif +#ifdef HAVE_SYS_MOUNT_H +#include +#endif +#ifdef HAVE_SYS_VFS_H +#include +#endif],[struct statfs s; return(s.f_bfree+s.f_bsize)], + fstype=SVR3-statfs) + fi # } +fi # } + +if test -z "$fstype" ; then + echo "cannot find a valid statfs-like structure!" + fstype=UNKNOWN +fi + +ac_cv_struct_fstype=$fstype + +]) + +AC_MSG_RESULT(using $ac_cv_struct_fstype) + +if test "$ac_cv_struct_fstype" = SVR3-statfs; then + AC_DEFINE(USE_STATFS_TYPE,SVR3_STATFS) +fi +if test "$ac_cv_struct_fstype" = Ultrix-statfs; then + AC_DEFINE(USE_STATFS_TYPE,ULTRIX_STATFS) +fi +if test "$ac_cv_struct_fstype" = statfs; then + AC_DEFINE(USE_STATFS_TYPE,STATFS) +fi +if test "$ac_cv_struct_fstype" = statvfs; then + AC_DEFINE(USE_STATFS_TYPE,STATVFS) +fi + +dnl ---------------------------------------------------------------------------- +dnl +AC_MSG_CHECKING(for errno declaration) +AC_CACHE_VAL(ac_cv_decl_errno, +[AC_TRY_COMPILE([#include +#include ],[printf("%d",errno);], + ac_cv_decl_errno=yes, ac_cv_decl_errno=no) +]) +AC_MSG_RESULT($ac_cv_decl_errno) +if test $ac_cv_decl_errno = yes; then + AC_DEFINE(HAVE_ERRNO_DECL) +fi; + +AC_MSG_CHECKING(for sys_nerr) +AC_CACHE_VAL(ac_cv_decl_sys_nerr, +[AC_TRY_LINK(,[extern int sys_nerr; return (sys_nerr);], + ac_cv_decl_sys_nerr=yes, ac_cv_decl_sys_nerr=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_nerr) +if test $ac_cv_decl_sys_nerr = yes; then + AC_DEFINE(HAVE_SYS_NERR) +fi; + +AC_MSG_CHECKING(for sys_nerr declaration) +AC_CACHE_VAL(ac_cv_decl_sys_nerr_def, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif],[printf("%d",sys_nerr);], +ac_cv_decl_sys_nerr_def=yes, ac_cv_decl_sys_nerr_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_nerr_def) +if test $ac_cv_decl_sys_nerr_def = yes; then + AC_DEFINE(HAVE_SYS_NERR_DEF) +fi + +AC_MSG_CHECKING(for sys_errlist array) +AC_CACHE_VAL(ac_cv_decl_sys_errlist, +[AC_TRY_LINK(,[extern char *sys_errlist[]; + sys_errlist[0];], + ac_cv_decl_sys_errlist=yes, ac_cv_decl_sys_errlist=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_errlist) +if test $ac_cv_decl_sys_errlist = yes; then + AC_DEFINE(HAVE_SYS_ERRLIST) +fi + +AC_MSG_CHECKING(for sys_errlist declaration) +AC_CACHE_VAL(ac_cv_decl_sys_errlist_def, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif],[printf("%s",sys_errlist[0]);], +ac_cv_decl_sys_errlist_def=yes, ac_cv_decl_sys_errlist_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_errlist_def) +if test $ac_cv_decl_sys_errlist_def = yes; then + AC_DEFINE(HAVE_SYS_ERRLIST_DEF) +fi + + +AC_MSG_CHECKING(for setproctitle declaration) +AC_CACHE_VAL(ac_cv_decl_setproctitle_def, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif],[printf("%s",setproctitle);], +ac_cv_decl_setproctitle_def=yes, ac_cv_decl_setproctitle_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_setproctitle_def) +if test $ac_cv_decl_setproctitle_def = yes; then + AC_DEFINE(HAVE_SETPROCTITLE_DEF) +fi + + +dnl ---------------------------------------------------------------------------- +dnl sys_siglist array (list of signals) + +AC_MSG_CHECKING(for sys_siglist array) +AC_CACHE_VAL(ac_cv_decl_sys_siglist, +[AC_TRY_LINK(,[extern char *sys_siglist[]; printf("%s",sys_siglist[0]);], + ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_siglist) +if test $ac_cv_decl_sys_siglist = yes; then + AC_DEFINE(HAVE_SYS_SIGLIST) +fi + +AC_MSG_CHECKING(for sys_siglist declaration) +AC_CACHE_VAL(ac_cv_decl_sys_siglist_def, +[AC_TRY_COMPILE([ +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include ],[printf("%s",sys_siglist[0]);], +ac_cv_decl_sys_siglist_def=yes, ac_cv_decl_sys_siglist_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_sys_siglist_def) +if test $ac_cv_decl_sys_siglist_def = yes; then + AC_DEFINE(HAVE_SYS_SIGLIST_DEF) +fi + +dnl ---------------------------------------------------------------------------- +dnl check to see if you have getpgrp(0) or getpgrp() +dnl +dnl POSIX `getpgrp(void)' define HAVE_GETPGRP_0 +dnl BSD `getpgrp(int)' - takes 0 as argument +dnl define HAVE_GETPGRP_0 0 + +dnl check to see if you have getpgrp(0) or getpgrp() + +AC_MSG_CHECKING(for getprgp() or getpgrp(0) form) +AC_CACHE_VAL(ac_cv_func_getpgrp_0, +[AC_TRY_COMPILE([ +#ifdef HAVE_UNISTD_H +# include +#endif],[getpgrp(0);], +ac_cv_func_getpgrp_0=getpgrp_0, ac_cv_func_getpgrp_0=getpgrp) +]) +AC_MSG_RESULT($ac_cv_func_getpgrp_0) +if test "$ac_cv_func_getpgrp_0" = getpgrp_0; then +AC_DEFINE(HAVE_GETPGRP_0,0) +else +AC_DEFINE(HAVE_GETPGRP_0,) +fi + +dnl ---------------------------------------------------------------------------- +dnl check to see if you have setpgrp(n,m) or setpgrp() + +AC_MSG_CHECKING(for setprgp form) +AC_CACHE_VAL(ac_cv_func_setpgrp_0, +[AC_TRY_COMPILE([ +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif +],[setpgrp(0,0);], + ac_cv_func_setpgrp_0=setpgrp_0, ac_cv_func_setpgrp_0=setpgrp) +]) +AC_MSG_RESULT($ac_cv_func_setpgrp_0) +if test $ac_cv_func_setpgrp_0 = setpgrp_0; then + AC_DEFINE(HAVE_SETPGRP_0) +fi + +dnl ---------------------------------------------------------------------------- +dnl just for (really) backwards compatibility +dnl we really try not to use union wait -- it's heinously unportable. +dnl nicked this check from Tcl as well. ;) +dnl +dnl The check below checks whether defines the type +dnl "union wait" correctly. It's needed because of weirdness in +dnl HP-UX where "union wait" is defined in both the BSD and SYS-V +dnl environments. Checking the usability of WIFEXITED seems to do +dnl the trick. + +AC_MSG_CHECKING(for obsolete union wait compatibility) +AC_CACHE_VAL(ac_cv_unionwait, +[ +AC_TRY_COMPILE([#include +#include ], [union wait x;WIFEXITED(x);], +ac_cv_unionwait=yes, ac_cv_unionwait=no) +]) +AC_MSG_RESULT($ac_cv_unionwait) +if test $ac_cv_unionwait = yes; then + AC_DEFINE(HAVE_UNION_WAIT) +fi + +dnl ---------------------------------------------------------------------------- +dnl Would you believe the gethostname declarations are broken on some machines +dnl ---------------------------------------------------------------------------- +AC_MSG_CHECKING(for gethostname declaration) +AC_CACHE_VAL(ac_cv_decl_gethostname_def, +[AC_TRY_COMPILE([ +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif],[printf("%d",gethostname);], +ac_cv_decl_gethostname_def=yes, ac_cv_decl_gethostname_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_gethostname_def) +if test $ac_cv_decl_gethostname_def = yes; then + AC_DEFINE(HAVE_GETHOSTNAME_DEF) +fi + + +dnl ---------------------------------------------------------------------------- +dnl tgetstr definitions are missing +dnl ---------------------------------------------------------------------------- +AC_MSG_CHECKING(for tgetstr declaration) +AC_CACHE_VAL(ac_cv_decl_tgetstr_def, +[AC_TRY_COMPILE([ +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_TERM_H +#include +#endif],[printf("%d",tgetstr);], +ac_cv_decl_tgetstr_def=yes, ac_cv_decl_tgetstr_def=no) +if test $ac_cv_decl_tgetstr_def != yes; then + AC_TRY_COMPILE([ + #ifdef HAVE_STDIO_H + #include + #endif + #ifdef HAVE_STDLIB_H + #include + #endif + #ifdef HAVE_UNISTD_H + #include + #endif + #ifdef HAVE_CURSES_H + #include + #endif],[printf("%d",tgetstr);], + ac_cv_decl_tgetstr_def=yes, ac_cv_decl_tgetstr_def=no) +fi +]) +AC_MSG_RESULT($ac_cv_decl_tgetstr_def) +if test $ac_cv_decl_tgetstr_def = yes; then + AC_DEFINE(HAVE_TGETSTR_DEF) +fi + + +dnl ---------------------------------------------------------------------------- +dnl innetgr() declarations missing +dnl ---------------------------------------------------------------------------- +AC_MSG_CHECKING(for innetgr declaration) +AC_CACHE_VAL(ac_cv_decl_innetgr_def, +[AC_TRY_COMPILE([ +#ifdef HAVE_STDIO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif],[printf("%d",innetgr);], +ac_cv_decl_innetgr_def=yes, ac_cv_decl_innetgr_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_innetgr_def) +if test $ac_cv_decl_innetgr_def = yes; then + AC_DEFINE(HAVE_INNETGR_DEF) +fi + + +dnl ---------------------------------------------------------------------------- +dnl openlog() declarations missing +dnl ---------------------------------------------------------------------------- +AC_MSG_CHECKING(for openlog declaration) +AC_CACHE_VAL(ac_cv_decl_openlog_def, +[AC_TRY_COMPILE([ +#ifdef HAVE_STDARG_H +#include +#endif +#ifdef HAVE_SYSLOG_H +#include +#endif],[printf("%d",openlog);], +ac_cv_decl_openlog_def=yes, ac_cv_decl_openlog_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_openlog_def) +if test $ac_cv_decl_openlog_def = yes; then + AC_DEFINE(HAVE_OPENLOG_DEF) +fi + +dnl ---------------------------------------------------------------------------- +dnl IPV6 - check for structure declarations +dnl ---------------------------------------------------------------------------- + +AC_MSG_CHECKING(for struct in6_addr declaration) +AC_CACHE_VAL(ac_cv_decl_in6_addr_def, +[AC_TRY_COMPILE([ +#include +#include +#include ],[struct in6_addr v;], +ac_cv_decl_in6_addr_def=yes, ac_cv_decl_in6_addr_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_in6_addr_def) +if test $ac_cv_decl_in6_addr_def = yes; then + AC_DEFINE(IN6_ADDR) +fi + + +AC_MSG_CHECKING(for struct in_addr6 declaration (LINUX)) +AC_CACHE_VAL(ac_cv_decl_in_addr6_def, +[AC_TRY_COMPILE([ +#include +#include +#include ],[struct in_addr6 v;], +ac_cv_decl_in_addr6_def=yes, ac_cv_decl_in_addr6_def=no) +]) +AC_MSG_RESULT($ac_cv_decl_in_addr6_def) +if test "$ac_cv_decl_in_addr6_def" = yes; then + AC_DEFINE(IN_ADDR6) +fi + +dnl ---------------------------------------------------------------------------- +dnl struct stat can have a st_mtime_nsec field +dnl ---------------------------------------------------------------------------- + + +AC_MSG_CHECKING(for struct stat has mtimespec.ts_nsec or mtimespec.ts_nsec) +AC_CACHE_VAL(ac_cv_decl_st_mtime_nsec_def, +[AC_TRY_COMPILE([ +#include +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include ],[struct stat statb; statb.st_mtimespec.ts_nsec;], +ac_cv_decl_st_mtime_nsec_def=st_mtimespec.ts_nsec) +]) + +if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{ +AC_TRY_COMPILE([ +#include +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include ],[struct stat statb; statb.st_mtime_nsec;], +ac_cv_decl_st_mtime_nsec_def=st_mtime_nsec ) +fi #} + + +if test -z "$ac_cv_decl_st_mtime_nsec_def" ; then #{ +AC_TRY_COMPILE([ +#include +#if defined(HAVE_SYS_TIME_H) +#include +#endif +#include ],[struct stat statb; statb.st_mtim.tv_nsec;], +ac_cv_decl_st_mtime_nsec_def=st_mtim.tv_nsec ) +fi #} + +if test -z "$ac_cv_decl_st_mtime_nsec_def"; then +ac_cv_decl_st_mtime_nsec_def=no +fi + +AC_MSG_RESULT($ac_cv_decl_st_mtime_nsec_def) +if test ! "$ac_cv_decl_st_mtime_nsec_def" = no; then + AC_DEFINE_UNQUOTED(ST_MTIME_NSEC,$ac_cv_decl_st_mtime_nsec_def) +fi + +dnl ---------------------------------------------------------------------------- +dnl make stuff: + + +AC_PROG_INSTALL +AC_CHECK_PROG(INSTALL_MAN,auxman,auxman,[$INSTALL -m 644]) + +AC_PROG_RANLIB +AC_PROG_MAKE_SET + +dnl ----------------- force this to be Bourne Shell for now --------------- +AC_MSG_CHECKING(for shell) +SHELL=/bin/sh +AC_MSG_RESULT(using $SHELL (FORCED)) + +dnl ----------------- GCC Compilation ---------------------------------- +AC_OUTPUT(Makefile src/Makefile man/Makefile ) diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..ab74c88 --- /dev/null +++ b/install-sh @@ -0,0 +1,238 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +tranformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/man/Makefile.in b/man/Makefile.in new file mode 100644 index 0000000..e29bd7c --- /dev/null +++ b/man/Makefile.in @@ -0,0 +1,49 @@ +#************************************************************************** +#* LPRng IFHP Filter +#* Copyright 1994-1997 Patrick Powell, San Diego, CA +#* +#* Based on the CTI printer filters. +#* See COPYRIGHT for details. +#* +#* $Id: Makefile.in,v 1.2 1997/06/04 18:35:35 papowell Exp $ +# + +prefix=@prefix@ + +VPATH=@srcdir@ +SRC=@srcdir@ + +# Directory where the manual pages are to be placed + +MAN=${prefix}/man +INSTALLCMD=@INSTALL@ +FONTDIR=${prefix}/lib/filters/fonts/ +INSTDIR=${prefix}/lib/filters/ + +#**************** configure does not change lines after this ********* + +.PHONY: install all clean distclean ci update + +all: lp_server.8 + +install: lp_server.8 + mkdir -p $(MAN)/man8 + $(INSTALLCMD) -c $^ $(MAN)/man8 + +clean: + +update: + VERSION=`cat ../$(SRC)/VERSION | sed 's/.* //'`; \ + sed -e 's,_FONTDIR_,$(FONTDIR),g' \ + -e 's,_INSTDIR_,$(INSTDIR),g' \ + -e "s,_VERSION_,$${VERSION},g" \ + lp_server.n >lp_server.8 + +distclean: clean + rm -f Makefile Makefile.bsd + +ci: + if test ! -d RCS ; then mkdir RCS; fi; + for i in Makefile.in Makefile *.n; do \ + ci $(CI) -l -mUpdate -t-Initial $$i; \ + done; diff --git a/man/lp_server.8 b/man/lp_server.8 new file mode 100644 index 0000000..f7b71e0 --- /dev/null +++ b/man/lp_server.8 @@ -0,0 +1,138 @@ +.TH ifhp 8 "lp_server-1.1.6" +.SH NAME +lp_server \- export a printer by simulation a HP JetDirect interface +.SH SYNOPSIS +.B lp_server +[-n port] [-w] [-s stty_options] [-d device] [-r remote_list] +.SH DESCRIPTION +.LP +The +.B lp_server +program will bind to the port specified by the -n option, +and wait for a TCP/IP connection. +It will then open the output device (write only if -w is specified), +applying the specified set of stty options if the device +is a serial port. +It then copies the TCP/IP output to the device output, +and copying the device output to the TCP/IP input. +.LP +The intended use for +.B lp_server +is to allow a serial or parallel printer to be made available to PC +workstations as well as to one or more LPRng servers. +.SH "OPTIONS" +The +.B lp_server +printer recognizes the following options provided by the spooler. +.TP +.BR -d " device" +The output device. +.TP +.BR -n " port" +port to use for connections. +Default is 9100. +.TP +.B -w +Open the output device write only. +Default is read/write. +.TP +.BR -t " stty_options" +A list of stty options to be applied to the device +after opening if it is a serial port. +.TP +.BR -r " remote_list" +A list of host names or IP addresses and masks from which +connections are allowed. +For example, +-r 130.191.10.30/24,dickory +would allow connections from the subnet 130.191.10.0 (24 bit netmask) +and the host dickory. +.SH EXAMPLES +.LP +lp_server -d /dev/lp -w +.LP +Opens the parallel port write only. +.LP +lp_server -d /dev/ttya + -t "38400 -echo -crmod -raw -oddp -evenp ixon pass8 -ixany cbreak" +.LP +Opens the serial port /dev/ttya, +and sets the various serial port options. +.SH STTY_OPTIONS +.PP +Due to the differences between implementations of UNIX, +there are several sets of +stty options supported. +Systems using the +.IR sgtty +tty manipulation interface may use the following +.IR stty (1) +options: +.nf +.PP +.ta 16n +16n +16n +16n +16n +16n +16n +16n +16n +bs0 bs1 [-]cbreak cooked cr0 +cr1 cr2 cr3 [-]decctlq [-]echo +[-]even ff0 ff1 [-]lcase [-]litout +nl0 nl1 nl2 nl3 [-]nl +[-]noflsh new [-]nohang old [-]odd +[-]raw start stop tab0 tab1 +tab2 [-]tabs [-]tandem tek ti700 +[-]tilde tn300 tty33 tty37 vt05 +[-]evenp [-]oddp [-]pass8 +.fi +.PP +Systems using +.IR termio +may use the following options: +.nf +.PP +[-]ignbrk [-]brkint [-]ignpar [-]parmrk [-]inpck +[-]istrip [-]inlcr [-]igncr [-]icrnl [-]iuclc +[-]ixon [-]ixany [-]ixoff [-]decctlq [-]tandem +[-]imaxbel [-]opost [-]olcuc [-]onlcr [-]ocrnl +[-]onocr [-]onlret [-]ofill [-]ofdel [-]cstopb +[-]cread [-]parenb [-]parodd [-]hupcl [-]clocal +[-]loblk [-]parity [-]evenp [-]oddp [-]stopb +[-]hup [-]crtscts [-]isig [-]noisig [-]icanon +[-]cbreak [-]xcase [-]echo [-]echoe [-]echok +[-]crterase [-]lfkc [-]echonl [-]noflsh [-]tostop +[-]echoctl [-]ctlecho [-]echoprt [-]prterase [-]echoke +[-]crtkill [-]lcase [-]nl [-]litout [-]pass8 +[-]raw [-]sane [-]cooked [-]nopost fill +nl0 nl1 cr0 cr1 cr2 +cr3 tab0 tab1 tab2 tab3 +bs0 bs1 vt0 vt1 ff0 +ff1 cs5 cs6 cs7 cs8 +nul-fill del-fill -tabs +.fi +.PP +And systems using +.IR termios +may use the following options: +.nf +.PP +[-]ignbrk [-]brkint [-]ignpar [-]parmrk [-]inpck +[-]istrip [-]inlcr [-]igncr [-]icrnl [-]iuclc +[-]ixon [-]ixany [-]ixoff [-]imaxbel [-]pass8 +[-]opost [-]olcuc [-]onlcr [-]ocrnl [-]onocr +[-]onlret [-]ofill [-]ofdel [-]tabs nl0 +nl1 cr0 cr1 cr2 cr3 +tab0 tab1 tab2 tab3 bs0 +bs1 vt0 vt1 ff0 ff1 +cs5 cs6 cs7 cs8 [-]cstopb +[-]cread [-]parenb [-]parodd [-]hupcl [-]clocal +[-]crtscts [-]evenp [-]parity [-]oddp [-]pass8 +[-]isig [-]icanon [-]xcase [-]echo [-]echoe +[-]echok [-]echonl [-]noflsh [-]tostop [-]iexten +[-]echoctl [-]ctlecho [-]echoprt [-]prterase [-]echoke +[-]crtkill [-]flusho [-]pendin +.fi +.SH "SEE ALSO" +.PP +LPRng Documentation, especially discussions about filters. +.SH "AUTHOR" +.PP +Patrick Powell, Start Tech, San Diego. +.br +Inspired by Ivan Popov diff --git a/man/lp_server.n b/man/lp_server.n new file mode 100644 index 0000000..7784898 --- /dev/null +++ b/man/lp_server.n @@ -0,0 +1,138 @@ +.TH ifhp 8 "_VERSION_" +.SH NAME +lp_server \- export a printer by simulation a HP JetDirect interface +.SH SYNOPSIS +.B lp_server +[-n port] [-w] [-s stty_options] [-d device] [-r remote_list] +.SH DESCRIPTION +.LP +The +.B lp_server +program will bind to the port specified by the -n option, +and wait for a TCP/IP connection. +It will then open the output device (write only if -w is specified), +applying the specified set of stty options if the device +is a serial port. +It then copies the TCP/IP output to the device output, +and copying the device output to the TCP/IP input. +.LP +The intended use for +.B lp_server +is to allow a serial or parallel printer to be made available to PC +workstations as well as to one or more LPRng servers. +.SH "OPTIONS" +The +.B lp_server +printer recognizes the following options provided by the spooler. +.TP +.BR -d " device" +The output device. +.TP +.BR -n " port" +port to use for connections. +Default is 9100. +.TP +.B -w +Open the output device write only. +Default is read/write. +.TP +.BR -t " stty_options" +A list of stty options to be applied to the device +after opening if it is a serial port. +.TP +.BR -r " remote_list" +A list of host names or IP addresses and masks from which +connections are allowed. +For example, +-r 130.191.10.30/24,dickory +would allow connections from the subnet 130.191.10.0 (24 bit netmask) +and the host dickory. +.SH EXAMPLES +.LP +lp_server -d /dev/lp -w +.LP +Opens the parallel port write only. +.LP +lp_server -d /dev/ttya + -t "38400 -echo -crmod -raw -oddp -evenp ixon pass8 -ixany cbreak" +.LP +Opens the serial port /dev/ttya, +and sets the various serial port options. +.SH STTY_OPTIONS +.PP +Due to the differences between implementations of UNIX, +there are several sets of +stty options supported. +Systems using the +.IR sgtty +tty manipulation interface may use the following +.IR stty (1) +options: +.nf +.PP +.ta 16n +16n +16n +16n +16n +16n +16n +16n +16n +bs0 bs1 [-]cbreak cooked cr0 +cr1 cr2 cr3 [-]decctlq [-]echo +[-]even ff0 ff1 [-]lcase [-]litout +nl0 nl1 nl2 nl3 [-]nl +[-]noflsh new [-]nohang old [-]odd +[-]raw start stop tab0 tab1 +tab2 [-]tabs [-]tandem tek ti700 +[-]tilde tn300 tty33 tty37 vt05 +[-]evenp [-]oddp [-]pass8 +.fi +.PP +Systems using +.IR termio +may use the following options: +.nf +.PP +[-]ignbrk [-]brkint [-]ignpar [-]parmrk [-]inpck +[-]istrip [-]inlcr [-]igncr [-]icrnl [-]iuclc +[-]ixon [-]ixany [-]ixoff [-]decctlq [-]tandem +[-]imaxbel [-]opost [-]olcuc [-]onlcr [-]ocrnl +[-]onocr [-]onlret [-]ofill [-]ofdel [-]cstopb +[-]cread [-]parenb [-]parodd [-]hupcl [-]clocal +[-]loblk [-]parity [-]evenp [-]oddp [-]stopb +[-]hup [-]crtscts [-]isig [-]noisig [-]icanon +[-]cbreak [-]xcase [-]echo [-]echoe [-]echok +[-]crterase [-]lfkc [-]echonl [-]noflsh [-]tostop +[-]echoctl [-]ctlecho [-]echoprt [-]prterase [-]echoke +[-]crtkill [-]lcase [-]nl [-]litout [-]pass8 +[-]raw [-]sane [-]cooked [-]nopost fill +nl0 nl1 cr0 cr1 cr2 +cr3 tab0 tab1 tab2 tab3 +bs0 bs1 vt0 vt1 ff0 +ff1 cs5 cs6 cs7 cs8 +nul-fill del-fill -tabs +.fi +.PP +And systems using +.IR termios +may use the following options: +.nf +.PP +[-]ignbrk [-]brkint [-]ignpar [-]parmrk [-]inpck +[-]istrip [-]inlcr [-]igncr [-]icrnl [-]iuclc +[-]ixon [-]ixany [-]ixoff [-]imaxbel [-]pass8 +[-]opost [-]olcuc [-]onlcr [-]ocrnl [-]onocr +[-]onlret [-]ofill [-]ofdel [-]tabs nl0 +nl1 cr0 cr1 cr2 cr3 +tab0 tab1 tab2 tab3 bs0 +bs1 vt0 vt1 ff0 ff1 +cs5 cs6 cs7 cs8 [-]cstopb +[-]cread [-]parenb [-]parodd [-]hupcl [-]clocal +[-]crtscts [-]evenp [-]parity [-]oddp [-]pass8 +[-]isig [-]icanon [-]xcase [-]echo [-]echoe +[-]echok [-]echonl [-]noflsh [-]tostop [-]iexten +[-]echoctl [-]ctlecho [-]echoprt [-]prterase [-]echoke +[-]crtkill [-]flusho [-]pendin +.fi +.SH "SEE ALSO" +.PP +LPRng Documentation, especially discussions about filters. +.SH "AUTHOR" +.PP +Patrick Powell, Start Tech, San Diego. +.br +Inspired by Ivan Popov diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..8f7ba8b --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,95 @@ +#************************************************************************** +#* LPRng IFHP Filter +#* Copyright 1994-1997 Patrick Powell, San Diego, CA +#* +#* Based on the CTI printer filters. +#* See COPYRIGHT for details. +#* +#* $Id: Makefile.in,v 1.2 1997/12/18 09:29:50 papowell Exp $ +# + + +prefix=@prefix@ +# where the filters are installed: +INSTDIR=${prefix}/lib/filters +# where the fonts are installed (this path should agree +# with the one in FONTPATH). +FONTDIR=${prefix}/lib/filters/fonts + +SRC=@srcdir@ +# shell to use +SHELL=@SHELL@ + +# +# the compiler optimisation/debugging flags you wish to use. +# what C compiler to use. +# +CC=@CC@ +# add additional definitions here + +# use FLAGS for additional flags +CFLAGS:= @CFLAGS@ @DEFS@ -I.. -I${SRC} $(CFLAGS) +LDFLAGS:= @LDFLAGS@ + +# libraries you will need (found by config), add more to end +LIBS=@LIBS@ + +INSTALLCMD=@INSTALL@ +SHELL = @SHELL@ + +@SET_MAKE@ +RANLIB=@RANLIB@ + +######### - no changes by configure after here ############# + +VPATH=.. ${SRC}/. + +#if you want quiet operation, i.e. - only serious messages logged, +# uncomment out the following line + +# commands made by this script +COMMANDS= lp_server + +all: ${COMMANDS} + +.PHONY: all clean install lorder + +# +# Object - Source dependencies +# +OBJS = lp_server.o stty.o log.o snprintf.o +$(OBJS): common.h + + +lp_server: $(OBJS) + ${CC} ${LDFLAGS} $(OBJS) -o $@ ${LIBS} + +# +# Installation of commands +# +install: all + -mkdir -p $(INSTDIR) + for i in $(COMMANDS) ; do \ + $(INSTALLCMD) -m 755 $$i $(INSTDIR); \ + done ; + cd $(INSTDIR); rm -f ofhp; ln -s ifhp ofhp + +# +# Miscellaneous +# + +clean: + -rm -f $(COMMANDS) *.o *.a core ? pfu tags + +ci: + if test ! -d RCS ; then mkdir RCS; fi; + for i in \ + *.[ch] Makefile* \ + accounting.sh_init banner.sh_init ellipse.ps psbanner.sh_init \ + testbanner testif testnostat testnw testof \ + ; do \ + if [ -f $$i ]; then ci $(CI) -l -mUpdate -t-Initial $$i; fi; \ + done; + +distclean: + -rm -f Makefile Makefile.bsd diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..c42bf8e --- /dev/null +++ b/src/common.h @@ -0,0 +1,67 @@ +/************************************************************************** + * LPRng IFHP Filter + * Copyright 1994-1997 Patrick Powell, San Diego, CA + * + * Based on the CTI printer filters. + * See COPYRIGHT for details. + * + * $Id: common.h,v 1.1 1997/05/30 18:53:54 papowell Exp $ +*/ + + +/**************************************************************************** + * Modification History: + * Extracted from ifhp4.c + * + * Revision 1.11 95/08/22 15:01:07 + * Version 1.2 initiated and Porting to Solaris. + * + */ + +#ifndef _COMMON_H +#define _COMMON_H 1 + +#ifdef EXTERN +# undef EXTERN +# undef DEFINE +# define EXTERN +# define DEFINE(X) X +#else +# undef EXTERN +# undef DEFINE +# define EXTERN extern +# define DEFINE(X) +#endif + +#undef _PARMS__ +#ifdef __STDC__ +#define _PARMS__(X) X +#else +#define _PARMS__(X) () +#endif + +#if defined(HAVE_STDARGS) +void log _PARMS__( (int kind, char *msg,...) ); +void fatal _PARMS__( ( char *msg,...) ); +void logerr _PARMS__( (int kind, char *msg,...) ); +void logerr_die _PARMS__( (int kind, char *msg,...) ); +int plp_snprintf (char *str, size_t count, const char *fmt, ...); +int vplp_snprintf (char *str, size_t count, const char *fmt, va_list arg); +#else +void log _PARMS__( (void) ); +void fatal _PARMS__( (void) ); +void logerr _PARMS__( (void) ); +void logerr_die _PARMS__( (void) ); +int plp_snprintf (); +int vplp_snprintf (); +#endif + +#define JABORT 1 +EXTERN char *name; +EXTERN int debug; +EXTERN int errorcode; +void Do_stty( int fd, char *Stty_command ); + +const char * Errormsg ( int err ); + +#endif /* _COMMON_H */ diff --git a/src/log.c b/src/log.c new file mode 100644 index 0000000..5c220c3 --- /dev/null +++ b/src/log.c @@ -0,0 +1,400 @@ +/************************************************************************** + * LPRng IFHP Filter + * Copyright 1994-1997 Patrick Powell, San Diego, CA + * + * Based on the CTI printer filters. + * See COPYRIGHT for details. + * + * $Id: log.c,v 1.1 1997/05/30 18:53:54 papowell Exp $ + */ + +#include "portable.h" +#include "common.h" + +#if !defined(ultrix) && defined(HAVE_SYSLOG_H) +# include +#endif +#if defined(HAVE_SYS_SYSLOG_H) +# include +#endif + +#define PAIR(X) { #X, X } +extern char * Time_str(); + +struct keys { + char *name; + int value; +} log_level[] = { +{"EMERG",LOG_EMERG}, +{"ALERT",LOG_ALERT}, +{"CRIT",LOG_CRIT}, +{"ERR",LOG_ERR}, +{"WARNING",LOG_WARNING}, +{"NOTICE",LOG_NOTICE}, +{"INFO",LOG_INFO}, +{"DEBUG",LOG_DEBUG}, +{0,0} +}; + +static char msg_buf[1024]; +extern int show_ctrl; + +void init_pid() +{ + int len; + plp_snprintf(msg_buf,sizeof(msg_buf), "%s ", name ); + len = strlen( msg_buf ); + plp_snprintf(msg_buf+len,sizeof(msg_buf)-len, + "pid [%d] ", (int)(getpid()) ); +} + +static void logbackend() +{ + int len, original_len; + original_len = len = strlen( msg_buf ); + len = strlen( msg_buf ); + (void)plp_snprintf(msg_buf+len, sizeof(msg_buf)-len, + " at %s\n", Time_str()); + (void)fputs(msg_buf, stderr ); + (void)fflush(stderr); +} + + +/* VARARGS2 */ +#ifdef HAVE_STDARGS +void log (int lvl, char *msg,...) +#else +void log (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + int lvl; + char *msg; +#endif + int len; + VA_LOCAL_DECL + VA_START (msg); + VA_SHIFT (lvl, int); + VA_SHIFT (msg, char *); + + lvl = show_ctrl; + show_ctrl = 1; + init_pid(); + len = strlen(msg_buf); + (void)vplp_snprintf(msg_buf+len, sizeof(msg_buf)-len, msg, ap ); + logbackend(); + show_ctrl = lvl; + VA_END; +} + +/* VARARGS1 */ +#ifdef HAVE_STDARGS +void fatal ( char *msg,...) +#else +void fatal (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + int lvl; + char *msg; +#endif + int len; + int lvl; + VA_LOCAL_DECL + VA_START (msg); + VA_SHIFT (msg, char *); + + lvl = show_ctrl; + show_ctrl = 1; + init_pid(); + len = strlen(msg_buf); + (void)vplp_snprintf(msg_buf+len, sizeof(msg_buf)-len, msg, ap ); + logbackend(); + show_ctrl = lvl; + VA_END; + exit(errorcode); +} + + +/* VARARGS2 */ +#ifdef HAVE_STDARGS +void logerr (int lvl, char *msg,...) +#else +void logerr (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + int lvl; + char *msg; +#endif + VA_LOCAL_DECL + int err = errno; + int len; + + VA_START (msg); + VA_SHIFT (lvl, int); + VA_SHIFT (msg, char *); + + lvl = show_ctrl; + show_ctrl = 1; + + init_pid(); + len = strlen(msg_buf); + (void)vplp_snprintf(msg_buf+len, sizeof(msg_buf)-len, msg, ap ); + len = strlen(msg_buf); + plp_snprintf( msg_buf+len, sizeof(msg_buf)-len, " - %s", Errormsg( err ) ); + logbackend(); + show_ctrl = lvl; + VA_END; +} + + +/* VARARGS2 */ +#ifdef HAVE_STDARGS +void logerr_die (int lvl, char *msg,...) +#else +void logerr_die (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + int lvl; + char *msg; +#endif + VA_LOCAL_DECL + int err = errno; + int len; + + VA_START (msg); + VA_SHIFT (lvl, int); + VA_SHIFT (msg, char *); + + lvl = show_ctrl; + show_ctrl = 1; + + init_pid(); + len = strlen(msg_buf); + (void)vplp_snprintf(msg_buf+len, sizeof(msg_buf)-len, msg, ap ); + len = strlen(msg_buf); + plp_snprintf( msg_buf+len, sizeof(msg_buf)-len, " - %s", Errormsg( err ) ); + logbackend(); + VA_END; + show_ctrl = lvl; + exit(errorcode); +} + + +char * Time_str() +{ + time_t tvec; /* time */ + char *ctime(); + static char s[40]; + + (void)time(&tvec); + (void)strcpy(s,ctime(&tvec)); + (void)strcpy(s+20,s+24); + s[strlen(s)-1] = 0; + return( s+4 ); +} + +/**************************************************************************** + * char *Errormsg( int err ) + * returns a printable form of the + * errormessage corresponding to the valie of err. + * This is the poor man's version of sperror(), not available on all systems + * Patrick Powell Tue Apr 11 08:05:05 PDT 1995 + ****************************************************************************/ +/****************************************************************************/ +#if !defined(HAVE_STRERROR) + +# if defined(HAVE_SYS_NERR) +# if !defined(HAVE_SYS_NERR_DEF) + extern int sys_nerr; +# endif +# define num_errors (sys_nerr) +# else +# define num_errors (-1) /* always use "errno=%d" */ +# endif + +# if defined(HAVE_SYS_ERRLIST) +# if !defined(HAVE_SYS_ERRLIST_DEF) + extern const char *const sys_errlist[]; +# endif +# else +# undef num_errors +# define num_errors (-1) /* always use "errno=%d" */ +# endif + +#endif + +const char * Errormsg ( int err ) +{ + const char *cp; + +#if defined(HAVE_STRERROR) + cp = strerror(err); +#else +# if defined(HAVE_SYS_ERRLIST) + if (err >= 0 && err < num_errors) { + cp = sys_errlist[err]; + } else +# endif + { + static char msgbuf[32]; /* holds "errno=%d". */ + (void) plp_snprintf (msgbuf, sizeof(msgbuf), "errno=%d", err); + cp = msgbuf; + } +#endif + return (cp); +} + +/*************************************************************************** + * char *Sigstr(n) + * Return a printable form the the signal + ***************************************************************************/ + +#ifndef HAVE_SYS_SIGLIST + +#define PAIR(X) { #X , X } + +static struct signame { + char *str; + int value; +} signals[] = { +{ "NO SIGNAL", 0 }, +#ifdef SIGHUP +PAIR(SIGHUP), +#endif +#ifdef SIGINT +PAIR(SIGINT), +#endif +#ifdef SIGQUIT +PAIR(SIGQUIT), +#endif +#ifdef SIGILL +PAIR(SIGILL), +#endif +#ifdef SIGTRAP +PAIR(SIGTRAP), +#endif +#ifdef SIGIOT +PAIR(SIGIOT), +#endif +#ifdef SIGABRT +PAIR(SIGABRT), +#endif +#ifdef SIGEMT +PAIR(SIGEMT), +#endif +#ifdef SIGFPE +PAIR(SIGFPE), +#endif +#ifdef SIGKILL +PAIR(SIGKILL), +#endif +#ifdef SIGBUS +PAIR(SIGBUS), +#endif +#ifdef SIGSEGV +PAIR(SIGSEGV), +#endif +#ifdef SIGSYS +PAIR(SIGSYS), +#endif +#ifdef SIGPIPE +PAIR(SIGPIPE), +#endif +#ifdef SIGALRM +PAIR(SIGALRM), +#endif +#ifdef SIGTERM +PAIR(SIGTERM), +#endif +#ifdef SIGURG +PAIR(SIGURG), +#endif +#ifdef SIGSTOP +PAIR(SIGSTOP), +#endif +#ifdef SIGTSTP +PAIR(SIGTSTP), +#endif +#ifdef SIGCONT +PAIR(SIGCONT), +#endif +#ifdef SIGCHLD +PAIR(SIGCHLD), +#endif +#ifdef SIGCLD +PAIR(SIGCLD), +#endif +#ifdef SIGTTIN +PAIR(SIGTTIN), +#endif +#ifdef SIGTTOU +PAIR(SIGTTOU), +#endif +#ifdef SIGIO +PAIR(SIGIO), +#endif +#ifdef SIGPOLL +PAIR(SIGPOLL), +#endif +#ifdef SIGXCPU +PAIR(SIGXCPU), +#endif +#ifdef SIGXFSZ +PAIR(SIGXFSZ), +#endif +#ifdef SIGVTALRM +PAIR(SIGVTALRM), +#endif +#ifdef SIGPROF +PAIR(SIGPROF), +#endif +#ifdef SIGWINCH +PAIR(SIGWINCH), +#endif +#ifdef SIGLOST +PAIR(SIGLOST), +#endif +#ifdef SIGUSR1 +PAIR(SIGUSR1), +#endif +#ifdef SIGUSR2 +PAIR(SIGUSR2), +#endif +{0,0} + /* that's all */ +}; + +#else /* HAVE_SYS_SIGLIST */ +# ifndef HAVE_SYS_SIGLIST_DEF + extern const char *sys_siglist[]; +# endif +#endif + +#ifndef NSIG +# define NSIG 32 +#endif + +const char *Sigstr (int n) +{ + static char buf[40]; + const char *s = 0; + +#ifdef HAVE_SYS_SIGLIST + if (n < NSIG && n >= 0) { + s = sys_siglist[n]; + } +#else + int i; + + for( i = 0; signals[i].str && signals[i].value != n; ++i ); + s = signals[i].str; +#endif + if( s == 0 ){ + s = buf; + (void) plp_snprintf (buf, sizeof(buf), "signal %d", n); + } + return(s); +} diff --git a/src/lp_server.c b/src/lp_server.c new file mode 100644 index 0000000..3cc93b0 --- /dev/null +++ b/src/lp_server.c @@ -0,0 +1,307 @@ +/* + lp_server [-n port] [-w] [-d device] [-t stty_cmds] + + Export a printer by simulating an HP JetDirect interface. + -n connection port (default 9100) + -w open output device write only (default r/w) + -d device (default /dev/lp) + -t stty_cmds - stty commands to apply if device is serial port + + The lp_server will bind to the connection port, and wait for + an incoming connection. After accepting a connection, it + opens the output device, (rw or write only as specified), + applys the stty options, and then copies the connection output + to the device input and vice versa. + + + Copyright 1994-1997 Patrick Powell, San Diego, CA + + $Id: lp_server.c,v 1.3 1997/12/18 09:29:50 papowell Exp $ +*/ + + +#define EXTERN +#include "portable.h" +#include "common.h" +#include +#include +#include +#include +#include + + +char *device = "/dev/lp"; +char *stty_opts; +char *port = "9100"; +int write_only; +void usage(void); +int sock, conn, dev = -1; +int pid; + +char *restrict; + +char buffer[1024]; + +int tcp_open( char * portname ); +int Check_restriction(char *restrict, struct sockaddr_in *sin); + +extern char *optarg; +extern int optind; + +int main( int argc, char *argv[] ) +{ + int c, n, maxfd, mask; + struct sockaddr_in sin; + fd_set readfds; + + name = argv[0]; + while( ((c = getopt(argc, argv, "D:n:wd:t:r:")) != EOF) ){ + switch(c){ + case 'D': debug = atoi(optarg); break; + case 'n': port = optarg; break; + case 'w': write_only = 1; break; + case 'r': restrict = optarg; break; + case 'd': device = optarg; break; + case 't': stty_opts = optarg; break; + default: usage(); + } + } + if( optind != argc ) usage(); + + /* step 1 - bind to the port */ + sock = tcp_open( port ); + if( sock < 0 ) exit(1); + + if( debug ) log(1,"socket %d", sock ); + + while(1) { + /* accept a connection */ + if( dev >= 0 ) close(dev); dev = -1; + if( debug ) log( 1, "waiting" ); + n = sizeof(sin); + conn = accept( sock,(void *) &sin, &n ); + if(debug) log(1,"conn %d", conn ); + if( conn == -1 && errno != EINTR ){ + logerr_die(1, "accept failed" ); + } + if( restrict && Check_restriction(restrict, &sin) ){ + if( debug ) log( 1, "reject %s", inet_ntoa( sin.sin_addr ) ); + close( conn ); + continue; + } + /* open the output device */ + if( write_only ){ + dev = open( device, O_WRONLY|O_NONBLOCK ); + } else { + dev = open( device, O_RDWR|O_NONBLOCK ); + } + if( dev == -1 ){ + logerr_die(1, "open of %s failed", device ); + } + if(debug) log(1,"dev %d", dev ); + mask = fcntl( dev, F_GETFL, 0 ); + if( mask == -1 ){ + logerr_die(1,"fcntl F_GETFL of '%s' failed", device); + } + if( mask & O_NONBLOCK ){ + mask &= ~O_NONBLOCK; + mask = fcntl( dev, F_SETFL, mask ); + if( mask == -1 && errno != ENODEV ){ + logerr_die( 1, "fcntl F_SETFL of '%s' failed", + device ); + } + } + if( isatty( dev ) && stty_opts ){ + Do_stty( dev, stty_opts ); + } + + /* write/read-write loop */ + for(;;) { + FD_ZERO( &readfds ); + + FD_SET( conn, &readfds ); + if( !write_only ) { + if(debug) log(1, "read/write mode FD_SET"); + FD_SET( dev, &readfds ); + } + + if( conn > dev ) { + maxfd = conn; + } else { + maxfd = dev; + } + + maxfd++; + + n = select( maxfd, &readfds, ( fd_set * ) 0, ( fd_set * ) 0, 0 ); + if(debug) log(1, "select returned %d", n); + + if( n == -1 ) { + logerr_die(1, "an error occured with the select statement"); + } + + if( FD_ISSET( conn, &readfds ) ) { + /* data on socket */ + if( (n = read( conn, buffer, sizeof( buffer ))) <= 0) + break; + if(debug) log(1,"read %d bytes from socket", n); + + n = write( dev, buffer, n ); + if(debug) log(1, "wrote %d bytes to device", n); + } + + if( !write_only ) { + if( FD_ISSET( dev, &readfds ) ) { + /* data on device */ + n = read( dev, buffer, sizeof( buffer )); + if(debug) log(1,"read %d bytes from device", n); + n = write( conn, buffer, n ); + if(debug) log(1, "wrote %d bytes to socket", n); + } + } + } + + /* close connections */ + close( conn ); conn = -1; + close( dev ); dev = -1; + } + return(0); +} + + +int tcp_open( char *portname ) +{ + int port, i, fd, err; + int option, len; + struct sockaddr_in sin; + struct servent *servent; + + port = atoi( portname ); + if( port <= 0 ){ + servent = getservbyname( portname, "tcp" ); + if( servent ){ + port = ntohs( servent->s_port ); + } + } + if( port <= 0 ){ + fprintf( stderr, "tcp_open: bad port number '%s'\n",portname ); + return( -1 ); + } + if( debug ) log(1, "port %d", port ); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + sin.sin_port = htons( port ); + + fd = socket( AF_INET, SOCK_STREAM, 0 ); + err = errno; + if( fd < 0 ){ + fprintf(stderr,"tcp_open: socket call failed - %s\n", Errormsg(err) ); + return( -1 ); + } + i = bind( fd, (struct sockaddr *) & sin, sizeof (sin) ); + err = errno; + + if( i < 0 ){ + fprintf(stderr,"tcp_open: bind to '%s port %d' failed - %s\n", + inet_ntoa( sin.sin_addr ), ntohs( sin.sin_port ), + Errormsg(errno) ); + close(fd); + return( -1 ); + } +/* #ifdef SO_REUSEADDR */ + len = sizeof( option ); + option = 1; + if( setsockopt( fd, SOL_SOCKET, SO_REUSEADDR, + (char *)&option, sizeof(option) ) ){ + logerr_die( 1, "setsockopt failed" ); + } +/* #endif */ + + i = listen( fd, 10 ); + err = errno; + + if( i < 0 ){ + fprintf(stderr,"tcp_open: listen to '%s port %d' failed - %s\n", + inet_ntoa( sin.sin_addr ), ntohs( sin.sin_port ), + Errormsg(errno) ); + close(fd); + return( -1 ); + } + return( fd ); +} + +char *msg[] = { +"lp_server [-n port] [-w] [-d device] [-t stty_cmds]", +" Version " VERSION , +" Export a printer by simulating an HP JetDirect interface.", +" -n connection port (default 9100)", +" -w open output device write only (default r/w)", +" -d device (default /dev/lp)", +" -t stty_cmds - stty commands to apply if device is serial port", +" -r remote_list - remote hosts allowed, in IP/netmask or hostname", +" separated by commas. i.e. - 130.191.20.10/24,dickory would", +" allow connections from subnet 130.191.20.0 (24 bit netmask)", +" and host dickory", +" -D level - set debug level", +0 +}; + +void usage() +{ + char *s; + int i; + for( i = 0; (s = msg[i]); ++i ){ + fprintf( stderr, "%s\n", s ); + } + exit(1); +} + +/* + * check restrictions on connecting host + */ + +int Check_restriction(char *restrict, struct sockaddr_in *sin) +{ + char *s, *mask, *end, *b; + struct hostent *h; + struct sockaddr_in addr; + unsigned long n, m, a; + + a = ntohl( sin->sin_addr.s_addr ); + if( debug ) log(1,"remote 0x%x", a ); + b = strdup( restrict ); + for( s = b; s; s = end ){ + end = strchr( s, ',' ); + if( end ){ + *end++ = 0; + } + while( isspace( *s ) ) ++s; + mask = strchr( s, '/' ); + if( mask ){ + *mask++ = 0; + } + if( ( h = gethostbyname( s ) ) ){ + memcpy( &addr.sin_addr, h->h_addr_list[0], sizeof(addr.sin_addr)); + n = ntohl( addr.sin_addr.s_addr ); + } else { + n = inet_addr( s ); + } + if( n == -1 ){ + log(1,"bad addr format '%s'", s ); + return(1); + } + m = -1; + if( mask ){ + m = atoi( mask ); + if( m == 0 || m > 32 ){ + log(1,"bad mask format '%s'", mask ); + } + m = ~((1 << (32-m)) - 1); + } + if( debug ) log( 1, "checking 0x%x, mask 0x%x", n, m ); + n = (n ^ a) & m; + if( debug ) log( 1, "result 0x%x", n ); + if( n == 0 ) return( 0 ); + } + return( 1 ); +} diff --git a/src/portable.h b/src/portable.h new file mode 100644 index 0000000..18131e8 --- /dev/null +++ b/src/portable.h @@ -0,0 +1,761 @@ +/*************************************************************************** + * LPRng - An Extended Print Spooler System + * + * Copyright 1988-1997, Patrick Powell, San Diego, CA + * papowell@sdsu.edu + * See LICENSE for conditions of use. + * + *************************************************************************** + * MODULE: portable.h + * PURPOSE: + * The configure program generates config.h, which defines various + * macros indicating the presence or abscence of include files, etc. + * However, there are some systems which pass the tests, but things + * do not work correctly on them. This file will try and fix + * these things up for the user. + * + * NOTE: if there were no problems, this file would be: + * #include "config.h" + * + * Sigh. Patrick Powell Thu Apr 6 07:00:48 PDT 1995 + * NOTE: thanks to all the folks who worked on the PLP software, + * Justin Mason especially. Some of the things + * that you have to do to get portability are truely bizzare. + * + * $Id: portable.h,v 1.1 1997/05/30 18:53:54 papowell Exp $ + **************************************************************************/ + +#ifndef _PLP_PORTABLE_H +#define _PLP_PORTABLE_H 1 + +#ifndef __STDC__ +LPRng requires ANSI Standard C compiler +#endif + +#include "config.h" + +/************************************************************************* + * ARGH: some things that "configure" can't get right. +*************************************************************************/ + +/*************************************************************************** + * porting note: if you port PLP and you get some errors + * caused by autoconf guessing the wrong set of functions/headers/structs, + * add or change the entry for your system in the ARGH section below. + * You might want to try and determine how your system is identified + * by the C preprocessor and use this informaton rather than trying + * to look for information in various f1les. + * Patrick Powell and Justin Mason + ***************************************************************************/ + +/************************************************************************* + * APOLLO Ports + * Thu Apr 6 07:01:51 PDT 1995 Patrick Powell + * This appears to be historical. + *************************************************************************/ +#ifdef apollo +# define IS_APOLLO +/* #undef __STDC__ */ +/* # define CONFLICTING_PROTOS */ +#endif + +/************************************************************************* + * ULTRIX. + * Patrick Powell Thu Apr 6 07:17:34 PDT 1995 + * + * Take a chance on using the standard calls + *************************************************************************/ +#ifdef ultrix +# define IS_ULTRIX +#endif + + +/************************************************************************* + * AIX. + *************************************************************************/ +#ifdef _AIX32 +# define IS_AIX32 +#endif + +/************************************************************************* + * Sun + *************************************************************************/ + +#if defined(sun) +#endif + + +/************************************************************************* + * Cray + *************************************************************************/ + +#if defined(cray) +#define MAXPATHLEN 1023 +#define HAVE_SIGSETJMP 1 + +/* configure incorrectly chooses STATVFS */ +#if defined(USE_STATFS_TYPE) +#undef USE_STATFS_TYPE +#endif + +#define USE_STATFS_TYPE SRV3_STATFS +#endif + + +/*************************************************************************/ +#if defined(NeXT) +# define IS_NEXT +# define __STRICT_BSD__ +#endif + +/*************************************************************************/ +#if defined(__sgi) && defined(_SYSTYPE_SVR4) +# define IS_IRIX5 +#endif + +/*************************************************************************/ +#if defined(__sgi) && defined(_SYSTYPE_SYSV) +#define IS_IRIX4 +#endif + +/*************************************************************************/ +#if defined(__linux__) || defined (__linux) || defined (LINUX) +# define IS_LINUX +#endif + + +/*************************************************************************/ +#if defined(__hpux) || defined(_HPUX_SOURCE) +# define IS_HPUX +# undef _HPUX_SOURCE +# define _HPUX_SOURCE 1 +#endif + +/*************************************************************************/ + +#if defined(__convex__) /* Convex OS 11.0 - from w_stef */ +# define IS_CONVEX +# define LPASS8 (L004000>>16) +#endif + +/*************************************************************************/ + +#ifdef _AUX_SOURCE +# define IS_AUX +# define _POSIX_SOURCE + +# undef SETPROCTITLE + +#endif + +/*************************************************************************/ + +#if defined(SNI) && defined(sinix) +# define IS_SINIX +#endif + + +/*************************************************************************/ +#if defined(__svr4__) && !defined(SVR4) +# define SVR4 __svr4__ +#endif + +/*************************************************************************** + * Solaris SUNWorks CC compiler + * man page indicates __SVR4 is defined, as is __unix, __sun + ***************************************************************************/ +#if (defined(__SVR4) || defined(_SVR4_)) && !defined(SVR4) +# define SVR4 1 +#endif + +/*************************************************************************/ +#if defined(__bsdi__) +# define IS_BSDI +#endif + +/*************************************************************************/ + +/************************************************************************* + * we also need some way of spotting IS_DATAGEN (Data Generals), + * and IS_SEQUENT (Sequent machines). Any suggestions? + * these ports probably don't work anymore... + *************************************************************************/ + +/************************************************************************* + * END OF ARGH SECTION; next: overrides from the Makefile. + *************************************************************************/ +/************************* + * STTY functions to use * + *************************/ +#define SGTTYB 0 +#define TERMIO 1 +#define TERMIOS 2 + +/************************* + * FSTYPE functions to use * + *************************/ + +#define SVR3_STATFS 0 +#define ULTRIX_STATFS 1 +#define STATFS 2 +#define STATVFS 3 + +#if defined(MAKE_USE_STATFS) +# undef USE_STATFS +# define USE_STATFS MAKE_USE_STATFS +#endif + +#if defined(MAKE_USE_STTY) +# undef USE_STTY +# define USE_STTY MAKE_USE_STTY +#endif + + +/********************************************************************* + * GET STANDARD INCLUDE FILES + * This is the one-size-fits-all include that should grab everthing. + * This has a horrible impact on compilation speed, but then, do you + * want compilation speed or portability? + * + * Patrick Powell Thu Apr 6 07:21:10 PDT 1995 + ********************************************************************* + * If you do not have the following, you are doomed. Or at least + * going to have an uphill hard time. + * NOTE: string.h might also be strings.h on some very very odd systems + * + * Patrick Powell Thu Apr 6 07:21:10 PDT 1995 + *********************************************************************/ + +/********************************************************************* + * yuck -- this is a nightmare! half-baked-ANSI systems are poxy (jm) + * + * Note that configure checks for absolute compliance, i.e.- + * older versions of SUNOS, HP-UX, do not meet this. + * + * Patrick Powell Thu Apr 6 07:21:10 PDT 1995 + *********************************************************************/ + + +#ifdef HAVE_UNISTD_H +# include +#else + extern int dup2 (); + extern int execve (); + extern uid_t geteuid (), getegid (); + extern int setgid (), getgid (); +#endif + + +#ifdef HAVE_STDLIB_H +# include +#else + char *getenv( char * ); + void abort(void); +#endif + +#include +#include +#include +#if defined(HAVE_STRINGS_H) +# include +#endif +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef HAVE_MEMORY_H +#include +#endif + +#ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +#endif + +/* case insensitive compare for OS without it */ +#if !defined(HAVE_STRCASECMP) + int strcasecmp (const char *s1, const char *s2); +#endif +#if !defined(HAVE_STRNCASECMP) + int strncasecmp (const char *s1, const char *s2, int len ); +#endif + + +/********************************************************************* + * directory management is nasty. There are two standards: + * struct directory and struct dirent. + * Solution: macros + a typedef. + * Patrick Powell Thu Apr 6 07:44:50 PDT 1995 + * + *See GNU autoconf documentation for this little AHEM gem... and others + * too obnoxious to believe + *********************************************************************/ + +#if HAVE_DIRENT_H +# include +# define NLENGTH(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NLENGTH(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include +# endif +# if HAVE_SYS_DIR_H +# include +# endif +# if HAVE_NDIR_H +# include +# endif +#endif + +typedef struct dirent plp_dir_t; + +/********************************************************************* + * malloc strikes again. Definition is a la ANSI C. However, + * You may need to edit this on historical systems. + * Patrick Powell Thu Apr 6 07:47:54 PDT 1995 + *********************************************************************/ + +#ifdef HAVE_MALLOC_H +# include +#else +# if !defined(HAVE_STDLIB_H) + void *malloc(size_t); + void free(void *); +# endif +#endif + +#ifndef HAVE_ERRNO_DECL + extern int errno; +#endif + +/********************************************************************* + * Note the may already be included by some previous + * lines. You may need to edit this by hand. + * Better solution is to put include guards in all of the include files. + * Patrick Powell Thu Apr 6 07:55:58 PDT 1995 + *********************************************************************/ + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +#else +# include +# endif +#endif + +#ifdef HAVE_SYS_FILE_H +# include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif + +#ifdef HAVE_SYS_FCNTL_H +# include +#endif +#ifdef HAVE_FCNTL_H +# include +#endif + +/* + * we use the FCNTL code if we have it + * We want you to define F_SETLK, etc. If they are not defined, + * Then you better put a system dependent configuration + * in and define them. + */ +#if defined(HAVE_FCNTL) && ! defined(F_SETLK) +/*ABORT: "defined(HAVE_FCNTL) && ! defined(F_SETLK)"*/ +#undef HAVE_FCNTL +#endif + +#if defined(HAVE_LOCKF) && ! defined(F_LOCK) +/*ABORT: "defined(HAVE_LOCKF) && ! defined(F_LOCK)"*/ +/* You must fix this up */ +#undef HAVE_LOCKF +#endif + +#if defined(HAVE_FLOCK) && ! defined(LOCK_EX) +/*AB0RT: "defined(HAVE_FLOCK) && ! defined(LOCK_EX)"*/ +/* You must fix this up */ +#undef HAVE_FLOCK +#endif + +#ifdef HAVE_LIMITS_H +#include +#endif + +/* 4.2 BSD systems */ +#ifndef S_IRUSR +# define S_IRUSR S_IREAD +# define S_IWUSR S_IWRITE +# define S_IXUSR S_IEXEC +# define S_IXGRP (S_IEXEC >> 3) +# define S_IXOTH (S_IEXEC >> 6) +#endif + +#ifndef S_ISLNK +# define S_ISLNK(mode) (((mode) & S_IFLNK) == S_IFLNK) +#endif +#ifndef S_ISREG +# define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG) +#endif +#ifndef S_ISDIR +# define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR) +#endif + + +/* 4.2 BSD systems */ +#ifndef SEEK_SET +# define SEEK_SET 0 +# define SEEK_CUR 1 +# define SEEK_END 2 +#endif + +#ifndef HAVE_KILLPG +# define killpg(pg,sig) ((int) kill ((pid_t)(-(pg)), (sig))) +#else +extern int killpg(pid_t pgrp, int sig); +#endif + +/*********************************************************************** + * wait() stuff: most recent systems support a compatability version + * of "union wait", but it's not as fully-featured as the recent stuff + * that uses an "int *". However, we want to keep support for the + * older BSD systems as much as possible, so it's still supported; + * however, if waitpid() exists, we're POSIX.1 compliant, and we should + * not use "union wait". (hack hack hack) (jm) + * + * I agree. See the waitchild.c code for a tour through the depths of + * portability hell. + * + * Patrick Powell Thu Apr 6 08:03:58 PDT 1995 + * + ***********************************************************************/ + +#ifdef HAVE_WAITPID +# undef HAVE_UNION_WAIT /* and good riddance */ +#endif + +/*************************************************************************** + * HAVE_UNION_WAIT will be def'd by configure if it's in , + * and isn't just there for compatibility (like it is on HP/UX). + ***************************************************************************/ + +#ifdef HAVE_UNION_WAIT +typedef union wait plp_status_t; +/* + * with some BSDish systems, there are already #defines for this, + * so we should use them if they're there. + */ +# ifndef WCOREDUMP +# define WCOREDUMP(x) ((x).w_coredump) +# endif +# ifndef WEXITSTATUS +# define WEXITSTATUS(x) ((x).w_retcode) +# endif +# ifndef WTERMSIG +# define WTERMSIG(x) ((x).w_termsig) +# endif +# ifndef WIFSTOPPED +# define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) +# endif +# ifndef WIFEXITED +# define WIFEXITED(x) ((x).w_stopval == WEXITED) +# endif + +#else + typedef int plp_status_t; +/* The POSIX defaults for these macros. (this is cheating!) */ +# ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +# endif +# ifndef WCOREDUMP +# define WCOREDUMP(x) ((x) & 0x80) +# endif +# ifndef WEXITSTATUS +# define WEXITSTATUS(x) ((((unsigned) x) >> 8) & 0xff) +# endif +# ifndef WIFSIGNALED +# define WIFSIGNALED(x) (WTERMSIG (x) != 0) +# endif +# ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +# endif +#endif /* HAVE_UNION_WAIT */ + +/*********************************************************************** + * SVR4: SIGCHLD is really SIGCLD; #define it here. + * PLP lpd _does_ handle the compatibility semantics properly + * (Advanced UNIX Programming p. 281). + ***********************************************************************/ + +#if !defined(SIGCHLD) && defined(SIGCLD) +# define SIGCHLD SIGCLD +#endif + + +/*********************************************************************** + * configure will set RETSIGTYPE to the type returned by signal() + ***********************************************************************/ + +typedef RETSIGTYPE plp_signal_t; +typedef plp_signal_t (*plp_sigfunc_t)(int) ; + +#ifndef HAVE_GETDTABLESIZE +# ifdef NOFILE +# define getdtablesize() NOFILE +# else +# ifdef NOFILES_MAX +# define getdtablesize() NOFILES_MAX +# endif +# endif +#endif + +#ifndef HAVE_STRDUP +# ifdef __STDC__ + char *strdup(const char*); +# else + char *strdup(); +# endif +#endif + +#ifndef IPPORT_RESERVED +#define IPPORT_RESERVED 1024 +#endif + + +/* varargs declarations: */ + +#if defined(HAVE_STDARG_H) +# include +# define HAVE_STDARGS /* let's hope that works everywhere (mj) */ +# define VA_LOCAL_DECL va_list ap; +# define VA_START(f) va_start(ap, f) +# define VA_SHIFT(v,t) ; /* no-op for ANSI */ +# define VA_END va_end(ap) +#else +# if defined(HAVE_VARARGS_H) +# include +# undef HAVE_STDARGS +# define VA_LOCAL_DECL va_list ap; +# define VA_START(f) va_start(ap) /* f is ignored! */ +# define VA_SHIFT(v,t) v = va_arg(ap,t) +# define VA_END va_end(ap) +# else +XX ** NO VARARGS ** XX +# endif +#endif + +#if !defined(IS_ULTRIX) && defined(HAVE_SYSLOG_H) +# include +#endif +#if defined(HAVE_SYS_SYSLOG_H) +# include +#endif +# if !(defined(LOG_PID) && defined(LOG_NOWAIT) && defined(HAVE_OPENLOG)) +# undef HAVE_OPENLOG +# endif /* LOG_PID && LOG_NOWAIT */ + +/* + * Priorities (these are ordered) + */ +#ifndef LOG_ERR +# define LOG_EMERG 0 /* system is unusable */ +# define LOG_ALERT 1 /* action must be taken immediately */ +# define LOG_CRIT 2 /* critical conditions */ +# define LOG_ERR 3 /* error conditions */ +# define LOG_WARNING 4 /* warning conditions */ +# define LOG_NOTICE 5 /* normal but signification condition */ +# define LOG_INFO 6 /* informational */ +# define LOG_DEBUG 7 /* debug-level messages */ +#endif + +#ifdef LOG_LPR +# define SYSLOG_FACILITY LOG_LPR +#else +# ifdef LOG_LOCAL0 +# define SYSLOG_FACILITY LOCAL0 +# else +# define SYSLOG_FACILITY (0) /* for Ultrix -- facilities aren't supported */ +# endif +#endif + +/************************************************************************* + * If we have SVR4 and no setpgid() then we need getpgrp() + *************************************************************************/ +#if defined(SVR4) || defined(__alpha__) +# undef HAVE_SETPGRP_0 +#endif + +/* + * NONBLOCKING Open and IO - different flags for + * different systems + */ + +#ifndef O_NONBLOCK +#define O_NONBLOCK 0 +#endif + +#ifndef O_NOCTTY +#define O_NOCTTY 0 +#endif + + +#define NONBLOCK (O_NDELAY|O_NONBLOCK) +#ifdef IS_HPUX +#undef NONBLOCK +#define NONBLOCK (O_NONBLOCK) +#endif + + +/********************************************************************* + * AIX systems need this + *********************************************************************/ + +#if defined(HAVE_SYS_SELECT_H) +# include +#endif + +/********************************************************************** + * Signal blocking + **********************************************************************/ +#ifdef HAVE_SIGPROCMASK +/* a signal set */ +typedef sigset_t plp_block_mask; +#else +/* an integer */ +typedef int plp_block_mask; +#endif + +#define FD_SET_FIX(X) X + +/********************************************************************** + * SUNOS Definitions + **********************************************************************/ +#ifdef SUNOS +extern int _flsbuf(int, FILE *); +extern int _filbuf(FILE *); +extern int accept(int s, struct sockaddr *name, int *namelen); +extern int bind(int s, struct sockaddr *name, int namelen); +extern int connect(int s, struct sockaddr *name, int namelen); +extern void bzero(void *s, size_t n); +extern void endgrent( void ); +extern int fflush( FILE *stream ); +extern int fclose( FILE *stream ); +extern int flock( int fd, int operation ); +extern int fprintf(FILE *, const char *, ...); +extern int fputs( const char *, FILE *stream ); +extern int fstat(int fd, struct stat *buf ); +extern int fseek( FILE *stream, long offset, int ptrname ); +extern int ftruncate( int fd, off_t length ); +extern int fwrite( char *ptr, int size, int nitems, FILE *stream); +extern int getdtablesize( void ); +extern int getpeername(int s, struct sockaddr *name, int *namelen); +extern int getsockname(int s, struct sockaddr *name, int *namelen); +extern int getsockopt(int s, int level, int optname, char *optval,int *optlen); +extern int ioctl(int fd, int request, caddr_t arg ); +extern int killpg(int pgrp, int sig ); +extern int listen(int s, int backlog ); +extern int lockf(int fd, int cmd, long size ); +/*extern int lseek(int fd, off_t pos, int how ); */ +extern int lstat(const char *path, struct stat *buf ); +#define memmove(dest,src,len) bcopy(src,dest,len) +extern void bcopy(char *src,char *dest,int len); +extern int mkstemp(char *s ); +extern int openlog( const char *ident, int logopt, int facility ); +extern int perror(const char *); +extern int printf( const char *, ...); +extern int rename(const char *, const char *); +extern int select (int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); +extern void setgrent(void); +extern int setreuid( int ruid, int euid ); +extern int setsockopt(int s, int level, int optname, const char *optval,int optlen); +extern int socket( int domain, int type, int protocol ); +extern int socketpair(int, int, int, int *); +extern int sscanf( char *s, char *format, ... ); +extern int stat(const char *path, struct stat *buf ); +extern int strcasecmp( const char *, const char * ); +extern char *strerror( int ); +extern int strncasecmp( const char *, const char *, int n ); +extern int long strtol( char *str, char **ptr, int base ); +extern int strftime(char *buf, int bufsize, const char *fmt, struct tm *tm); +extern void syslog(int, const char *, ...); +extern int system( const char *str ); +extern int tgetent( char *buffer, char *name ); +extern time_t time( time_t *t ); +extern int tolower( int ); +extern int toupper( int ); +extern void tputs( const char *cp, int affcnt, int (*outc)() ); +extern int vfprintf(FILE *, const char *, ...); +extern int vprintf(FILE *, const char *, va_list ap); +#endif + +#ifdef SOLARIS +extern int setreuid( uid_t ruid, uid_t euid ); +extern int mkstemp(char *s ); +#ifdef HAVE_GETDTABLESIZE +extern int getdtablesize(void); +#endif +#endif + +#ifdef HPUX +extern void syslog(int, const char *, ...); +#if !defined(HAVE_OPENLOG_DEF) +extern int openlog( const char *ident, int logopt, int facility ); +#endif +#undef FD_SET_FIX +#define FD_SET_FIX(X) (int *) +#endif + +#ifdef IS_AIX32 +extern int tgetent(char *, char *); +#if !defined(HAVE_OPENLOG_DEF) +void openlog(const char *, int, int); +void syslog(int, const char *, ...); +#endif +extern int seteuid(uid_t); +#endif + + +/* IPV6 structures define */ + +#if !defined(AF_INET6) +# define AF_INET6 24 +#endif + +#if defined(IN_ADDR6) +# define in6_addr in_addr6 +# define IN6_ADDR +#endif + +#if !defined(IN6_ADDR) +# define IN6_ADDR +# define SIN6_LEN 16 + +struct in6_addr { unsigned char s6_addr[SIN6_LEN]; }; +struct sockaddr_in6 { + /* unsigned char sin6_len; */ + unsigned char sin6_family; + unsigned short sin6_port; + unsigned int sin6_flowinfo; + struct in6_addr sin6_addr; +}; +#endif + +#endif /* PLP_PORTABLE_H */ diff --git a/src/snprintf.c b/src/snprintf.c new file mode 100644 index 0000000..c6fb3d7 --- /dev/null +++ b/src/snprintf.c @@ -0,0 +1,277 @@ +/************************************************************************** + * LPRng IFHP Filter + * Copyright 1994-1997 Patrick Powell, San Diego, CA + * + * Based on the CTI printer filters. + * See COPYRIGHT for details. + * + * $Id: snprintf.c,v 1.1 1997/05/30 18:53:55 papowell Exp $ + */ + +#include "portable.h" + +static char *const _id = "$Id: snprintf.c,v 1.1 1997/05/30 18:53:55 papowell Exp $"; +static void dopr(); +static char *end; + +/************************************************************** + * Original: + * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 + * A bombproof version of doprnt (dopr) included. + * Sigh. This sort of thing is always nasty do deal with. Note that + * the version here does not include floating point... + * + * plp_snprintf() is used instead of sprintf() as it does limit checks + * for string length. This covers a nasty loophole. + * + * The other functions are there to prevent NULL pointers from + * causing nast effects. + **************************************************************/ +int show_ctrl; + +int vplp_snprintf(str, count, fmt, args) + char *str; + size_t count; + const char *fmt; + va_list args; +{ + str[0] = 0; + end = str+count-1; + dopr( str, fmt, args ); + if( count>0 ){ + end[0] = 0; + } + return(strlen(str)); +} + +/* VARARGS3 */ +#ifdef HAVE_STDARGS +int plp_snprintf (char *str,size_t count,const char *fmt,...) +#else +int plp_snprintf (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + char *str; + size_t count; + char *fmt; +#endif + VA_LOCAL_DECL + + VA_START (fmt); + VA_SHIFT (str, char *); + VA_SHIFT (count, size_t ); + VA_SHIFT (fmt, char *); + (void) vplp_snprintf ( str, count, fmt, ap); + VA_END; + return( strlen( str ) ); +} + +/* + * dopr(): poor man's version of doprintf + */ + +static void fmtstr( char *value, int ljust, int len, int zpad ); +static void fmtnum( long value, int base, int dosign, + int ljust, int len, int zpad ); +static void dostr( char * ); +static char *output; +static void dopr_outch( int c ); + +static void dopr( buffer, format, args ) + char *buffer; + char *format; + va_list args; +{ + int ch; + long value; + int longflag = 0; + char *strvalue; + int ljust; + int len; + int zpad; + + output = buffer; + while( (ch = *format++) ){ + switch( ch ){ + case '%': + ljust = len = zpad = 0; + nextch: + ch = *format++; + switch( ch ){ + case 0: + dostr( "**end of format**" ); + return; + case '-': ljust = 1; goto nextch; + case '0': /* set zero padding if len not set */ + if(len==0) zpad = '0'; + case '1': case '2': case '3': + case '4': case '5': case '6': + case '7': case '8': case '9': + len = len*10 + ch - '0'; + goto nextch; + case 'l': longflag = 1; goto nextch; + case 'u': case 'U': + /*fmtnum(value,base,dosign,ljust,len,zpad) */ + if( longflag ){ + value = va_arg( args, long ); + } else { + value = va_arg( args, int ); + } + fmtnum( value, 10,0, ljust, len, zpad ); break; + case 'o': case 'O': + /*fmtnum(value,base,dosign,ljust,len,zpad) */ + if( longflag ){ + value = va_arg( args, long ); + } else { + value = va_arg( args, int ); + } + fmtnum( value, 8,0, ljust, len, zpad ); break; + case 'd': case 'D': + if( longflag ){ + value = va_arg( args, long ); + } else { + value = va_arg( args, int ); + } + fmtnum( value, 10,1, ljust, len, zpad ); break; + case 'x': + if( longflag ){ + value = va_arg( args, long ); + } else { + value = va_arg( args, int ); + } + fmtnum( value, 16,0, ljust, len, zpad ); break; + case 'X': + if( longflag ){ + value = va_arg( args, long ); + } else { + value = va_arg( args, int ); + } + fmtnum( value,-16,0, ljust, len, zpad ); break; + case 's': + strvalue = va_arg( args, char *); + fmtstr( strvalue,ljust,len,zpad ); break; + case 'c': + ch = va_arg( args, int ); + dopr_outch( ch ); break; + case '%': dopr_outch( ch ); continue; + default: + dostr( "???????" ); + } + longflag = 0; + break; + default: + dopr_outch( ch ); + break; + } + } + *output = 0; +} + +static void +fmtstr( value, ljust, len, zpad ) + char *value; + int ljust, len, zpad; +{ + int padlen, strlen; /* amount to pad */ + + if( value == 0 ){ + value = ""; + } + for( strlen = 0; value[strlen]; ++ strlen ); /* strlen */ + padlen = len - strlen; + if( padlen < 0 ) padlen = 0; + if( ljust ) padlen = -padlen; + while( padlen > 0 ) { + dopr_outch( ' ' ); + --padlen; + } + dostr( value ); + while( padlen < 0 ) { + dopr_outch( ' ' ); + ++padlen; + } +} + +static void +fmtnum( value, base, dosign, ljust, len, zpad ) + long value; + int base, dosign, ljust, len, zpad; +{ + int signvalue = 0; + unsigned long uvalue; + char convert[20]; + int place = 0; + int padlen = 0; /* amount to pad */ + int caps = 0; + + /* DEBUGP(("value 0x%x, base %d, dosign %d, ljust %d, len %d, zpad %d\n", + value, base, dosign, ljust, len, zpad )); */ + uvalue = value; + if( dosign ){ + if( value < 0 ) { + signvalue = '-'; + uvalue = -value; + } + } + if( base < 0 ){ + caps = 1; + base = -base; + } + do{ + convert[place++] = + (caps? "0123456789ABCDEF":"0123456789abcdef") + [uvalue % (unsigned)base ]; + uvalue = (uvalue / (unsigned)base ); + }while(uvalue); + convert[place] = 0; + padlen = len - place; + if( padlen < 0 ) padlen = 0; + if( ljust ) padlen = -padlen; + /* DEBUGP(( "str '%s', place %d, sign %c, padlen %d\n", + convert,place,signvalue,padlen)); */ + if( zpad && padlen > 0 ){ + if( signvalue ){ + dopr_outch( signvalue ); + --padlen; + signvalue = 0; + } + while( padlen > 0 ){ + dopr_outch( zpad ); + --padlen; + } + } + while( padlen > 0 ) { + dopr_outch( ' ' ); + --padlen; + } + if( signvalue ) dopr_outch( signvalue ); + while( place > 0 ) dopr_outch( convert[--place] ); + while( padlen < 0 ){ + dopr_outch( ' ' ); + ++padlen; + } +} + +static void dostr( str ) + char *str; +{ + while(*str) dopr_outch(*str++); +} + +static void dopr_outch( c ) + int c; +{ + if( show_ctrl ){ + c = c & 0xFF; + if( iscntrl(c) && c != '\n' && c != '\t' ){ + if( end == 0 || output < end ){ + *output++ = '^'; + } + c = (0x1F & c) | '@'; + } + } + if( end == 0 || output < end ){ + *output++ = c; + } +} diff --git a/src/stty.c b/src/stty.c new file mode 100644 index 0000000..4a67108 --- /dev/null +++ b/src/stty.c @@ -0,0 +1,1002 @@ +/************************************************************************** + * LPRng IFHP Filter + * Copyright 1994-1997 Patrick Powell, San Diego, CA + * + * Based on the CTI printer filters. + * See COPYRIGHT for details. + * + * $Id: stty.c,v 1.1 1997/05/30 18:53:55 papowell Exp $ + */ + +#include "portable.h" +#include "common.h" + +#if USE_STTY == TERMIO +# include +# include +#endif + +#if USE_STTY == SGTTYB +# include +#endif + +#if USE_STTY == TERMIOS +# include +#endif + +#if defined(HAVE_TTOLD_H) +# include +#endif + +int Set_flag_bits, Clear_flag_bits,Set_local_bits,Clear_local_bits; +int Baud_rate; + +extern int errorcode; + + +#if USE_STTY == SGTTYB + +# if !defined(B19200) +# ifdef EXTA +# define B19200 EXTA +# else +# define B19200 B9600 +# endif /* !defined(EXTA) */ +# endif /* !defined(B19200) */ + +#if !defined(B38400) +#ifdef EXTB +#define B38400 EXTB +#else +#define B38400 B9600 +#endif /* !defined(EXTB) */ +#endif /* !defined(B38400) */ + +static struct bauds { + char *string; + int baud; + int speed; +} bauds[] = { + + { "110", 110, B110, }, + { "134", 134, B134, }, + { "150", 150, B150, }, + { "300", 300, B300, }, + { "600", 600, B600, }, + { "1200", 1200, B1200, }, + { "1800", 1800, B1800, }, + { "2400", 2400, B2400, }, + { "4800", 4800, B4800, }, + { "9600", 9600, B9600, }, + { "19200", 19200, B19200, }, + { "38400", 38400, B38400, }, + { (char *) 0, 0, 0 } +}; + +/* + * Set terminal modes. + * + * jmason: I've added support for some combination modes, + * such as "pass8" and "parity". + */ + +struct tchars termctrl; +struct ltchars linectrl; +struct sgttyb mode; + +static struct { + char *string; + int set; + int reset; + int lset; + int lreset; + +} modes[] = { + { "bs0", BS0, BS1, 0, 0 }, + { "bs1", BS1, BS1, 0, 0 }, + { "cbreak", CBREAK, 0, 0, 0 }, + { "-cbreak", 0, CBREAK, 0, 0 }, + { "cooked", 0, RAW, 0, 0 }, + { "cr0", CR0, CR3, 0, 0 }, + { "cr1", CR1, CR3, 0, 0 }, + { "cr2", CR2, CR3, 0, 0 }, + { "cr3", CR3, CR3, 0, 0 }, + { "decctlq", 0, 0, LDECCTQ, 0 }, + { "-decctlq", 0, 0, 0, LDECCTQ, }, + { "echo", ECHO, 0, 0, 0 }, + { "-echo", 0, ECHO, 0, 0 }, + { "even", EVENP, 0, 0, 0 }, + { "-even", 0, EVENP, 0, 0 }, + { "ff0", FF0, FF1, 0, 0 }, + { "ff1", FF1, FF1, 0, 0 }, + { "lcase", LCASE, 0, 0, 0 }, + { "-lcase", 0, LCASE, 0, 0 }, + { "litout", 0, 0, LLITOUT, 0 }, + { "-litout", 0, 0, 0, LLITOUT, }, + { "nl", 0, CRMOD, 0, 0 }, + { "-nl", CRMOD, 0, 0, 0 }, + { "nl0", NL0, NL3, 0, 0 }, + { "nl1", NL1, NL3, 0, 0 }, + { "nl2", NL2, NL3, 0, 0 }, + { "nl3", NL3, NL3, 0, 0 }, + { "noflsh", 0, 0, LNOFLSH, 0 }, + { "-noflsh", 0, 0, 0, LNOFLSH, }, + { "nohang", 0, 0, LNOHANG, 0 }, + { "-nohang", 0, 0, 0, LNOHANG, }, + { "odd", ODDP, 0, 0, 0 }, + { "-odd", 0, ODDP, 0, 0 }, + { "raw", RAW, 0, 0, 0 }, + { "-raw", 0, RAW, 0, 0 }, + { "tab0", TAB0, XTABS, 0, 0 }, + { "tab1", TAB1, XTABS, 0, 0 }, + { "tab2", TAB2, XTABS, 0, 0 }, + { "tabs", 0, XTABS, 0, 0 }, + { "-tabs", XTABS, 0, 0, 0 }, + { "tandem", TANDEM, 0, 0, 0 }, + { "-tandem", 0, TANDEM, 0, 0 }, +#ifndef IS_NEXT + { "tilde", 0, 0, LTILDE, 0 }, + { "-tilde", 0, 0, 0, LTILDE, }, +#endif + { "tn300", CR1, ALLDELAY, 0, 0 }, + { "tty33", CR1, ALLDELAY, 0, 0 }, + { "tty37", FF1 + CR2 + TAB1 + NL1, ALLDELAY, 0, 0 }, + { "vt05", NL2, ALLDELAY, 0, 0 }, + + /* jmason modes and synonyms: */ + { "evenp", EVENP, 0, 0, 0 }, + { "-evenp", 0, EVENP, 0, 0 }, + { "parity", EVENP, 0, 0, 0 }, + { "-parity", 0, EVENP|ODDP, 0, 0 }, + { "oddp", ODDP, 0, 0, 0 }, + { "-oddp", 0, ODDP, 0, 0 }, +#ifdef LPASS8 + { "pass8", 0, 0, LPASS8, 0 }, + { "-pass8", 0, 0, 0, LPASS8, }, +#endif + {0} +}; + + +static struct special { + char *name; + char *cp; + char def; +} special[] = { + + { "stop", &termctrl.t_stopc, CSTOP }, + { "start", &termctrl.t_startc, CSTART }, + { 0 } +}; + +void Do_stty( int fd, char *Stty_command ) +{ + int i; + int localmode; + int linedisc; + char buf[512]; + char *bp, *ep, *arg; + + log(4,"Do_stty: using SGTTYB, fd %d", fd ); + if( ioctl( fd, TIOCGETP, &mode) < 0 + || ioctl( fd, TIOCGETC, &termctrl) < 0 + || ioctl( fd, TIOCLGET, &localmode) < 0 + || ioctl( fd, TIOCGLTC, &linectrl) < 0 ){ + logerr_die(0, "cannot get tty parameters"); + } + log(4,"stty: before mode 0x%x, lmode 0x%x, speed 0x%x", + mode.sg_flags, localmode, mode.sg_ispeed); + if( Baud_rate ){ + for( i = 0; bauds[i].baud && Baud_rate != bauds[i].baud; i++); + if( i == 0) { + errorcode = JABORT; + fatal( "illegal baud rate %d\n", Baud_rate ); + } + mode.sg_ispeed = mode.sg_ospeed = bauds[i].speed; + } +#if 0 + mode.sg_flags &= ~FC; + mode.sg_flags |= FS; + localmode &= ~XC; + localmode |= XS; +#endif + if( Set_flag_bits || Clear_flag_bits || Set_local_bits || + Clear_local_bits ){ + errorcode = JABORT; + fatal( "fc, fs, xc, xs printcap options are not supported. Use 'sy' stty(1) compatible forms"); + } + + buf[0] = 0; + if( Stty_command && *Stty_command ){ + strcpy( buf, Stty_command ); + ep = buf; + } else { + ep = 0; + } + while( ep && *ep) { + for( ; *ep && isspace( *ep); ++ep); + for( arg = ep; *ep && !isspace( *ep ); ++ep); + if( *ep ){ + *ep++ = 0; + } + + for( i = 0; modes[i].string && strcasecmp( modes[i].string, arg); i++); + if( modes[i].string ){ + log(4,"stty: modes %s, mc 0x%x ms 0x%x lc 0x%x ls 0x%x", + modes[i].string, modes[i].reset, modes[i].set, + modes[i].lreset, modes[i].lset); + mode.sg_flags &= ~modes[i].reset; + mode.sg_flags |= modes[i].set; + localmode &= ~modes[i].lreset; + localmode |= modes[i].lset; + continue; + } + for( i = 0; special[i].name && strcasecmp( special[i].name, arg); i++); + if( special[i].name) { + for( ; *ep && isspace( *ep); ++ep); + for( bp = ep; *ep && !isspace( *ep); ++ep); + if( *ep) { + *ep++ = 0; + } + if( *bp == 0) { + errorcode = JABORT; + fatal( "stty: missing parameter for %s\n", arg); + } + if( bp[0] == '^') { + if( bp[1] == '?') { + *special[i].cp = 0177; + } else { + *special[i].cp = 037 & bp[1]; + } + } else { + *special[i].cp = bp[0]; + } + log(4,"stty: special %s %s", arg, bp); + continue; + } + for( i = 0; bauds[i].string && strcasecmp( bauds[i].string, arg); i++); + if( bauds[i].string) { + log(4,"stty: speed %s", arg); + mode.sg_ispeed = mode.sg_ospeed = bauds[i].speed; + continue; + } + if( !strcasecmp( "new", arg)) { + log(4,"stty: ldisc %s", arg); + linedisc = NTTYDISC; + if( ioctl( fd, TIOCSETD, &linedisc) < 0) + logerr_die(0, "stty: TIOCSETD ioctl failed"); + continue; + } + if( !strcasecmp( "old", arg)) { + log(4,"stty: ldisc %s", arg); + linedisc = 0; + if( ioctl( fd, TIOCSETD, &linedisc) < 0) + logerr_die(0, "stty: TIOCSETD ioctl failed"); + continue; + } + log(2,"stty: unknown mode: %s", arg); + } + log(4,"stty: after mode 0x%x, lmode 0x%x, speed 0x%x", + mode.sg_flags, localmode, mode.sg_ispeed); + if( ioctl( fd, TIOCSETN, &mode) < 0 + || ioctl( fd, TIOCSETC, &termctrl) < 0 + || ioctl( fd, TIOCSLTC, &linectrl) < 0 + || ioctl( fd, TIOCLSET, &localmode) < 0) { + logerr_die(0, "cannot set tty parameters"); + } +} +#endif + +#if USE_STTY == TERMIO + +/* the folks who are responsible for include files + * must be the lowest paid/motivated ones in + * OS development... (mj) + */ + +#if !defined(TOSTOP) && defined(_TOSTOP) +#define TOSTOP _TOSTOP +#endif + +static struct bauds { + char *string; + int baud; + int speed; +} bauds[] = { + + { "110", 110, B110, }, + { "134", 134, B134, }, + { "150", 150, B150, }, + { "300", 300, B300, }, + { "600", 600, B600, }, + { "1200", 1200, B1200, }, + { "1800", 1800, B1800, }, + { "2400", 2400, B2400, }, + { "4800", 4800, B4800, }, + { "9600", 9600, B9600, }, + { "19200", 19200, B19200, }, + { "38400", 38400, B38400, }, + { (char *) 0, 0, 0 } +}; + +struct termio tio; +static struct { + char *string; + int iset; + int ireset; + int oset; + int oreset; + int cset; + int creset; + int lset; + int lreset; +} tmodes[] = { + + /* input modes */ + { "ignbrk", IGNBRK, 0, 0, 0, 0, 0, 0, 0 }, + { "-ignbrk", 0, IGNBRK, 0, 0, 0, 0, 0, 0 }, + { "brkint", BRKINT, 0, 0, 0, 0, 0, 0, 0 }, + { "-brkint", 0, BRKINT, 0, 0, 0, 0, 0, 0 }, + { "ignpar", IGNPAR, 0, 0, 0, 0, 0, 0, 0 }, + { "-ignpar", 0, IGNPAR, 0, 0, 0, 0, 0, 0 }, + { "parmrk", PARMRK, 0, 0, 0, 0, 0, 0, 0 }, + { "-parmrk", 0, PARMRK, 0, 0, 0, 0, 0, 0 }, + { "inpck", INPCK, 0, 0, 0, 0, 0, 0, 0 }, + { "-inpck", 0, INPCK, 0, 0, 0, 0, 0, 0 }, + { "istrip", ISTRIP, 0, 0, 0, 0, 0, 0, 0 }, + { "-istrip", 0, ISTRIP, 0, 0, 0, 0, 0, 0 }, + { "inlcr", INLCR, 0, 0, 0, 0, 0, 0, 0 }, + { "-inlcr", 0, INLCR, 0, 0, 0, 0, 0, 0 }, + { "igncr", IGNCR, 0, 0, 0, 0, 0, 0, 0 }, + { "-igncr", 0, IGNCR, 0, 0, 0, 0, 0, 0 }, + { "icrnl", ICRNL, 0, 0, 0, 0, 0, 0, 0 }, + { "-icrnl", 0, ICRNL, 0, 0, 0, 0, 0, 0 }, + { "lcase", IUCLC, 0, 0, 0, 0, 0, 0, 0 }, + { "iuclc", IUCLC, 0, 0, 0, 0, 0, 0, 0 }, + { "-lcase", 0, IUCLC, 0, 0, 0, 0, 0, 0 }, + { "-iuclc", 0, IUCLC, 0, 0, 0, 0, 0, 0 }, + { "ixon", IXON, 0, 0, 0, 0, 0, 0, 0 }, + { "-ixon", 0, IXON, 0, 0, 0, 0, 0, 0 }, + { "ixany", IXANY, 0, 0, 0, 0, 0, 0, 0 }, + { "-ixany", 0, IXANY, 0, 0, 0, 0, 0, 0 }, + { "ixoff", IXOFF, 0, 0, 0, 0, 0, 0, 0 }, + { "-ixoff", 0, IXOFF, 0, 0, 0, 0, 0, 0 }, + { "decctlq", IXANY, 0, 0, 0, 0, 0, 0, 0 }, + { "-decctlq", 0, IXANY, 0, 0, 0, 0, 0, 0 }, + { "tandem", IXOFF, 0, 0, 0, 0, 0, 0, 0 }, + { "-tandem", 0, IXOFF, 0, 0, 0, 0, 0, 0 }, +#ifdef IMAXBEL + { "imaxbel", IMAXBEL, 0, 0, 0, 0, 0, 0, 0 }, + { "-maxbel", 0, IMAXBEL, 0, 0, 0, 0, 0, 0 }, +#endif + /* output modes */ + { "opost", 0, 0, OPOST, 0, 0, 0, 0, 0 }, + { "-opost", 0, 0, 0, OPOST, 0, 0, 0, 0 }, + { "olcuc", 0, 0, OLCUC, 0, 0, 0, 0, 0 }, + { "-olcuc", 0, 0, 0, OLCUC, 0, 0, 0, 0 }, + { "onlcr", 0, 0, ONLCR, 0, 0, 0, 0, 0 }, + { "-onlcr", 0, 0, 0, ONLCR, 0, 0, 0, 0 }, + { "ocrnl", 0, 0, OCRNL, 0, 0, 0, 0, 0 }, + { "-ocrnl", 0, 0, 0, OCRNL, 0, 0, 0, 0 }, + { "onocr", 0, 0, ONOCR, 0, 0, 0, 0, 0 }, + { "-onocr", 0, 0, 0, ONOCR, 0, 0, 0, 0 }, + { "onlret", 0, 0, ONLRET, 0, 0, 0, 0, 0 }, + { "-onlret", 0, 0, 0, ONLRET, 0, 0, 0, 0 }, + { "ofill", 0, 0, OFILL, 0, 0, 0, 0, 0 }, + { "-ofill", 0, 0, 0, OFILL, 0, 0, 0, 0 }, + { "ofdel", 0, 0, OFDEL, 0, 0, 0, 0, 0 }, + { "-ofdel", 0, 0, 0, OFDEL, 0, 0, 0, 0 }, + { "nl0", 0, 0, NL0, NLDLY, 0, 0, 0, 0 }, + { "nl1", 0, 0, NL1, NLDLY, 0, 0, 0, 0 }, + { "cr0", 0, 0, CR1, CRDLY, 0, 0, 0, 0 }, + { "cr1", 0, 0, CR1, CRDLY, 0, 0, 0, 0 }, + { "cr2", 0, 0, CR2, CRDLY, 0, 0, 0, 0 }, + { "cr3", 0, 0, CR3, CRDLY, 0, 0, 0, 0 }, + { "tab0", 0, 0, TAB0, TABDLY, 0, 0, 0, 0 }, + { "tab1", 0, 0, TAB1, TABDLY, 0, 0, 0, 0 }, + { "tab2", 0, 0, TAB2, TABDLY, 0, 0, 0, 0 }, + { "tab3", 0, 0, TAB3, TABDLY, 0, 0, 0, 0 }, + { "bs0", 0, 0, BS0, BSDLY, 0, 0, 0, 0 }, + { "bs1", 0, 0, BS1, BSDLY, 0, 0, 0, 0 }, + { "vt0", 0, 0, VT0, VTDLY, 0, 0, 0, 0 }, + { "vt1", 0, 0, VT1, VTDLY, 0, 0, 0, 0 }, + { "ff0", 0, 0, FF0, FFDLY, 0, 0, 0, 0 }, + { "ff1", 0, 0, FF1, FFDLY, 0, 0, 0, 0 }, + { "nopost", 0, 0, 0, OPOST, 0, 0, 0, 0 }, + { "-nopost", 0, 0, OPOST, 0, 0, 0, 0, 0 }, + { "fill", 0, 0, OFILL, OFDEL, 0, 0, 0, 0 }, + { "-fill", 0, 0, 0, OFILL | OFDEL, 0, 0, 0, 0 }, + { "nul-fill", 0, 0, OFILL, OFDEL, 0, 0, 0, 0 }, + { "del-fill", 0, 0, OFILL | OFDEL, 0, 0, 0, 0, 0 }, +#ifdef XTABS + { "tabs", 0, 0, 0, XTABS | TABDLY, 0, 0, 0, 0 }, + { "-tabs", 0, 0, XTABS, TABDLY, 0, 0, 0, 0 }, +#endif + /* control modes */ + { "cs5", 0, 0, 0, 0, CS5, CSIZE, 0, 0 }, + { "cs6", 0, 0, 0, 0, CS6, CSIZE, 0, 0 }, + { "cs7", 0, 0, 0, 0, CS7, CSIZE, 0, 0 }, + { "cs8", 0, 0, 0, 0, CS8, CSIZE, 0, 0 }, + { "cstopb", 0, 0, 0, 0, CSTOPB, 0, 0, 0 }, + { "-cstopb", 0, 0, 0, 0, 0, CSTOPB, 0, 0 }, + { "cread", 0, 0, 0, 0, CREAD, 0, 0, 0 }, + { "-cread", 0, 0, 0, 0, 0, CREAD, 0, 0 }, + { "parenb", 0, 0, 0, 0, PARENB, 0, 0, 0 }, + { "-parenb", 0, 0, 0, 0, 0, PARENB, 0, 0 }, + { "parodd", 0, 0, 0, 0, PARODD, 0, 0, 0 }, + { "-parodd", 0, 0, 0, 0, 0, PARODD, 0, 0 }, + { "hupcl", 0, 0, 0, 0, HUPCL, 0, 0, 0 }, + { "-hupcl", 0, 0, 0, 0, 0, HUPCL, 0, 0 }, + { "clocal", 0, 0, 0, 0, CLOCAL, 0, 0, 0 }, + { "-clocal", 0, 0, 0, 0, 0, CLOCAL, 0, 0 }, +#ifdef LOBLK + { "loblk", 0, 0, 0, 0, LOBLK, 0, 0, 0 }, + { "-loblk", 0, 0, 0, 0, 0, LOBLK, 0, 0 }, +#endif + { "parity", 0, 0, 0, 0, PARENB | CS7, PARODD | CSIZE, 0, 0 }, + { "-parity", 0, 0, 0, 0, CS8, PARENB | CSIZE, 0, 0 }, + { "evenp", 0, 0, 0, 0, PARENB | CS7, PARODD | CSIZE, 0, 0 }, + { "-evenp", 0, 0, 0, 0, CS8, PARENB | CSIZE, 0, 0 }, + { "oddp", 0, 0, 0, 0, PARENB | PARODD | CS7, CSIZE, 0, 0 }, + { "-oddp", 0, 0, 0, 0, CS8, PARENB | PARODD | CSIZE, 0, 0 }, + { "stopb", 0, 0, 0, 0, CSTOPB, 0, 0, 0 }, + { "-stopb", 0, 0, 0, 0, 0, CSTOPB, 0, 0 }, + { "hup", 0, 0, 0, 0, HUPCL, 0, 0, 0 }, + { "-hup", 0, 0, 0, 0, 0, HUPCL, 0, 0 }, +#ifdef CRTSCTS + { "crtscts", 0, 0, 0, 0, CRTSCTS, 0, 0, 0 }, + { "-crtscts", 0, 0, 0, 0, 0, CRTSCTS, 0, 0 }, +#endif + /* local modes */ + { "isig", 0, 0, 0, 0, 0, 0, ISIG, 0 }, + { "-isig", 0, 0, 0, 0, 0, 0, 0, ISIG }, + { "noisig", 0, 0, 0, 0, 0, 0, 0, ISIG }, + { "-noisig", 0, 0, 0, 0, 0, 0, ISIG, 0 }, + { "icanon", 0, 0, 0, 0, 0, 0, ICANON, 0 }, + { "-icanon", 0, 0, 0, 0, 0, 0, 0, ICANON }, + { "cbreak", 0, 0, 0, 0, 0, 0, ICANON, 0 }, + { "-cbreak", 0, 0, 0, 0, 0, 0, 0, ICANON }, + { "xcase", 0, 0, 0, 0, 0, 0, XCASE, 0 }, + { "-xcase", 0, 0, 0, 0, 0, 0, 0, XCASE }, + { "echo", 0, 0, 0, 0, 0, 0, ECHO, 0 }, + { "-echo", 0, 0, 0, 0, 0, 0, 0, ECHO }, + { "echoe", 0, 0, 0, 0, 0, 0, ECHOE, 0 }, + { "-echoe", 0, 0, 0, 0, 0, 0, 0, ECHOE }, + { "crterase", 0, 0, 0, 0, 0, 0, ECHOE, 0 }, + { "-crterase", 0, 0, 0, 0, 0, 0, 0, ECHOE }, + { "echok", 0, 0, 0, 0, 0, 0, ECHOK, 0 }, + { "-echok", 0, 0, 0, 0, 0, 0, 0, ECHOK }, + { "lfkc", 0, 0, 0, 0, 0, 0, ECHOK, 0 }, + { "-lfkc", 0, 0, 0, 0, 0, 0, 0, ECHOK }, + { "echonl", 0, 0, 0, 0, 0, 0, ECHONL, 0 }, + { "-echonl", 0, 0, 0, 0, 0, 0, 0, ECHONL }, + { "noflsh", 0, 0, 0, 0, 0, 0, NOFLSH, 0 }, + { "-noflsh", 0, 0, 0, 0, 0, 0, 0, NOFLSH }, + { "tostop", 0, 0, 0, 0, 0, 0, TOSTOP, 0 }, + { "-tostop", 0, 0, 0, 0, 0, 0, 0, TOSTOP }, +#ifdef ECHOCTL + { "echoctl", 0, 0, 0, 0, 0, 0, ECHOCTL, 0 }, + { "-echoctl", 0, 0, 0, 0, 0, 0, 0, ECHOCTL }, + { "ctlecho", 0, 0, 0, 0, 0, 0, ECHOCTL, 0 }, + { "-ctlecho", 0, 0, 0, 0, 0, 0, 0, ECHOCTL }, +#endif +#ifdef ECHOPRT + { "echoprt", 0, 0, 0, 0, 0, 0, ECHOPRT, 0 }, + { "-echoprt", 0, 0, 0, 0, 0, 0, 0, ECHOPRT }, + { "prterase", 0, 0, 0, 0, 0, 0, ECHOPRT, 0 }, + { "-prterase", 0, 0, 0, 0, 0, 0, 0, ECHOPRT }, +#endif +#ifdef ECHOKE + { "echoke", 0, 0, 0, 0, 0, 0, ECHOKE, 0 }, + { "-echoke", 0, 0, 0, 0, 0, 0, 0, ECHOKE }, + { "crtkill", 0, 0, 0, 0, 0, 0, ECHOKE, 0 }, + { "-crtkill", 0, 0, 0, 0, 0, 0, 0, ECHOKE }, +#endif + /* convenience modes */ + { "lcase", IUCLC, 0, OLCUC, 0, 0, 0, XCASE, 0 }, + { "-lcase", 0, IUCLC, 0, OLCUC, 0, 0, 0, XCASE }, + { "nl", 0, ICRNL, 0, ONLCR, 0, 0, 0, 0 }, + { "-nl", ICRNL, INLCR | IGNCR, ONLCR, OCRNL | ONLRET, 0, 0, 0, 0 }, + { "litout", 0, 0, OPOST, 0, CS8, CSIZE | PARENB, 0, 0 }, + { "-litout", 0, 0, 0, OPOST, CS7 | PARENB, CSIZE, 0, 0 }, + { "pass8", 0, ISTRIP, 0, 0, CS8, CSIZE | PARENB, 0, 0 }, + { "-pass8", ISTRIP, 0, 0, 0, CS7 | PARENB, CSIZE, 0, 0 }, + { "raw", 0, -1, 0, OPOST, CS8, CSIZE | PARENB, 0, ISIG | ICANON | XCASE, + }, +#ifdef IMAXBEL + { "-raw", BRKINT | IGNPAR | ISTRIP | ICRNL | IXON | IMAXBEL, + 0, OPOST, 0, CS7 | PARENB, CSIZE, ISIG | ICANON, 0 }, + { "sane", BRKINT | IGNPAR | ISTRIP | ICRNL | IXON | IMAXBEL, + IGNBRK | PARMRK | INPCK | INLCR | IGNCR | IUCLC | IXOFF, + OPOST | ONLCR, + OLCUC | OCRNL | ONOCR | ONLRET | OFILL | OFDEL | NLDLY | CRDLY| + TABDLY | BSDLY | VTDLY | FFDLY, + CS7 | PARENB | CREAD, CSIZE | PARODD | CLOCAL, + ISIG | ICANON | ECHO | ECHOK, XCASE | ECHOE | ECHONL | NOFLSH}, +#endif /* IMAXBEL */ + { "cooked", BRKINT | IGNPAR | ISTRIP | ICRNL | IXON, 0, OPOST, 0, + CS7 | PARENB, CSIZE, ISIG | ICANON, 0 }, + {0}, +}; + +void Do_stty( int fd, char *Stty_command ) +{ + int i; + char buf[512], *ep, *arg; + + log(4,"Do_stty: using TERMIO, fd %d", fd ); + if( ioctl( fd, TCGETA, &tio) < 0) { + logerr_die(0, "cannot get tty parameters"); + } + log(4,"stty: before imode 0x%x, omode 0x%x, cmode 0x%x, lmode 0x%x", + tio.c_iflag, tio.c_oflag, tio.c_cflag, tio.c_lflag); + + if( Baud_rate ){ + for( i = 0; bauds[i].baud && Baud_rate != bauds[i].baud; i++); + if( i == 0) { + errorcode = JABORT; + fatal( "illegal baud rate %d\n", Baud_rate); + } + tio.c_cflag &= ~CBAUD; + tio.c_cflag |= bauds[i].speed; + } + /* don't support FC, FS, XC, XS */ + + buf[0] = 0; + ep = 0; + if( Stty_command && *Stty_command ){ + strcpy( buf, Stty_command ); + ep = buf; + } + while( ep && *ep) { + for( ; *ep && (isspace( *ep) || *ep == ','); ++ep); + for( arg = ep; *ep && !isspace( *ep) && *ep != ','; ++ep); + if( *ep) { + *ep++ = 0; + } + for( i = 0; tmodes[i].string && strcasecmp( tmodes[i].string, arg); i++); + + if( tmodes[i].string) { + log(4,"stty: modes %s, ic 0x%x is 0x%x oc 0x%x os 0x%x cc 0x%x cs 0x%x lc 0x%x ls 0x%x", + tmodes[i].string, tmodes[i].ireset, tmodes[i].iset, + tmodes[i].oreset, tmodes[i].oset, tmodes[i].creset, tmodes[i].cset, + tmodes[i].lreset, tmodes[i].lset); + + tio.c_iflag &= ~tmodes[i].ireset; + tio.c_iflag |= tmodes[i].iset; + tio.c_oflag &= ~tmodes[i].oreset; + tio.c_oflag |= tmodes[i].oset; + tio.c_cflag &= ~tmodes[i].creset; + tio.c_cflag |= tmodes[i].cset; + tio.c_lflag &= ~tmodes[i].lreset; + tio.c_lflag |= tmodes[i].lset; + continue; + } + for( i = 0; bauds[i].string && strcasecmp( bauds[i].string, arg); i++); + if( bauds[i].string) { + log(4,"stty: speed %s", arg); + tio.c_cflag &= ~CBAUD; + tio.c_cflag |= bauds[i].speed; + continue; + } + log(2,"unknown mode: %s", arg); + } + +#if 0 + if( Read_write && (tio.c_cflag & ICANON) == 0) { + /* VMIN & VTIME: suggested by Michael Joosten + * only do this if ICANON is off -- Martin Forssen + */ + log(4,"setting port to read/write with unbuffered reads"); + tio.c_cc[VMIN] = 1; + tio.c_cc[VTIME] = 0; + } +#endif + log(4,"stty: before imode 0x%x, omode 0x%x, cmode 0x%x, lmode 0x%x", + tio.c_iflag, tio.c_oflag, tio.c_cflag, tio.c_lflag); + if( ioctl( fd, TCSETA, &tio) < 0) { + logerr_die(0, "cannot set tty parameters"); + } +} +#endif + +#if USE_STTY == TERMIOS + +#ifndef HAVE_TCSETATTR +#define tcgetattr(fd,tdat) (ioctl( (fd), TCGETS, (tdat))) +#define tcsetattr(fd,flags,tdat) (ioctl( (fd), TCSETS, (tdat))) + /* ignore the flags arg. */ +#endif + +static struct bauds { + char *string; + int baud; + int speed; +} bauds[] = { + + { "B0", 0, B0, }, { "0", 0, B0, }, + { "B50", 50, B50, }, { "50", 50, B50, }, + { "B75", 75, B75, }, { "75", 75, B75, }, + { "B110", 110, B110, }, { "110", 110, B110, }, + { "B134", 134, B134, }, { "134", 134, B134, }, + { "B150", 150, B150, }, { "150", 150, B150, }, + { "B300", 300, B300, }, { "300", 300, B300, }, + { "B600", 600, B600, }, { "600", 600, B600, }, + { "B1200", 1200, B1200, }, { "1200", 1200, B1200, }, + { "B1800", 1800, B1800, }, { "1800", 1800, B1800, }, + { "B2400", 2400, B2400, }, { "2400", 2400, B2400, }, + { "B4800", 4800, B4800, }, { "4800", 4800, B4800, }, + { "B9600", 9600, B9600, }, { "9600", 9600, B9600, }, + { "B19200", 19200, B19200, }, { "19200", 19200, B19200, }, + { "B38400", 38400, B38400, }, { "38400", 38400, B38400, }, + {"EXTA", EXTA, EXTA}, + {"EXTB", EXTB, EXTB}, + { (char *) 0, 0, 0 } +}; + +struct s_term_dat { + char *name; + uint or_dat; + uint and_dat; +}; + +#define FLAGS(X) { #X, X , 0 }, { "-" #X, 0, X } + +/* c_iflag bits */ +static struct s_term_dat c_i_dat[] = +{ + FLAGS(IGNBRK), + FLAGS(BRKINT), + FLAGS(IGNPAR), + FLAGS(PARMRK), + FLAGS(INPCK), + FLAGS(ISTRIP), + FLAGS(INLCR), + FLAGS(IGNCR), + FLAGS(ICRNL), +#ifdef IUCLC + FLAGS(IUCLC), + {"lcase", IUCLC, 0}, {"-lcase", 0, IUCLC}, +#endif + FLAGS(IXON), + FLAGS(IXANY), + FLAGS(IXOFF), + +#ifdef IMAXBEL + FLAGS(IMAXBEL), +#else + /* work out what they do and simulate with IFLAGONE|IFLAGTWO */ +#endif + + /* jmason addition: */ + {"PASS8", 0, ISTRIP}, {"-PASS8", ISTRIP, 0}, + {0, 0, 0} +}; + +/* c_oflag bits */ +static struct s_term_dat c_o_dat[] = +{ + FLAGS(OPOST), +#ifdef OLCUC + FLAGS(OLCUC), +#endif +#ifdef ONLCR + FLAGS(ONLCR), + {"crmod", ONLCR, 0}, {"-crmod", 0, ONLCR}, +#endif +#ifdef OCRNL + FLAGS(OCRNL), +#endif +#ifdef ONOCR + FLAGS(ONOCR), +#endif +#ifdef ONLRET + FLAGS(ONLRET), +#endif +#ifdef OFILL + FLAGS(OFILL), +#endif +#ifdef OFDEL + FLAGS(OFDEL), +#endif +#ifdef NLDLY + {"NL0", 0, NLDLY}, + {"NL1", NL1, NLDLY}, +#endif +#ifdef CRDLY + {"CR0", CR0, CRDLY}, + {"CR1", CR1, CRDLY}, + {"CR2", CR2, CRDLY}, + {"CR3", CR3, CRDLY}, +#endif +#ifdef TABDLY + {"TAB0", TAB0, TABDLY}, + {"TAB1", TAB1, TABDLY}, + {"TAB2", TAB2, TABDLY}, + {"TAB3", TAB3, TABDLY}, +#endif +#ifdef BSDLY + {"BS0", BS0, BSDLY}, + {"BS1", BS1, BSDLY}, +#endif +#ifdef VTDLY + {"VT0", VT0, VTDLY}, + {"VT1", VT1, VTDLY}, +#endif +#ifdef FFDLY + {"FF0", FF0, FFDLY}, + {"FF1", FF1, FFDLY}, +#endif + + /* jmason addition: */ +#ifdef TABDLY + {"TABS", TAB3, TABDLY}, +#endif + {0, 0, 0} +}; + +/* c_cflag bit meaning */ +static struct s_term_dat c_c_dat[] = +{ + {"CS5", CS5, CSIZE}, + {"CS6", CS6, CSIZE}, + {"CS7", CS7, CSIZE}, + {"CS8", CS8, CSIZE}, + {"CSTOPB", CSTOPB, 0}, + {"-CSTOPB", 0, CSTOPB}, + {"CREAD", CREAD, 0}, + {"-CREAD", 0, CREAD}, + {"PARENB", PARENB, 0}, + {"-PARENB", 0, PARENB}, + {"PARODD", PARODD, 0}, + {"-PARODD", 0, PARODD}, + {"HUPCL", HUPCL, 0}, + {"-HUPCL", 0, HUPCL}, + {"CLOCAL", CLOCAL, 0}, + {"-CLOCAL", 0, CLOCAL}, + +#ifdef CRTSCTS + /* work out what they do and simulate with IFLAGONE|IFLAGTWO */ + {"CRTSCTS", CRTSCTS, 0}, + {"-CRTSCTS", 0, CRTSCTS}, +#endif + + /* jmason additions, from SunOS stty(1v) combination modes: */ + /* fixed, papowell Sun Aug 20 06:54:56 PDT 1995 */ + {"even", PARENB | CS7, PARODD | CSIZE}, + {"-even", CS8, PARENB | CSIZE}, + {"EVENP", PARENB | CS7, PARODD | CSIZE}, + {"-EVENP", CS8, PARENB | CSIZE}, + {"PARITY", PARENB | CS7, PARODD | CSIZE}, + {"-PARITY", CS8, PARENB | CSIZE}, + {"odd", PARODD| PARENB | CS7, CSIZE}, + {"-odd", CS8, PARENB | PARODD | CSIZE}, + {"ODDP", PARODD | PARENB | CS7, CSIZE}, + {"-ODDP", CS8, PARENB | PARODD | CSIZE}, + {"PASS8", CS8, PARENB | CSIZE}, + {"-PASS8", PARENB | CS7, CSIZE}, + {"LITOUT", CS8, ISTRIP | PARENB | OPOST | CSIZE}, + {0, 0, 0} +}; + +/* c_lflag bits */ +static struct s_term_dat c_l_dat[] = +{ + {"ISIG", ISIG, 0}, + {"-ISIG", 0, ISIG}, + {"cooked", ICANON, 0}, + {"-raw", ICANON, 0}, + {"cbreak", ICANON, 0}, + {"ICANON", ICANON, 0}, + {"-ICANON", 0, ICANON}, + {"raw", 0, ICANON}, + {"-cooked", 0, ICANON}, +#ifdef XCASE + {"XCASE", XCASE, 0}, + {"-XCASE", 0, XCASE}, +#endif + {"ECHO", ECHO, 0}, + {"-ECHO", 0, ECHO}, + {"ECHOE", ECHOE, 0}, + {"-ECHOE", 0, ECHOE}, + {"ECHOK", ECHOK, 0}, + {"-ECHOK", 0, ECHOK}, + {"ECHONL", ECHONL, 0}, + {"-ECHONL", 0, ECHONL}, + {"NOFLSH", NOFLSH, 0}, + {"-NOFLSH", 0, NOFLSH}, + {"TOSTOP", TOSTOP, 0}, + {"-TOSTOP", 0, TOSTOP}, + {"IEXTEN", IEXTEN, 0}, + {"-IEXTEN", 0, IEXTEN}, + +#ifdef ECHOCTL + {"ECHOCTL", ECHOCTL, 0}, + {"-ECHOCTL", 0, ECHOCTL}, + {"CTLECHO", ECHOCTL, 0}, + {"-CTLECHO", 0, ECHOCTL}, +#else + /* work out what they do and simulate with IFLAGONE|IFLAGTWO */ +#endif +#ifdef ECHOPRT + {"ECHOPRT", ECHOPRT, 0}, + {"-ECHOPRT", 0, ECHOPRT}, + {"PRTERASE", ECHOPRT, 0}, + {"-PRTERASE", 0, ECHOPRT}, + /* ditto etc. -- you get the story */ +#endif +#ifdef ECHOKE + {"ECHOKE", ECHOKE, 0}, + {"-ECHOKE", 0, ECHOKE}, + {"CRTKILL", ECHOKE, 0}, + {"-CRTKILL", 0, ECHOKE}, +#endif +#ifdef FLUSHO + {"FLUSHO", FLUSHO, 0}, + {"-FLUSHO", 0, FLUSHO}, +#endif +#ifdef PENDIN + {"PENDIN", PENDIN, 0}, + {"-PENDIN", 0, PENDIN}, +#endif + { 0 ,0 ,0 } +}; + +struct termios t_dat; + +static struct special { + char *name; + char *cp; +} special[] = { + + { "stop", &(t_dat.c_cc[VSTOP]) }, + { "start", &(t_dat.c_cc[VSTART]) }, + { 0 } +}; + +void Do_stty( int fd, char *Stty_command ) +{ + int i; + char buf[512]; + char *bp, *ep, *arg; + + log(4,"Do_stty: using TERMIOS, fd %d", fd ); + if( tcgetattr( fd, &t_dat) < 0 ){ + logerr_die(0,"cannot get tty parameters"); + } + log(4,"stty: before iflag 0x%x, oflag 0x%x, cflag 0x%x lflag 0x%x", + t_dat.c_iflag, t_dat.c_oflag, t_dat.c_cflag, t_dat.c_lflag); + if( Baud_rate ){ + for( i = 0; bauds[i].baud && Baud_rate != bauds[i].baud; i++); + if( i == 0 ){ + errorcode = JABORT; + fatal( "illegal baud rate %d\n", Baud_rate ); + } + log(4,"stty: before baudrate : cflag 0x%x",t_dat.c_cflag); + +#ifdef HAVE_CFSETISPEED + log(4,"Do_stty: using cfsetispeed/cfsetospeed"); + /* POSIX baudrate manipulation */ + cfsetispeed( &t_dat, bauds[i].speed); + cfsetospeed( &t_dat, bauds[i].speed); +#else + log(4,"Do_stty: setting tdat.c_cflag"); + t_dat.c_cflag &= ~CBAUD; + t_dat.c_cflag |= bauds[i].speed; +#endif + + log(4,"stty: after baudrate : cflag 0x%x",t_dat.c_cflag); + } +#if 0 + /* OBSOLETE */ + t_dat.c_cflag &= ~FC; + t_dat.c_cflag |= FS; + t_dat.c_lflag &= ~XC; + t_dat.c_lflag |= XS; +#endif + if( Set_flag_bits || Clear_flag_bits || Set_local_bits || + Clear_local_bits ){ + errorcode = JABORT; + fatal( "fc, fs, xc, xs printcap options are not supported. Use 'sy' stty(1) compatible forms"); + } + + if( Stty_command && *Stty_command ){ + (void) strcpy( buf, Stty_command ); + ep = buf; + } else { + ep = 0; + } + while( ep && *ep ){ + for( ; *ep && isspace( *ep); ++ep); + for( arg = ep; *ep && !isspace( *ep); ++ep ); + if( *ep ){ + *ep++ = 0; + } + for( i = 0; bauds[i].string && strcasecmp( bauds[i].string, arg); i++); + + if( bauds[i].string ){ +#ifdef HAVE_CFSETISPEED + log(4,"Do_stty: using cfsetispeed/cfsetospeed, speed %s, spd %d", + arg, bauds[i].speed ); + /* POSIX baudrate manipulation */ + cfsetispeed( &t_dat, bauds[i].speed); + cfsetospeed( &t_dat, bauds[i].speed); +#else + log(4,"Do_stty: setting tdat.c_cflag"); + t_dat.c_cflag &= ~CBAUD; + t_dat.c_cflag |= bauds[i].speed; +#endif + continue; + } + for( i = 0; c_i_dat[i].name && strcasecmp( c_i_dat[i].name, arg); i++); + if( c_i_dat[i].name ){ + log(4,"stty: c_iflag %s, ms 0x%x mc 0x%x", + c_i_dat[i].name, c_i_dat[i].or_dat, c_i_dat[i].and_dat); + t_dat.c_iflag &= ~(c_i_dat[i].and_dat); + t_dat.c_iflag |= c_i_dat[i].or_dat; + continue; + } + for( i = 0; c_o_dat[i].name && strcasecmp( c_o_dat[i].name, arg); i++); + if( c_o_dat[i].name ){ + log(4,"stty: c_oflag %s, ms 0x%x mc 0x%x", + c_o_dat[i].name, c_o_dat[i].or_dat, c_o_dat[i].and_dat); + t_dat.c_oflag &= ~(c_o_dat[i].and_dat); + t_dat.c_oflag |= c_o_dat[i].or_dat; + continue; + } + for( i = 0; c_c_dat[i].name && strcasecmp( c_c_dat[i].name, arg); i++); + if( c_c_dat[i].name ){ + log(4,"stty: c_cflag %s, ms 0x%x mc 0x%x", + c_c_dat[i].name, c_c_dat[i].or_dat, c_c_dat[i].and_dat); + t_dat.c_cflag &= ~(c_c_dat[i].and_dat); + t_dat.c_cflag |= c_c_dat[i].or_dat; + continue; + } + for( i = 0; c_l_dat[i].name && strcasecmp( c_l_dat[i].name, arg); i++); + if( c_l_dat[i].name ){ + log(4,"stty: c_lflag %s, ms 0x%x mc 0x%x", + c_l_dat[i].name, c_l_dat[i].or_dat, c_l_dat[i].and_dat); + t_dat.c_lflag &= ~(c_l_dat[i].and_dat); + t_dat.c_lflag |= c_l_dat[i].or_dat; + continue; + } + for( i = 0; special[i].name && strcasecmp( special[i].name, arg); i++); + if( special[i].name ){ + for( ; *ep && isspace( *ep); ++ep); + for( bp = ep; *ep && !isspace( *ep); ++ep); + if( *ep ){ + *ep++ = 0; + } + if( *bp == 0 ){ + errorcode = JABORT; + fatal( "stty: missing parameter for %s\n", arg); + } + if( bp[0] == '^' ){ + if( bp[1] == '?' ){ + *special[i].cp = 0177; + } else { + *special[i].cp = 037 & bp[1]; + } + } else { + *special[i].cp = bp[0]; + } + log(4,"stty: special %s %s", arg, bp); + continue; + } + log(2,"unknown mode: %s", arg); + } + + if( (t_dat.c_lflag & ICANON) == 0 ){ + /* only do this if ICANON is off -- Martin Forssen */ + log(4,"setting port to read/write with unbuffered reads( MIN=1, TIME=0)"); + t_dat.c_cc[VMIN] = 1; + t_dat.c_cc[VTIME] = 0; + } + log(4,"stty: after iflag 0x%x, oflag 0x%x, cflag 0x%x lflag 0x%x", + t_dat.c_iflag, t_dat.c_oflag, t_dat.c_cflag, t_dat.c_lflag); + + if( tcsetattr( fd, TCSANOW, &t_dat) < 0 ){ + logerr_die(0, "cannot set tty parameters"); + } +} +#endif diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..3cb87de --- /dev/null +++ b/src/version.h @@ -0,0 +1 @@ +#define VERSION "lp_server-1.1.6"